rez-table-listing-mui 1.3.30 → 1.3.31

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.
@@ -15,6 +15,34 @@ export interface FilterOperationListProps {
15
15
  code: string;
16
16
  label: string;
17
17
  value: string;
18
+ is_shared: boolean;
19
+ is_editable: boolean;
20
+ }
21
+
22
+ export interface FilterSharedListProps {
23
+ created_date: string; // ISO date string
24
+ entity_type: string;
25
+ id: string;
26
+ name: string;
27
+ status: string;
28
+ parent_type: string | null;
29
+ parent_id: string | number | null;
30
+ code: string;
31
+ created_by: string;
32
+ modified_by: string | null;
33
+ modified_date: string | null;
34
+ enterprise_id: number;
35
+ organization_id: number;
36
+ appcode: string | null;
37
+ level_id: string;
38
+ level_type: string;
39
+ mapped_entity_type: string;
40
+ user_id: number;
41
+ is_default: boolean;
42
+ filter_scope: string;
43
+ is_shared: boolean;
44
+ is_editable: boolean | string; // API gives "true" (string) so support both
45
+ description: string | null;
18
46
  }
19
47
 
20
48
  export type FilterInputDataTypes =
@@ -58,6 +86,7 @@ export interface FilterColumnsDataProps {
58
86
  column_list: FilterColumnsListProps[];
59
87
  operation_list: OperationMapProps;
60
88
  saved_filter: FilterOperationListProps[];
89
+ shared_filter: FilterOperationListProps[];
61
90
  }
62
91
 
63
92
  export interface FilterDropdownDataProps {
@@ -242,12 +271,14 @@ export interface updateSavedFilterPayload {
242
271
 
243
272
  export interface FilterFormComponentProps {
244
273
  columnsData: FilterColumnsDataProps;
274
+ saved_filter?: any;
275
+ shared_filter?: any;
245
276
  dropdownData: FilterDropdownDataProps;
246
277
  tableStates: CraftTableOptionsProps;
247
278
  editMode?: boolean;
248
279
  setEditMode?: React.Dispatch<React.SetStateAction<boolean>>;
249
280
  setDeleteFilterModalOpen?: React.Dispatch<React.SetStateAction<boolean>>;
250
- setSavedFilterModalOpen?: React.Dispatch<React.SetStateAction<boolean>>;
281
+ onSaveFilterButtonClick?: () => void;
251
282
  tabValue?: number;
252
283
  onChangeFunction: ({
253
284
  updatedFilters,
@@ -256,6 +287,11 @@ export interface FilterFormComponentProps {
256
287
  filterComponentOptions?: FilterComponentOptions;
257
288
  }
258
289
 
290
+ export interface SavedFilterSharingPreference {
291
+ shareWithTeam?: boolean;
292
+ allowTeamEdit?: boolean;
293
+ }
294
+
259
295
  export interface FilterMasterStateProps {
260
296
  attributes: {
261
297
  selected: string;
@@ -265,8 +301,11 @@ export interface FilterMasterStateProps {
265
301
  selectedId: string;
266
302
  selectedName: string;
267
303
  selectedCode?: string;
304
+ is_shared?: boolean;
305
+ is_editable?: boolean;
268
306
  };
269
307
  activeFilterTabIndex: number;
308
+ shared_filters_meta?: Record<string, SavedFilterSharingPreference>;
270
309
  }
271
310
 
272
311
  export interface AttributesFilterProps {
@@ -87,6 +87,8 @@ const CraftTableFilterWrapper = ({
87
87
  // API to handle saving a filter
88
88
  const handleSaveFilter = (name: string) => {
89
89
  const quickFilter = filters.map((f: any) => ({ ...f }));
90
+ const shareWithTeam = filterMaster?.saved_filters?.is_shared ?? false;
91
+ const allowTeamEdit = filterMaster?.saved_filters?.is_editable ?? false;
90
92
 
91
93
  const payload = {
92
94
  name,
@@ -95,6 +97,8 @@ const CraftTableFilterWrapper = ({
95
97
  status: "ACTIVE",
96
98
  entity_type: "SFM", // FIXED entity type
97
99
  filterDetails: quickFilter,
100
+ is_shared: shareWithTeam,
101
+ is_editable: allowTeamEdit,
98
102
  };
99
103
  const entity_type = "SFM";
100
104
  savedMutation.mutate(
@@ -111,6 +115,8 @@ const CraftTableFilterWrapper = ({
111
115
  ...prev?.saved_filters,
112
116
  selectedId: newFilterId.toString(),
113
117
  selectedName: name,
118
+ is_shared: shareWithTeam,
119
+ is_editable: allowTeamEdit,
114
120
  },
115
121
  activeFilterTabIndex: 1,
116
122
  } as FilterMasterStateProps)
@@ -127,6 +133,8 @@ const CraftTableFilterWrapper = ({
127
133
  filter_operator: f.filter_operator,
128
134
  filter_value: f.filter_value,
129
135
  }));
136
+ const shareWithTeam = filterMaster?.saved_filters?.is_shared ?? false;
137
+ const allowTeamEdit = filterMaster?.saved_filters?.is_editable ?? false;
130
138
 
131
139
  const payload = {
132
140
  name: filterMaster?.saved_filters?.selectedName, // Name of the filter
@@ -136,6 +144,8 @@ const CraftTableFilterWrapper = ({
136
144
  status: "ACTIVE",
137
145
  entity_type: "SFM",
138
146
  filterDetails: quickFilter,
147
+ is_shared: shareWithTeam, // Now true/false from state
148
+ is_editable: allowTeamEdit,
139
149
  };
140
150
  const entity_type = "SFM";
141
151
  updateMutation.mutate({ entity_type, payload });