rez-table-listing-mui 1.2.16 → 1.2.17
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 +8 -1
- 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/assets/svg.tsx +2 -1
- package/src/kanban/index.tsx +11 -2
- package/src/listing/components/filter/components/attributes-filter.tsx +156 -50
- package/src/listing/components/filter/components/forms/components/Filter-criteria.tsx +21 -2
- package/src/listing/components/filter/components/forms/index.tsx +29 -9
- package/src/listing/components/filter/components/main-filter.tsx +16 -1
- package/src/listing/components/filter/components/saved-edit-filter.tsx +27 -0
- package/src/listing/components/filter/components/saved-filter.tsx +66 -25
- package/src/listing/components/filter/index.tsx +56 -44
- package/src/listing/components/index.scss +1 -1
- package/src/listing/components/login/index.tsx +1 -1
- package/src/listing/components/table-head.tsx +2 -6
- package/src/listing/components/topbar/index.scss +0 -1
- package/src/listing/components/topbar/index.tsx +66 -20
- package/src/listing/libs/hooks/useEntityTableAPI.tsx +66 -4
- package/src/listing/libs/hooks/useGetNavigationLayoutAPI.tsx +12 -0
- package/src/listing/libs/services/getLayoutAPI.tsx +17 -0
- package/src/listing/libs/services/saveLayoutAPI.tsx +20 -0
- package/src/listing/libs/utils/apiColumn.ts +2 -2
- package/src/listing/libs/utils/common.ts +1 -0
- package/src/listing/types/common.ts +8 -0
- package/src/listing/types/filter.ts +13 -0
- package/src/view/FIlterWrapper.tsx +46 -0
- package/src/view/ListingView.tsx +18 -7
package/src/view/ListingView.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useDetailsQueryAPI,
|
|
7
7
|
useFetchData,
|
|
8
8
|
} from "../listing/libs/hooks/useEntityTableHooks";
|
|
9
|
-
import { ENTITY_TYPE } from "../listing/libs/utils/common";
|
|
9
|
+
import { ENTITY_TYPE, MAPPED_ENTITY_TYPE } from "../listing/libs/utils/common";
|
|
10
10
|
import {
|
|
11
11
|
useCommonDropdownAPI,
|
|
12
12
|
useDeleteFilterAPI,
|
|
@@ -22,9 +22,10 @@ import { ColumnDef } from "@tanstack/react-table";
|
|
|
22
22
|
import { FilterMasterStateProps } from "../listing/types/filter";
|
|
23
23
|
import { SettingsDataProps } from "../listing/types/filter-settings";
|
|
24
24
|
import TableWrapper from "../listing/components/index-table";
|
|
25
|
-
import { CraftTableFilter } from "..";
|
|
26
25
|
import { TableTabs } from "../listing/components/tabs";
|
|
27
26
|
import { QuickFilterSettings } from "../listing/components/table-settings";
|
|
27
|
+
import CraftTableFilterWrapper from "./FIlterWrapper";
|
|
28
|
+
import { saveLayoutAPI } from "../listing/libs/services/saveLayoutAPI";
|
|
28
29
|
|
|
29
30
|
function ListingView() {
|
|
30
31
|
// const [mockLoading, setMockLoading] = useState<boolean>(true);
|
|
@@ -54,7 +55,7 @@ function ListingView() {
|
|
|
54
55
|
);
|
|
55
56
|
|
|
56
57
|
const { savedMutation } = useSavedFilterAPI(); //API CALL FOR SAVED FILTER
|
|
57
|
-
const { deleteMutation } = useDeleteFilterAPI(); //API FOR DELETING FILTER
|
|
58
|
+
const { deleteMutation } = useDeleteFilterAPI(tableStates); //API FOR DELETING FILTER
|
|
58
59
|
const { updateMutation } = useUpdateFilterAPI(); //API FOR UPDATE FILTER
|
|
59
60
|
const { saveSettingsDataMutation } = useSaveSettingsDataAPI(ENTITY_TYPE);
|
|
60
61
|
const { dropdownData } = useCommonDropdownAPI(metaQuery.data);
|
|
@@ -288,6 +289,17 @@ function ListingView() {
|
|
|
288
289
|
);
|
|
289
290
|
};
|
|
290
291
|
|
|
292
|
+
const handleChangeFunction = async (data: any) => {
|
|
293
|
+
const payload = {
|
|
294
|
+
entity_type: MAPPED_ENTITY_TYPE,
|
|
295
|
+
mapped_entity_type: ENTITY_TYPE,
|
|
296
|
+
mapped_json: data,
|
|
297
|
+
type: "filter",
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
await saveLayoutAPI(payload);
|
|
301
|
+
};
|
|
302
|
+
|
|
291
303
|
// API to handle removing or deleting a filter
|
|
292
304
|
const handleRemoveFilter = () => {
|
|
293
305
|
const payload = {
|
|
@@ -325,7 +337,7 @@ function ListingView() {
|
|
|
325
337
|
|
|
326
338
|
const handleSaveSettingsData = (settingsData: SettingsDataProps) => {
|
|
327
339
|
const payload = {
|
|
328
|
-
entity_type:
|
|
340
|
+
entity_type: MAPPED_ENTITY_TYPE,
|
|
329
341
|
mapped_entity_type: ENTITY_TYPE,
|
|
330
342
|
layout_json: settingsData,
|
|
331
343
|
};
|
|
@@ -336,8 +348,6 @@ function ListingView() {
|
|
|
336
348
|
return (
|
|
337
349
|
<TableWrapper
|
|
338
350
|
data={filteredData}
|
|
339
|
-
// data={data}
|
|
340
|
-
// columns={defaultColumns}
|
|
341
351
|
columns={columns && columns.length > 0 ? columns : defaultColumns}
|
|
342
352
|
tableStates={tableStates}
|
|
343
353
|
featureOptions={{
|
|
@@ -367,7 +377,7 @@ function ListingView() {
|
|
|
367
377
|
filterOptions={{
|
|
368
378
|
show: tableStates?.showTableFilter,
|
|
369
379
|
component: (
|
|
370
|
-
<
|
|
380
|
+
<CraftTableFilterWrapper
|
|
371
381
|
tableStates={tableStates}
|
|
372
382
|
onClose={() => tableStates.setShowTableFilter(false)}
|
|
373
383
|
onUpdateFilter={handleUpdateFilter}
|
|
@@ -375,6 +385,7 @@ function ListingView() {
|
|
|
375
385
|
dropdownData={dropdownData || []}
|
|
376
386
|
onDeleteFilter={handleRemoveFilter}
|
|
377
387
|
onSaveFilter={handleSaveFilter}
|
|
388
|
+
onChangeFunction={handleChangeFunction}
|
|
378
389
|
/>
|
|
379
390
|
),
|
|
380
391
|
}}
|