rez-table-listing-mui 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez-table-listing-mui",
3
- "version": "2.0.13",
3
+ "version": "2.0.14",
4
4
  "type": "module",
5
5
  "description": "A rez table listing component built on TanStack Table",
6
6
  "main": "dist/index.js",
@@ -1,5 +1,25 @@
1
- import { useQuery } from "@tanstack/react-query";
1
+ import { useQueries, useQuery } from "@tanstack/react-query";
2
2
  import { getKanbanData } from "../services/service";
3
+ import { commonFetchDropdownDataAPI } from "../../listing/libs/utils/apiColumn";
4
+
5
+ export const kanbanDropdownResults = (
6
+ entity_type: string,
7
+ enterprise_id: string
8
+ ) => {
9
+ return useQueries({
10
+ queries: [
11
+ {
12
+ queryKey: ["commonDropdown", entity_type, enterprise_id],
13
+ queryFn: () =>
14
+ commonFetchDropdownDataAPI({
15
+ entity_type,
16
+ enterprise_id,
17
+ }),
18
+ enabled: !!enterprise_id,
19
+ },
20
+ ],
21
+ });
22
+ };
3
23
 
4
24
  export const useGetKanbanData = (entity_type: string) => {
5
25
  const {
@@ -174,7 +174,7 @@ const AttributesFilter = ({
174
174
  }}
175
175
  >
176
176
  {columnsData?.column_list
177
- ?.filter((column) => column.element_type.includes("select"))
177
+ ?.filter((column) => column?.element_type?.includes("select"))
178
178
  .map((column, index) => (
179
179
  <MenuItem
180
180
  key={index}
@@ -12,6 +12,7 @@ import useElementWidth from "../../../../../libs/hooks/useElementWidth";
12
12
  import { onFilterChangeFunctionProps } from "../../../../../types/common";
13
13
  import FilterCriteriaEntityList from "./filter-criteria-entity-list";
14
14
  import FilterCriteriaList from "./filter-criteria-list";
15
+ import { getOperationKeyByElementType } from "../utils/filter-date-input-resolver";
15
16
 
16
17
  const FilterCriteria = ({
17
18
  columnsData,
@@ -67,10 +68,11 @@ const FilterCriteria = ({
67
68
 
68
69
  const defaultValue = attribute.element_type === "multiselect" ? [] : "";
69
70
 
70
- const defaultOperator = dropdownOptions?.[0]?.value || "";
71
+ const operationKey = getOperationKeyByElementType(attribute?.element_type);
71
72
 
72
73
  const matchingDropdownList =
73
- columnsData?.operation_list[attribute.element_type] || [];
74
+ columnsData?.operation_list?.[operationKey] || [];
75
+ const defaultOperator = matchingDropdownList[0]?.value || "";
74
76
 
75
77
  const newFilter = {
76
78
  filter_attribute: attribute.attribute_key,
@@ -38,7 +38,7 @@ export const resolveFilterInput = ({
38
38
  const dataType = filter?.filter_attribute_data_type;
39
39
 
40
40
  // TEXT / NUMBER → always textfield
41
- if (dataType === "text" || dataType === "number") {
41
+ if (dataType === "text" || dataType === "number" || dataType === "label") {
42
42
  return (
43
43
  <FormTextfield
44
44
  filter={filter}
@@ -104,3 +104,38 @@ export const resolveFilterInput = ({
104
104
 
105
105
  return <FormControl fullWidth size="small" />;
106
106
  };
107
+
108
+ export const getOperationKeyByElementType = (elementType: string) => {
109
+ switch (elementType) {
110
+ case "text":
111
+ case "textarea":
112
+ case "email":
113
+ case "phone":
114
+ case "password":
115
+ case "url":
116
+ case "label":
117
+ return "text";
118
+
119
+ case "number":
120
+ case "decimal":
121
+ case "file-upload":
122
+ return "number";
123
+
124
+ case "date":
125
+ case "datetime":
126
+ return "date";
127
+
128
+ case "select":
129
+ case "radio":
130
+ case "multiselect":
131
+ case "multicheckbox":
132
+ case "checkbox":
133
+ return "select";
134
+
135
+ case "year":
136
+ return "year";
137
+
138
+ default:
139
+ return "text";
140
+ }
141
+ };
@@ -8,10 +8,10 @@ const LoginButton = () => {
8
8
  const handleLogin = async () => {
9
9
  setLoading(true);
10
10
  // const api_url = "https://api.eth-qa.rezolut.in/api/enrol/auth";
11
- const api_url = "http://localhost:6010/api/auth";
12
- const email_id = "admin@rezolut.in";
11
+ const api_url = "http://localhost:6011/api/auth";
12
+ const email_id = "yash.joshi@rezolut.in";
13
13
  const verify_otp = "123456";
14
- const sub_domain = "platform";
14
+ const sub_domain = "demo1";
15
15
 
16
16
  setLoading(true);
17
17