rez-table-listing-mui 1.3.17 → 1.3.18
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/dist/index.d.ts +18 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/kanban/index.tsx +8 -10
- package/src/listing/components/login/index.tsx +66 -24
- package/src/listing/components/table-settings/common/listing-values.tsx +22 -19
- package/src/listing/components/table-settings/components/column.tsx +13 -8
- package/src/listing/components/table-settings/components/group-by.tsx +1 -1
- package/src/listing/components/table-settings/components/lane.tsx +1 -1
- package/src/listing/components/table-settings/components/quick-tab.tsx +45 -35
- package/src/listing/components/table-settings/components/sorting.tsx +90 -68
- package/src/listing/components/table-settings/index.tsx +6 -2
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +22 -1
- package/src/listing/libs/services/getLayoutAPI.tsx +1 -1
- package/src/listing/libs/utils/apiColumn.ts +18 -0
- package/src/listing/libs/utils/common.ts +2 -2
- package/src/listing/types/filter-settings.ts +13 -9
- package/src/view/KanbanView.tsx +1 -1
- package/src/view/ListingView.tsx +55 -11
|
@@ -38,7 +38,7 @@ const Sorting = ({
|
|
|
38
38
|
filterSettingStates;
|
|
39
39
|
|
|
40
40
|
const [activeTab, setActiveTab] = useState<string | undefined>(
|
|
41
|
-
quickTabStates?.show_list?.[0]
|
|
41
|
+
quickTabStates?.show_list?.[0].value
|
|
42
42
|
);
|
|
43
43
|
|
|
44
44
|
const columnTabState = settingsData?.column as ColumnTabConfigProps;
|
|
@@ -55,64 +55,91 @@ const Sorting = ({
|
|
|
55
55
|
|
|
56
56
|
const ERROR_CODE = "sorting_error";
|
|
57
57
|
|
|
58
|
+
// useEffect(() => {
|
|
59
|
+
// const emptySortBy: SortingConfigSortByProps[] = [
|
|
60
|
+
// { column: "", order: "asc" },
|
|
61
|
+
// ];
|
|
62
|
+
|
|
63
|
+
// if (isStateEmpty) {
|
|
64
|
+
// setSettingsData((prev) => ({
|
|
65
|
+
// ...prev,
|
|
66
|
+
// sorting: {
|
|
67
|
+
// isDefault: true,
|
|
68
|
+
// sortby: emptySortBy,
|
|
69
|
+
// },
|
|
70
|
+
// }));
|
|
71
|
+
// } else if (isEmptyDefault) {
|
|
72
|
+
// setSettingsData((prev) => ({
|
|
73
|
+
// ...prev,
|
|
74
|
+
// sorting: {
|
|
75
|
+
// ...prev.sorting,
|
|
76
|
+
// isDefault: true,
|
|
77
|
+
// },
|
|
78
|
+
// }));
|
|
79
|
+
|
|
80
|
+
// if (!sortingTabState?.isDefault) {
|
|
81
|
+
// setSettingsData((prev) => ({
|
|
82
|
+
// ...prev,
|
|
83
|
+
// sorting: {
|
|
84
|
+
// ...prev.sorting,
|
|
85
|
+
// sortby: emptySortBy,
|
|
86
|
+
// },
|
|
87
|
+
// }));
|
|
88
|
+
// }
|
|
89
|
+
// }
|
|
90
|
+
// }, [
|
|
91
|
+
// isStateEmpty,
|
|
92
|
+
// isEmptyDefault,
|
|
93
|
+
// sortingTabState,
|
|
94
|
+
// quickTabStates,
|
|
95
|
+
// setSettingsData,
|
|
96
|
+
// ]);
|
|
97
|
+
|
|
58
98
|
useEffect(() => {
|
|
59
99
|
const emptySortBy: SortingConfigSortByProps[] = [
|
|
60
100
|
{ column: "", order: "asc" },
|
|
61
101
|
];
|
|
62
102
|
|
|
63
|
-
if
|
|
103
|
+
// if sorting state is empty, initialize once
|
|
104
|
+
if (!sortingTabState || Object.keys(sortingTabState).length === 0) {
|
|
64
105
|
setSettingsData((prev) => ({
|
|
65
106
|
...prev,
|
|
66
|
-
sorting: {
|
|
67
|
-
isDefault: true,
|
|
68
|
-
sortby: emptySortBy,
|
|
69
|
-
},
|
|
107
|
+
sorting: { isDefault: true, sortby: emptySortBy },
|
|
70
108
|
}));
|
|
71
|
-
|
|
109
|
+
return; // ✅ prevent further execution
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// if sortby is missing or empty
|
|
113
|
+
if (!sortingTabState?.sortby || sortingTabState?.sortby.length === 0) {
|
|
72
114
|
setSettingsData((prev) => ({
|
|
73
115
|
...prev,
|
|
74
116
|
sorting: {
|
|
75
117
|
...prev.sorting,
|
|
118
|
+
sortby: emptySortBy,
|
|
76
119
|
isDefault: true,
|
|
77
120
|
},
|
|
78
121
|
}));
|
|
79
|
-
|
|
80
|
-
if (!sortingTabState?.isDefault) {
|
|
81
|
-
setSettingsData((prev) => ({
|
|
82
|
-
...prev,
|
|
83
|
-
sorting: {
|
|
84
|
-
...prev.sorting,
|
|
85
|
-
sortby: emptySortBy,
|
|
86
|
-
},
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
122
|
}
|
|
90
|
-
}, [
|
|
91
|
-
isStateEmpty,
|
|
92
|
-
isEmptyDefault,
|
|
93
|
-
sortingTabState,
|
|
94
|
-
quickTabStates,
|
|
95
|
-
setSettingsData,
|
|
96
|
-
]);
|
|
123
|
+
}, []);
|
|
97
124
|
|
|
98
125
|
// sortingTabState.sortby is filtered based on columnTabState.show_list
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}, [columnTabState?.show_list]);
|
|
126
|
+
// useEffect(() => {
|
|
127
|
+
// // filter sorting sortby based on column show list
|
|
128
|
+
// if (columnTabState?.isDefault) {
|
|
129
|
+
// setSettingsData((prev) => ({
|
|
130
|
+
// ...prev,
|
|
131
|
+
// sorting: {
|
|
132
|
+
// ...prev.sorting,
|
|
133
|
+
// // remove sortby items that are not in column show list
|
|
134
|
+
// sortby: prev.sorting?.sortby?.filter((item) =>
|
|
135
|
+
// columnTabState?.show_list?.some(
|
|
136
|
+
// (columnItem) => columnItem.value === item.column
|
|
137
|
+
// )
|
|
138
|
+
// ),
|
|
139
|
+
// },
|
|
140
|
+
// }));
|
|
141
|
+
// }
|
|
142
|
+
// }, [columnTabState?.show_list]);
|
|
116
143
|
|
|
117
144
|
const sensors = useSensors(useSensor(PointerSensor));
|
|
118
145
|
|
|
@@ -231,14 +258,11 @@ const Sorting = ({
|
|
|
231
258
|
* if both are equal then showAddSortButton is false
|
|
232
259
|
*/
|
|
233
260
|
const showAddSortButton = useMemo(() => {
|
|
234
|
-
const stateLength =
|
|
235
|
-
columnTabState?.show_list?.length ??
|
|
236
|
-
columnsData?.column_list?.length ??
|
|
237
|
-
0;
|
|
261
|
+
const stateLength = columnsData?.length ?? 0;
|
|
238
262
|
const sortLength = sortingTabState?.sortby?.length ?? 0;
|
|
239
263
|
|
|
240
264
|
return sortLength !== stateLength;
|
|
241
|
-
}, [
|
|
265
|
+
}, [columnsData, sortingTabState]);
|
|
242
266
|
|
|
243
267
|
/**
|
|
244
268
|
* ? What is happening here?
|
|
@@ -257,20 +281,13 @@ const Sorting = ({
|
|
|
257
281
|
const getCurrentLists = () => {
|
|
258
282
|
if (sortingTabState?.isDefault) {
|
|
259
283
|
return {
|
|
260
|
-
showList:
|
|
261
|
-
columnTabState?.show_list ||
|
|
262
|
-
// if columns isDefault and show_list is empty, show all columns
|
|
263
|
-
columnsData?.column_list?.map((column) => ({
|
|
264
|
-
label: column.name,
|
|
265
|
-
value: column.attribute_key,
|
|
266
|
-
})) ||
|
|
267
|
-
[],
|
|
284
|
+
showList: columnsData || [],
|
|
268
285
|
hideList: columnTabState?.hide_list || [],
|
|
269
286
|
};
|
|
270
287
|
} else {
|
|
271
288
|
const currentTab = columnTabState?.tabs?.[activeTabIndex || 0];
|
|
272
289
|
return {
|
|
273
|
-
showList:
|
|
290
|
+
showList: columnsData || [],
|
|
274
291
|
hideList: currentTab?.hide_list || [],
|
|
275
292
|
};
|
|
276
293
|
}
|
|
@@ -297,7 +314,7 @@ const Sorting = ({
|
|
|
297
314
|
onChange={(_, tab) => setActiveTab(tab)}
|
|
298
315
|
>
|
|
299
316
|
{quickTabStates?.show_list?.map((tab) => (
|
|
300
|
-
<Tab key={tab} label={tab} value={tab} />
|
|
317
|
+
<Tab key={tab?.value} label={tab?.label} value={tab?.value} />
|
|
301
318
|
))}
|
|
302
319
|
</CustomTabs>
|
|
303
320
|
)}
|
|
@@ -327,18 +344,23 @@ const Sorting = ({
|
|
|
327
344
|
fullWidth
|
|
328
345
|
>
|
|
329
346
|
{showList
|
|
330
|
-
?.filter((column) => column.value != "action")
|
|
331
|
-
.map(
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
347
|
+
// ?.filter((column) => column.value != "action")
|
|
348
|
+
.map(
|
|
349
|
+
(
|
|
350
|
+
column: { label: string; value: string },
|
|
351
|
+
index: number
|
|
352
|
+
) => (
|
|
353
|
+
<MenuItem
|
|
354
|
+
key={index}
|
|
355
|
+
value={column.value}
|
|
356
|
+
disabled={tabSortedList.some(
|
|
357
|
+
(s) => s.column === column?.value
|
|
358
|
+
)}
|
|
359
|
+
>
|
|
360
|
+
{column?.label}
|
|
361
|
+
</MenuItem>
|
|
362
|
+
)
|
|
363
|
+
)}
|
|
342
364
|
</Select>
|
|
343
365
|
<Select
|
|
344
366
|
value={sort.order}
|
|
@@ -30,6 +30,10 @@ export function QuickFilterSettings({
|
|
|
30
30
|
onClose,
|
|
31
31
|
columnsData,
|
|
32
32
|
columnsDataLoading,
|
|
33
|
+
quickTabAttributes,
|
|
34
|
+
quickTabAttributesLoading,
|
|
35
|
+
sortingTabAttributes,
|
|
36
|
+
sortingTabAttributesLoading,
|
|
33
37
|
tabsApiData,
|
|
34
38
|
tabsApiDataLoading,
|
|
35
39
|
onSaveSettingsData,
|
|
@@ -125,7 +129,7 @@ export function QuickFilterSettings({
|
|
|
125
129
|
{tabValue === 0 && (
|
|
126
130
|
<QuickTab
|
|
127
131
|
filterSettingStates={filterSettingStates}
|
|
128
|
-
columnsData={
|
|
132
|
+
columnsData={quickTabAttributes}
|
|
129
133
|
tabsApiData={tabsApiData}
|
|
130
134
|
tabsApiDataLoading={tabsApiDataLoading}
|
|
131
135
|
/>
|
|
@@ -149,7 +153,7 @@ export function QuickFilterSettings({
|
|
|
149
153
|
{tabValue === 2 && (
|
|
150
154
|
<Sorting
|
|
151
155
|
filterSettingStates={filterSettingStates}
|
|
152
|
-
columnsData={
|
|
156
|
+
columnsData={sortingTabAttributes}
|
|
153
157
|
/>
|
|
154
158
|
)}
|
|
155
159
|
</CustomTabPanel>
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
updateSavedFilter,
|
|
23
23
|
viewSettingsDropDown,
|
|
24
24
|
getOperationList,
|
|
25
|
+
getLayoutAttributes,
|
|
25
26
|
} from "../utils/apiColumn";
|
|
26
27
|
import {
|
|
27
28
|
FilterDataMainFilterEntityListProps,
|
|
@@ -99,7 +100,7 @@ export const useEntityTableAPI = ({
|
|
|
99
100
|
queryKey: ["entityTable", page, size, tabs, quickFilter],
|
|
100
101
|
queryFn: () =>
|
|
101
102
|
entityListingCall({
|
|
102
|
-
page,
|
|
103
|
+
page: page + 1,
|
|
103
104
|
size,
|
|
104
105
|
entity_type,
|
|
105
106
|
tabs,
|
|
@@ -366,3 +367,23 @@ export const useGetOperationList = () => {
|
|
|
366
367
|
|
|
367
368
|
return { operationList };
|
|
368
369
|
};
|
|
370
|
+
|
|
371
|
+
export const useGetLayoutAttributes = ({
|
|
372
|
+
entity_type,
|
|
373
|
+
data_type,
|
|
374
|
+
}: {
|
|
375
|
+
entity_type: string;
|
|
376
|
+
data_type?: string;
|
|
377
|
+
}) => {
|
|
378
|
+
// First query to get meta data
|
|
379
|
+
const layoutAttributes = useQuery({
|
|
380
|
+
queryKey: ["layoutAttributes", entity_type, data_type],
|
|
381
|
+
queryFn: () =>
|
|
382
|
+
getLayoutAttributes({
|
|
383
|
+
entity_type,
|
|
384
|
+
data_type,
|
|
385
|
+
}),
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
return { layoutAttributes };
|
|
389
|
+
};
|
|
@@ -190,3 +190,21 @@ export const getOperationList = async () => {
|
|
|
190
190
|
const response = await api.post(`/meta/operation-list`);
|
|
191
191
|
return response.data;
|
|
192
192
|
};
|
|
193
|
+
|
|
194
|
+
export const getLayoutAttributes = async ({
|
|
195
|
+
entity_type,
|
|
196
|
+
data_type,
|
|
197
|
+
}: {
|
|
198
|
+
entity_type: string;
|
|
199
|
+
data_type?: string;
|
|
200
|
+
}) => {
|
|
201
|
+
const params = {
|
|
202
|
+
data_type,
|
|
203
|
+
};
|
|
204
|
+
const response = await api.post(
|
|
205
|
+
`/layout-preference/attributes`,
|
|
206
|
+
{ entity_type },
|
|
207
|
+
{ params }
|
|
208
|
+
);
|
|
209
|
+
return response.data;
|
|
210
|
+
};
|
|
@@ -77,14 +77,14 @@ export function customDebounce<T extends (...args: any[]) => any>(
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
//ENTITY TYPE
|
|
80
|
-
const ENVIRONMENT = "
|
|
80
|
+
const ENVIRONMENT = "uat";
|
|
81
81
|
export const ENTITY_TYPE = "LEAD";
|
|
82
82
|
export const MAPPED_ENTITY_TYPE = "LYPR"; // LAP OR LYPR
|
|
83
83
|
|
|
84
84
|
const environments = {
|
|
85
85
|
adm_dev: "http://localhost:4010/api",
|
|
86
86
|
crm_dev: "http://localhost:4011/api",
|
|
87
|
-
uat: "
|
|
87
|
+
uat: "https://api.eth-qa.rezolut.in/api/enrol",
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
const getBaseUrl = () => environments[ENVIRONMENT];
|
|
@@ -7,8 +7,12 @@ export interface QuickFilterModalProps {
|
|
|
7
7
|
filterSettingStates: craftTableFilterSettingsOptionsProps;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
columnsData: FilterColumnsDataProps;
|
|
10
|
-
columnsDataLoading
|
|
11
|
-
|
|
10
|
+
columnsDataLoading?: boolean;
|
|
11
|
+
quickTabAttributes?: any[];
|
|
12
|
+
quickTabAttributesLoading?: boolean;
|
|
13
|
+
sortingTabAttributes?: any[];
|
|
14
|
+
sortingTabAttributesLoading?: boolean;
|
|
15
|
+
tabsApiData?: { label: string; value: string }[];
|
|
12
16
|
tabsApiDataLoading?: boolean;
|
|
13
17
|
onSaveSettingsData?: (data: any) => void;
|
|
14
18
|
}
|
|
@@ -26,8 +30,8 @@ export type QuickTabSortingType =
|
|
|
26
30
|
export interface QuickTabConfigProps {
|
|
27
31
|
attribute?: string;
|
|
28
32
|
sorting?: QuickTabSortingType;
|
|
29
|
-
hide_list?: string[];
|
|
30
|
-
show_list?: string[];
|
|
33
|
+
hide_list?: { label: string; value: string }[];
|
|
34
|
+
show_list?: { label: string; value: string }[];
|
|
31
35
|
isAllSelected?: boolean;
|
|
32
36
|
isCombineOther?: boolean;
|
|
33
37
|
}
|
|
@@ -75,22 +79,22 @@ export interface TabWiseConfigProps {
|
|
|
75
79
|
|
|
76
80
|
export interface SettingsSortingProps {
|
|
77
81
|
filterSettingStates: craftTableFilterSettingsOptionsProps;
|
|
78
|
-
columnsData:
|
|
82
|
+
columnsData: any;
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
export interface SettingsQuickTabStateProps {
|
|
82
86
|
attribute?: string;
|
|
83
87
|
sorting?: string;
|
|
84
|
-
hide_list: string[];
|
|
85
|
-
show_list: string[];
|
|
88
|
+
hide_list: { label: string; value: string }[];
|
|
89
|
+
show_list: { label: string; value: string }[];
|
|
86
90
|
isAllSelected?: boolean;
|
|
87
91
|
isCombineOther?: boolean;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
export interface SettingsQuickTabProps {
|
|
91
95
|
filterSettingStates: craftTableFilterSettingsOptionsProps;
|
|
92
|
-
columnsData:
|
|
93
|
-
tabsApiData?: string[];
|
|
96
|
+
columnsData: any;
|
|
97
|
+
tabsApiData?: { label: string; value: string }[];
|
|
94
98
|
tabsApiDataLoading?: boolean;
|
|
95
99
|
}
|
|
96
100
|
|
package/src/view/KanbanView.tsx
CHANGED
package/src/view/ListingView.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import { ENTITY_TYPE, MAPPED_ENTITY_TYPE } from "../listing/libs/utils/common";
|
|
|
10
10
|
import {
|
|
11
11
|
useCommonFilterDropdownAPI,
|
|
12
12
|
useEntityTableAPI,
|
|
13
|
+
useGetLayoutAttributes,
|
|
13
14
|
useGetOperationList,
|
|
14
15
|
useGetSettingsDataAPI,
|
|
15
16
|
useSaveSettingsDataAPI,
|
|
@@ -24,6 +25,9 @@ import { QuickFilterSettings } from "../listing/components/table-settings";
|
|
|
24
25
|
import CraftTableFilterWrapper from "./FIlterWrapper";
|
|
25
26
|
import { saveLayoutAPI } from "../listing/libs/services/saveLayoutAPI";
|
|
26
27
|
import { hydrateSavedFilters } from "../listing/libs/utils/hydrate-saved-filters";
|
|
28
|
+
import { useGetNavigationLayoutAPI } from "../listing/libs/hooks/useGetNavigationLayoutAPI";
|
|
29
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
30
|
+
import { Box, CircularProgress, Typography } from "@mui/material";
|
|
27
31
|
|
|
28
32
|
function ListingView() {
|
|
29
33
|
// const [mockLoading, setMockLoading] = useState<boolean>(true);
|
|
@@ -53,6 +57,15 @@ function ListingView() {
|
|
|
53
57
|
const { saveSettingsDataMutation } = useSaveSettingsDataAPI(ENTITY_TYPE);
|
|
54
58
|
const { operationList } = useGetOperationList();
|
|
55
59
|
|
|
60
|
+
const { layoutAttributes: quickTabAttributes } = useGetLayoutAttributes({
|
|
61
|
+
entity_type: ENTITY_TYPE,
|
|
62
|
+
data_type: "select",
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
const { layoutAttributes: sortingTabAttributes } = useGetLayoutAttributes({
|
|
66
|
+
entity_type: ENTITY_TYPE,
|
|
67
|
+
});
|
|
68
|
+
|
|
56
69
|
// const { dropdownData } = useCommonDropdownAPI(
|
|
57
70
|
// dropdownColumnList || metaQuery.data.column_list
|
|
58
71
|
// );
|
|
@@ -65,7 +78,8 @@ function ListingView() {
|
|
|
65
78
|
sort_by: filterSettingStates?.quickTabStates?.sorting,
|
|
66
79
|
});
|
|
67
80
|
|
|
68
|
-
const
|
|
81
|
+
const queryClient = useQueryClient();
|
|
82
|
+
const { data: getSettingsAPIData } = useGetNavigationLayoutAPI(ENTITY_TYPE);
|
|
69
83
|
|
|
70
84
|
useEffect(() => {
|
|
71
85
|
// setTimeout(() => {
|
|
@@ -162,20 +176,19 @@ function ListingView() {
|
|
|
162
176
|
}, [detailsQuery.data]);
|
|
163
177
|
|
|
164
178
|
useEffect(() => {
|
|
165
|
-
setSettingsData(getSettingsAPIData
|
|
179
|
+
setSettingsData(getSettingsAPIData);
|
|
166
180
|
}, [getSettingsAPIData]);
|
|
167
181
|
|
|
168
182
|
//For server side sorting
|
|
169
183
|
const enableServerSideSorting = true;
|
|
170
184
|
|
|
171
|
-
const { tableData } = useEntityTableAPI({
|
|
185
|
+
const { tableData, isTableDataPending } = useEntityTableAPI({
|
|
172
186
|
page: 0,
|
|
173
|
-
size:
|
|
187
|
+
size: 20,
|
|
174
188
|
entity_type: ENTITY_TYPE,
|
|
175
189
|
tabs: {
|
|
176
|
-
columnName:
|
|
177
|
-
|
|
178
|
-
sortBy: getSettingsAPIData?.layout_json?.quick_tab?.sorting || "ASC",
|
|
190
|
+
columnName: getSettingsAPIData?.quick_tab?.attribute || "lead_status",
|
|
191
|
+
sortBy: getSettingsAPIData?.quick_tab?.sorting || "ASC",
|
|
179
192
|
value:
|
|
180
193
|
selectedTab.toLowerCase() === "all" ? "" : selectedTab.toLowerCase(),
|
|
181
194
|
},
|
|
@@ -267,7 +280,7 @@ function ListingView() {
|
|
|
267
280
|
entity_type: MAPPED_ENTITY_TYPE,
|
|
268
281
|
mapped_entity_type: ENTITY_TYPE,
|
|
269
282
|
mapped_json: data,
|
|
270
|
-
type: "
|
|
283
|
+
type: "layout",
|
|
271
284
|
};
|
|
272
285
|
|
|
273
286
|
await saveLayoutAPI(payload);
|
|
@@ -277,13 +290,40 @@ function ListingView() {
|
|
|
277
290
|
const payload = {
|
|
278
291
|
entity_type: MAPPED_ENTITY_TYPE,
|
|
279
292
|
mapped_entity_type: ENTITY_TYPE,
|
|
280
|
-
|
|
293
|
+
mapped_json: settingsData,
|
|
294
|
+
type: "layout",
|
|
281
295
|
};
|
|
282
296
|
|
|
283
|
-
saveSettingsDataMutation.mutate(
|
|
297
|
+
saveSettingsDataMutation.mutate(
|
|
298
|
+
{ payload },
|
|
299
|
+
{
|
|
300
|
+
onSuccess: () => {
|
|
301
|
+
queryClient.invalidateQueries({
|
|
302
|
+
queryKey: ["GET_NAVIGATION_LAYOUT", ENTITY_TYPE],
|
|
303
|
+
});
|
|
304
|
+
},
|
|
305
|
+
}
|
|
306
|
+
);
|
|
284
307
|
};
|
|
285
308
|
|
|
286
|
-
return (
|
|
309
|
+
return isTableDataPending ? (
|
|
310
|
+
<Box
|
|
311
|
+
sx={{
|
|
312
|
+
// full viewport height
|
|
313
|
+
display: "flex",
|
|
314
|
+
flexDirection: "column",
|
|
315
|
+
alignItems: "center",
|
|
316
|
+
justifyContent: "center",
|
|
317
|
+
gap: 2,
|
|
318
|
+
bgcolor: "background.default",
|
|
319
|
+
}}
|
|
320
|
+
>
|
|
321
|
+
<CircularProgress size={60} thickness={5} color="primary" />
|
|
322
|
+
<Typography variant="body1" color="text.secondary">
|
|
323
|
+
Loading, please wait...
|
|
324
|
+
</Typography>
|
|
325
|
+
</Box>
|
|
326
|
+
) : (
|
|
287
327
|
<TableWrapper
|
|
288
328
|
data={filteredData}
|
|
289
329
|
columns={columns && columns.length > 0 ? columns : defaultColumns}
|
|
@@ -388,6 +428,10 @@ function ListingView() {
|
|
|
388
428
|
onClose={() => setShowListViewSettings(false)}
|
|
389
429
|
columnsData={metaQuery.data || {}}
|
|
390
430
|
columnsDataLoading={metaQuery.isPending}
|
|
431
|
+
quickTabAttributes={quickTabAttributes?.data}
|
|
432
|
+
quickTabAttributesLoading={quickTabAttributes?.isLoading}
|
|
433
|
+
sortingTabAttributes={sortingTabAttributes?.data}
|
|
434
|
+
sortingTabAttributesLoading={sortingTabAttributes?.isLoading}
|
|
391
435
|
tabsApiData={settingsTabDropdownData || []}
|
|
392
436
|
tabsApiDataLoading={settingsTabDropdownPending}
|
|
393
437
|
onSaveSettingsData={handleSaveSettingsData}
|