rez-table-listing-mui 1.0.49 → 1.2.1
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 +5 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/App.tsx +80 -35
- package/src/assets/svg.tsx +5 -5
- package/src/components/filter/components/attributes-filter.tsx +78 -52
- package/src/components/filter/components/forms/components/Date.tsx +175 -66
- package/src/components/filter/components/forms/components/Dropdown.tsx +36 -3
- package/src/components/filter/components/forms/components/Filter-criteria.tsx +1 -1
- package/src/components/filter/components/forms/components/Multi-Select.tsx +62 -34
- package/src/components/filter/components/forms/index.tsx +20 -2
- package/src/components/filter/components/saved-filter.tsx +63 -9
- package/src/components/filter/index.tsx +3 -3
- package/src/components/filter/style.ts +1 -1
- package/src/components/index-table.tsx +42 -40
- package/src/components/index.scss +1 -1
- package/src/components/login/index.tsx +1 -1
- package/src/components/table-settings/common/info-alert.tsx +37 -0
- package/src/components/table-settings/common/listing-values.tsx +63 -48
- package/src/components/table-settings/components/column.tsx +210 -170
- package/src/components/table-settings/components/quick-tab.tsx +277 -153
- package/src/components/table-settings/components/sorting.tsx +135 -109
- package/src/components/table-settings/components/toggle-button-switch.tsx +2 -2
- package/src/components/table-settings/index.tsx +3 -5
- package/src/components/table-settings/style.ts +1 -0
- package/src/components/topbar/index.tsx +3 -1
- package/src/libs/hooks/useEntityTableAPI.tsx +1 -16
- package/src/libs/utils/apiColumn.ts +1 -11
- package/src/libs/utils/common.ts +4 -3
- package/src/types/filter-settings.ts +11 -0
- package/src/types/filter.ts +1 -2
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
DragEndEvent,
|
|
24
24
|
} from "@dnd-kit/core";
|
|
25
25
|
import {
|
|
26
|
-
|
|
26
|
+
QuickTabConfigProps,
|
|
27
27
|
SettingsQuickTabProps,
|
|
28
28
|
} from "../../../types/filter-settings";
|
|
29
29
|
import { TabsStyles } from "../style";
|
|
30
|
-
import
|
|
30
|
+
import InfoAlert from "../common/info-alert";
|
|
31
31
|
|
|
32
32
|
const QuickTab = ({
|
|
33
33
|
filterSettingStates,
|
|
@@ -35,116 +35,207 @@ const QuickTab = ({
|
|
|
35
35
|
tabsApiData,
|
|
36
36
|
tabsApiDataLoading,
|
|
37
37
|
}: SettingsQuickTabProps) => {
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
setQuickTabStates,
|
|
41
|
-
settingsData,
|
|
42
|
-
setColumnTabState,
|
|
43
|
-
saveButtonError,
|
|
44
|
-
setSaveButtonError,
|
|
45
|
-
} = filterSettingStates;
|
|
38
|
+
const { settingsData, setSettingsData, saveButtonError, setSaveButtonError } =
|
|
39
|
+
filterSettingStates;
|
|
46
40
|
|
|
47
41
|
const [searchTerm, setSearchTerm] = useState<string>("");
|
|
42
|
+
const [currentQuickAttribute, setCurrentQuickAttribute] = useState<string>(
|
|
43
|
+
settingsData?.quick_tab?.attribute || ""
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const quickTabStates = settingsData?.quick_tab as QuickTabConfigProps;
|
|
48
47
|
|
|
48
|
+
// In case there is no quick tab state from API
|
|
49
49
|
useEffect(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// if (quickTabStates && quickTabStates.show_list?.length) return;
|
|
54
|
-
setQuickTabStates({
|
|
55
|
-
attribute: columnsData?.column_list?.filter(
|
|
56
|
-
(item) => item.datasource_list
|
|
57
|
-
)[0]?.attribute_key,
|
|
58
|
-
sorting: sortingOptions[0]?.value as QuickTabSortingType,
|
|
59
|
-
hide_list: [],
|
|
60
|
-
show_list: [],
|
|
61
|
-
isAllSelected: true,
|
|
62
|
-
isCombineOther: false,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
50
|
+
const stateToArray =
|
|
51
|
+
(quickTabStates && Object.entries(quickTabStates)) || [];
|
|
52
|
+
const isEmptyState = stateToArray.length ? false : true;
|
|
65
53
|
|
|
66
|
-
if (
|
|
67
|
-
|
|
54
|
+
if (isEmptyState) {
|
|
55
|
+
setSettingsData((prev) => ({
|
|
68
56
|
...prev,
|
|
69
|
-
|
|
70
|
-
|
|
57
|
+
quick_tab: {
|
|
58
|
+
...prev?.quick_tab,
|
|
59
|
+
attribute: columnsData?.column_list?.filter(
|
|
60
|
+
(item) => item.datasource_list
|
|
61
|
+
)[0]?.attribute_key,
|
|
62
|
+
sorting: "asc",
|
|
63
|
+
},
|
|
71
64
|
}));
|
|
72
|
-
}
|
|
73
|
-
|
|
65
|
+
}
|
|
66
|
+
}, [columnsData]);
|
|
67
|
+
|
|
68
|
+
// When user changes attribute
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (currentQuickAttribute === settingsData?.quick_tab?.attribute) return;
|
|
71
|
+
|
|
72
|
+
if (tabsApiData?.length) {
|
|
73
|
+
setSettingsData((prev) => ({
|
|
74
74
|
...prev,
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
quick_tab: {
|
|
76
|
+
...prev?.quick_tab,
|
|
77
|
+
hide_list: tabsApiData,
|
|
78
|
+
show_list: [],
|
|
79
|
+
},
|
|
77
80
|
}));
|
|
81
|
+
|
|
82
|
+
setCurrentQuickAttribute(settingsData.quick_tab?.attribute || "");
|
|
78
83
|
}
|
|
79
|
-
}, [
|
|
84
|
+
}, [tabsApiData]);
|
|
80
85
|
|
|
81
|
-
//
|
|
86
|
+
// Validation when user changes show list or hide list
|
|
82
87
|
useEffect(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
88
|
+
const showList = quickTabStates?.show_list || [];
|
|
89
|
+
const hideList = quickTabStates?.hide_list || [];
|
|
90
|
+
|
|
91
|
+
if (showList || hideList) {
|
|
92
|
+
// Check if showList is valid (between 1 and 5 items)
|
|
93
|
+
const isValidShowList = showList.length > 0 && showList.length <= 5;
|
|
94
|
+
const ERROR_CODE = "quick_tab_error";
|
|
95
|
+
|
|
96
|
+
if (!isValidShowList) {
|
|
97
|
+
const errorMessage = {
|
|
98
|
+
type: ERROR_CODE,
|
|
99
|
+
message:
|
|
100
|
+
showList.length === 0
|
|
101
|
+
? "Quick Tab: Please select at least one item"
|
|
102
|
+
: "Quick Tab: Please select no more than 5 items",
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// Check if the error is already present in the messages array
|
|
106
|
+
const hasQuickTabError = saveButtonError?.messages?.some(
|
|
107
|
+
(message) => message.type === ERROR_CODE
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
// Update the error state
|
|
111
|
+
setSaveButtonError((prev) => {
|
|
112
|
+
const otherMessages =
|
|
113
|
+
prev?.messages?.filter((message) => message.type !== ERROR_CODE) ||
|
|
114
|
+
[];
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
...prev,
|
|
118
|
+
hasError: true,
|
|
119
|
+
messages: hasQuickTabError
|
|
120
|
+
? [...prev?.messages]
|
|
121
|
+
: [...otherMessages, errorMessage],
|
|
122
|
+
};
|
|
123
|
+
});
|
|
103
124
|
} else {
|
|
104
|
-
|
|
125
|
+
const hasOtherMessages = saveButtonError?.messages?.some(
|
|
126
|
+
(message) => message.type !== ERROR_CODE
|
|
127
|
+
);
|
|
128
|
+
// Reset error state if the list is valid
|
|
129
|
+
setSaveButtonError((prev) => ({
|
|
105
130
|
...prev,
|
|
106
|
-
|
|
131
|
+
hasError: hasOtherMessages,
|
|
132
|
+
messages:
|
|
133
|
+
prev?.messages?.filter((message) => message.type !== ERROR_CODE) ||
|
|
134
|
+
[],
|
|
107
135
|
}));
|
|
108
136
|
}
|
|
109
137
|
}
|
|
138
|
+
}, [quickTabStates?.hide_list, quickTabStates?.show_list]);
|
|
110
139
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
quickTabStates.show_list &&
|
|
114
|
-
(quickTabStates.show_list?.length === 0 ||
|
|
115
|
-
quickTabStates.show_list.length >= 5);
|
|
116
|
-
|
|
117
|
-
if (hasInvalidValidShowList) {
|
|
118
|
-
// Check if error is already in the state to avoid duplication
|
|
119
|
-
const errorMessage = {
|
|
120
|
-
type: "quick_tab_error",
|
|
121
|
-
message:
|
|
122
|
-
"Quick Tab : View as Tabs should have at least 1 and at most 5 tabs.",
|
|
123
|
-
};
|
|
124
|
-
const hasQuickTabError = saveButtonError?.messages?.some(
|
|
125
|
-
(message) => message.type === "quick_tab_error"
|
|
126
|
-
);
|
|
127
|
-
|
|
128
|
-
if (!hasQuickTabError) {
|
|
129
|
-
setSaveButtonError((prev) => ({
|
|
130
|
-
...prev,
|
|
131
|
-
hasError: true,
|
|
132
|
-
messages: [...(prev?.messages || []), errorMessage], // Only add if it doesn't exist
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
const otherMessages =
|
|
137
|
-
saveButtonError?.messages?.filter(
|
|
138
|
-
(message) => message.type !== "quick_tab_error"
|
|
139
|
-
) || [];
|
|
140
|
+
// useEffect(() => {
|
|
141
|
+
// // if Tab changes i dont want to reset the show list and hide list in tab change the api musnt trigger for the show list and hide list
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
143
|
+
// if (!Object.entries(quickTabStates).length) {
|
|
144
|
+
// // if (quickTabStates && quickTabStates.show_list?.length) return;
|
|
145
|
+
// setQuickTabStates({
|
|
146
|
+
// attribute: columnsData?.column_list?.filter(
|
|
147
|
+
// (item) => item.datasource_list
|
|
148
|
+
// )[0]?.attribute_key,
|
|
149
|
+
// sorting: sortingOptions[0]?.value as QuickTabSortingType,
|
|
150
|
+
// hide_list: [],
|
|
151
|
+
// show_list: [],
|
|
152
|
+
// isAllSelected: true,
|
|
153
|
+
// isCombineOther: false,
|
|
154
|
+
// });
|
|
155
|
+
// }
|
|
156
|
+
|
|
157
|
+
// if (settingsData?.quick_tab?.attribute !== quickTabStates?.attribute) {
|
|
158
|
+
// setQuickTabStates((prev) => ({
|
|
159
|
+
// ...prev,
|
|
160
|
+
// hide_list: tabsApiData, // All data goes to hide_list initially
|
|
161
|
+
// show_list: [], // Empty the show_list when attribute/sorting changes
|
|
162
|
+
// }));
|
|
163
|
+
// } else {
|
|
164
|
+
// setQuickTabStates((prev) => ({
|
|
165
|
+
// ...prev,
|
|
166
|
+
// hide_list: settingsData?.quick_tab?.hide_list,
|
|
167
|
+
// show_list: settingsData?.quick_tab?.show_list,
|
|
168
|
+
// }));
|
|
169
|
+
// }
|
|
170
|
+
// }, [columnsData.column_list, tabsApiData]);
|
|
171
|
+
|
|
172
|
+
// // When quickTabState show_list or hide_list changes, update the columnTabState
|
|
173
|
+
// useEffect(() => {
|
|
174
|
+
// if (Object.entries(settingsData?.column || {}).length) {
|
|
175
|
+
// const mappedColumns: ColumnItem[] =
|
|
176
|
+
// columnsData?.column_list?.map((column) => ({
|
|
177
|
+
// label: column?.name,
|
|
178
|
+
// value: column?.attribute_key,
|
|
179
|
+
// })) || [];
|
|
180
|
+
// //Later changed TabData to interface from filter settings types file
|
|
181
|
+
// const mappedTabs: TabData[] =
|
|
182
|
+
// quickTabStates?.show_list?.map((tab) => ({
|
|
183
|
+
// tab_name: tab,
|
|
184
|
+
// show_list: mappedColumns,
|
|
185
|
+
// hide_list: [],
|
|
186
|
+
// })) || [];
|
|
187
|
+
|
|
188
|
+
// if (settingsData?.column?.isDefault) {
|
|
189
|
+
// setColumnTabState((prev) => ({
|
|
190
|
+
// ...prev,
|
|
191
|
+
// show_list: mappedColumns,
|
|
192
|
+
// hide_list: [],
|
|
193
|
+
// }));
|
|
194
|
+
// } else {
|
|
195
|
+
// setColumnTabState((prev) => ({
|
|
196
|
+
// ...prev,
|
|
197
|
+
// tabs: mappedTabs,
|
|
198
|
+
// }));
|
|
199
|
+
// }
|
|
200
|
+
// }
|
|
201
|
+
|
|
202
|
+
// // check for error
|
|
203
|
+
// const hasInvalidValidShowList =
|
|
204
|
+
// quickTabStates.show_list &&
|
|
205
|
+
// (quickTabStates.show_list?.length === 0 ||
|
|
206
|
+
// quickTabStates.show_list.length >= 5);
|
|
207
|
+
|
|
208
|
+
// if (hasInvalidValidShowList) {
|
|
209
|
+
// // Check if error is already in the state to avoid duplication
|
|
210
|
+
// const errorMessage = {
|
|
211
|
+
// type: "quick_tab_error",
|
|
212
|
+
// message:
|
|
213
|
+
// "Quick Tab : View as Tabs should have at least 1 and at most 5 tabs.",
|
|
214
|
+
// };
|
|
215
|
+
// const hasQuickTabError = saveButtonError?.messages?.some(
|
|
216
|
+
// (message) => message.type === "quick_tab_error"
|
|
217
|
+
// );
|
|
218
|
+
|
|
219
|
+
// if (!hasQuickTabError) {
|
|
220
|
+
// setSaveButtonError((prev) => ({
|
|
221
|
+
// ...prev,
|
|
222
|
+
// hasError: true,
|
|
223
|
+
// messages: [...(prev?.messages || []), errorMessage], // Only add if it doesn't exist
|
|
224
|
+
// }));
|
|
225
|
+
// }
|
|
226
|
+
// } else {
|
|
227
|
+
// const otherMessages =
|
|
228
|
+
// saveButtonError?.messages?.filter(
|
|
229
|
+
// (message) => message.type !== "quick_tab_error"
|
|
230
|
+
// ) || [];
|
|
231
|
+
|
|
232
|
+
// setSaveButtonError((prev) => ({
|
|
233
|
+
// ...prev,
|
|
234
|
+
// hasError: otherMessages.length > 0,
|
|
235
|
+
// messages: otherMessages,
|
|
236
|
+
// }));
|
|
237
|
+
// }
|
|
238
|
+
// }, [quickTabStates.show_list, quickTabStates.hide_list]);
|
|
148
239
|
|
|
149
240
|
// useEffect(() => {
|
|
150
241
|
// setQuickTabStates((prev) => ({
|
|
@@ -185,11 +276,11 @@ const QuickTab = ({
|
|
|
185
276
|
];
|
|
186
277
|
|
|
187
278
|
// Convert show_list/hide_list to FilterValue[] for rendering only
|
|
188
|
-
const showListValues = (quickTabStates
|
|
279
|
+
const showListValues = (quickTabStates?.show_list || [])?.map((id) => ({
|
|
189
280
|
id,
|
|
190
281
|
label: id?.charAt(0)?.toUpperCase() + id?.slice(1),
|
|
191
282
|
}));
|
|
192
|
-
const hideListValues = (quickTabStates
|
|
283
|
+
const hideListValues = (quickTabStates?.hide_list || []).map((id) => ({
|
|
193
284
|
id,
|
|
194
285
|
label: id?.charAt(0)?.toUpperCase() + id?.slice(1),
|
|
195
286
|
}));
|
|
@@ -228,11 +319,15 @@ const QuickTab = ({
|
|
|
228
319
|
newShowList.splice(newIndex, 0, removed);
|
|
229
320
|
}
|
|
230
321
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
322
|
+
|
|
323
|
+
setSettingsData((prev) => ({
|
|
324
|
+
...prev,
|
|
325
|
+
quick_tab: {
|
|
326
|
+
...prev.quick_tab,
|
|
327
|
+
show_list: newShowList,
|
|
328
|
+
hide_list: newHideList,
|
|
329
|
+
},
|
|
330
|
+
}));
|
|
236
331
|
} else {
|
|
237
332
|
// Move between lists
|
|
238
333
|
let newShowList = [...(quickTabStates.show_list ?? [])];
|
|
@@ -254,11 +349,15 @@ const QuickTab = ({
|
|
|
254
349
|
newHideList.push(String(active.id));
|
|
255
350
|
}
|
|
256
351
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
352
|
+
|
|
353
|
+
setSettingsData((prev) => ({
|
|
354
|
+
...prev,
|
|
355
|
+
quick_tab: {
|
|
356
|
+
...prev.quick_tab,
|
|
357
|
+
show_list: newShowList,
|
|
358
|
+
hide_list: newHideList,
|
|
359
|
+
},
|
|
360
|
+
}));
|
|
262
361
|
}
|
|
263
362
|
};
|
|
264
363
|
|
|
@@ -277,42 +376,52 @@ const QuickTab = ({
|
|
|
277
376
|
|
|
278
377
|
const limitedHideList = currentHideList.slice(0, availableSlots);
|
|
279
378
|
|
|
280
|
-
|
|
281
|
-
...
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
379
|
+
setSettingsData((prev) => ({
|
|
380
|
+
...prev,
|
|
381
|
+
quick_tab: {
|
|
382
|
+
...prev.quick_tab,
|
|
383
|
+
show_list: [...currentShowList, ...limitedHideList],
|
|
384
|
+
hide_list: currentHideList.filter(
|
|
385
|
+
(item) => !limitedHideList.includes(item)
|
|
386
|
+
),
|
|
387
|
+
},
|
|
388
|
+
}));
|
|
287
389
|
};
|
|
288
390
|
|
|
289
391
|
const handleHideAll = () => {
|
|
290
|
-
|
|
291
|
-
...
|
|
292
|
-
|
|
293
|
-
...
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
392
|
+
setSettingsData((prev) => ({
|
|
393
|
+
...prev,
|
|
394
|
+
quick_tab: {
|
|
395
|
+
...prev.quick_tab,
|
|
396
|
+
hide_list: [
|
|
397
|
+
...(prev?.quick_tab?.hide_list || []),
|
|
398
|
+
...(prev?.quick_tab?.show_list || []),
|
|
399
|
+
],
|
|
400
|
+
show_list: [],
|
|
401
|
+
},
|
|
402
|
+
}));
|
|
298
403
|
};
|
|
299
404
|
|
|
300
405
|
// Checkbox logic (local only)
|
|
301
406
|
const handleShowAllTabChange = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
407
|
+
setSettingsData((prev) => ({
|
|
408
|
+
...prev,
|
|
409
|
+
quick_tab: {
|
|
410
|
+
...prev.quick_tab,
|
|
411
|
+
isAllSelected: e.target.checked,
|
|
412
|
+
},
|
|
413
|
+
}));
|
|
307
414
|
};
|
|
308
415
|
const handleCombineOtherTabChange = (
|
|
309
416
|
e: React.ChangeEvent<HTMLInputElement>
|
|
310
417
|
) => {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
418
|
+
setSettingsData((prev) => ({
|
|
419
|
+
...prev,
|
|
420
|
+
quick_tab: {
|
|
421
|
+
...prev.quick_tab,
|
|
422
|
+
isCombineOther: e.target.checked,
|
|
423
|
+
},
|
|
424
|
+
}));
|
|
316
425
|
};
|
|
317
426
|
|
|
318
427
|
const handleItemToggle = (itemId: string, fromContainerId: string) => {
|
|
@@ -336,11 +445,14 @@ const QuickTab = ({
|
|
|
336
445
|
}
|
|
337
446
|
}
|
|
338
447
|
|
|
339
|
-
|
|
340
|
-
...
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
448
|
+
setSettingsData((prev) => ({
|
|
449
|
+
...prev,
|
|
450
|
+
quick_tab: {
|
|
451
|
+
...prev.quick_tab,
|
|
452
|
+
show_list: toShowList,
|
|
453
|
+
hide_list: toHideList,
|
|
454
|
+
},
|
|
455
|
+
}));
|
|
344
456
|
};
|
|
345
457
|
|
|
346
458
|
const enableDND = quickTabStates?.sorting === "custom" ? true : false;
|
|
@@ -358,7 +470,7 @@ const QuickTab = ({
|
|
|
358
470
|
*Quick filter settings will be reflected in horizontal tabs
|
|
359
471
|
</Typography>
|
|
360
472
|
<Box>
|
|
361
|
-
<Grid container>
|
|
473
|
+
<Grid sx={{ position: "relative" }} container>
|
|
362
474
|
<Grid size={12}>
|
|
363
475
|
<Box>
|
|
364
476
|
<Grid sx={TabsStyles.mainTabDropdown} size={6}>
|
|
@@ -366,9 +478,12 @@ const QuickTab = ({
|
|
|
366
478
|
<Select
|
|
367
479
|
value={quickTabStates?.attribute || ""}
|
|
368
480
|
onChange={(e) =>
|
|
369
|
-
|
|
370
|
-
...
|
|
371
|
-
|
|
481
|
+
setSettingsData((prev) => ({
|
|
482
|
+
...prev,
|
|
483
|
+
quick_tab: {
|
|
484
|
+
...prev?.quick_tab,
|
|
485
|
+
attribute: e.target.value,
|
|
486
|
+
},
|
|
372
487
|
}))
|
|
373
488
|
}
|
|
374
489
|
>
|
|
@@ -389,12 +504,15 @@ const QuickTab = ({
|
|
|
389
504
|
size="small"
|
|
390
505
|
>
|
|
391
506
|
<Select
|
|
392
|
-
value={quickTabStates
|
|
507
|
+
value={quickTabStates?.sorting || "asc"}
|
|
393
508
|
onChange={(e) =>
|
|
394
|
-
|
|
395
|
-
...
|
|
396
|
-
|
|
397
|
-
|
|
509
|
+
setSettingsData((prev) => ({
|
|
510
|
+
...prev,
|
|
511
|
+
quick_tab: {
|
|
512
|
+
...prev?.quick_tab,
|
|
513
|
+
sorting: e.target.value,
|
|
514
|
+
},
|
|
515
|
+
}))
|
|
398
516
|
}
|
|
399
517
|
>
|
|
400
518
|
{sortingOptions.map((option) => (
|
|
@@ -407,13 +525,8 @@ const QuickTab = ({
|
|
|
407
525
|
</Grid>
|
|
408
526
|
</Box>
|
|
409
527
|
</Grid>
|
|
410
|
-
<Grid
|
|
411
|
-
|
|
412
|
-
marginLeft: "33.2rem",
|
|
413
|
-
}}
|
|
414
|
-
size={12}
|
|
415
|
-
>
|
|
416
|
-
<Alert
|
|
528
|
+
<Grid>
|
|
529
|
+
{/* <Alert
|
|
417
530
|
severity="info"
|
|
418
531
|
sx={{
|
|
419
532
|
fontSize: "12px",
|
|
@@ -421,14 +534,14 @@ const QuickTab = ({
|
|
|
421
534
|
}}
|
|
422
535
|
>
|
|
423
536
|
Please select at least 1 and at most 5 values to display as tabs.
|
|
424
|
-
</Alert>
|
|
537
|
+
</Alert> */}
|
|
425
538
|
</Grid>
|
|
426
539
|
<DndContext
|
|
427
540
|
sensors={sensors}
|
|
428
541
|
collisionDetection={closestCenter}
|
|
429
542
|
onDragEnd={handleDragEnd}
|
|
430
543
|
>
|
|
431
|
-
<Grid container spacing={2} size={12}>
|
|
544
|
+
<Grid sx={{ mt: 2 }} container spacing={2} size={12}>
|
|
432
545
|
<ListingValues
|
|
433
546
|
buttonText="Show All"
|
|
434
547
|
onClick={handleShowAll}
|
|
@@ -450,6 +563,17 @@ const QuickTab = ({
|
|
|
450
563
|
// tabsApiDataLoading={tabsApiDataLoading}
|
|
451
564
|
onItemToggle={handleItemToggle}
|
|
452
565
|
enableDragAndDrop={enableDND}
|
|
566
|
+
AlertComponenet={
|
|
567
|
+
<InfoAlert
|
|
568
|
+
message="Please select at least 1 and at most 5 values to display as
|
|
569
|
+
tabs."
|
|
570
|
+
width={"49%"}
|
|
571
|
+
position="absolute"
|
|
572
|
+
color="#088AB2"
|
|
573
|
+
top={10}
|
|
574
|
+
zIndex={1}
|
|
575
|
+
/>
|
|
576
|
+
}
|
|
453
577
|
/>
|
|
454
578
|
</Grid>
|
|
455
579
|
</DndContext>
|