rez-table-listing-mui 1.3.33 → 1.3.34

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.
@@ -243,6 +243,365 @@
243
243
  // do not delete this logic rework this
244
244
  // ----------------------------------------------------------------------------------------------------------------------------
245
245
 
246
+ // import { useEffect, useState } from "react";
247
+ // import {
248
+ // FilterFormComponentProps,
249
+ // FilterMasterStateProps,
250
+ // FilterOperationListProps,
251
+ // } from "../../../types/filter";
252
+ // import {
253
+ // Accordion,
254
+ // AccordionDetails,
255
+ // AccordionSummary,
256
+ // Box,
257
+ // Divider,
258
+ // IconButton,
259
+ // List,
260
+ // ListItem,
261
+ // ListItemText,
262
+ // Typography,
263
+ // } from "@mui/material";
264
+ // import CustomSearch from "./search";
265
+ // import { DeleteIcon, EditIcon } from "../../../../assets/svg";
266
+ // import SavedFilterEditComponent from "./saved-edit-filter";
267
+ // // import { filterStyles } from "../style";
268
+ // import { CheckBox } from "../../../../assets/svg";
269
+ // import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
270
+
271
+ // const SavedFilter = ({
272
+ // columnsData,
273
+ // dropdownData,
274
+ // tableStates,
275
+ // editMode,
276
+ // setEditMode,
277
+ // setDeleteFilterModalOpen,
278
+ // onSaveFilterButtonClick,
279
+ // tabValue,
280
+ // onChangeFunction,
281
+ // filterComponentOptions,
282
+ // }: FilterFormComponentProps) => {
283
+ // const { filters, filterMaster, setFilterMaster, setFilterToDelete } =
284
+ // tableStates;
285
+
286
+ // const [searchTerm, setSearchTerm] = useState<string>("");
287
+
288
+ // const normalizeFilter = (f: any): FilterOperationListProps => {
289
+ // const prefs =
290
+ // f.sharedPreferences || f.preferences || f.meta || f.shared_meta || {};
291
+
292
+ // return {
293
+ // label: f.name || f.label || "Unnamed Filter",
294
+ // value: f.id || f.value,
295
+ // code: f.code ?? "",
296
+ // is_shared: f.is_shared ?? prefs.is_shared ?? false,
297
+ // created_by: f.created_by || "shared_filter",
298
+ // description: f.description || "",
299
+ // is_owner: f.is_owner === true || prefs.is_owner === "true",
300
+
301
+ // is_editable:
302
+ // f.is_editable === true ||
303
+ // f.is_editable === "true" ||
304
+ // prefs.is_editable === true ||
305
+ // prefs.is_editable === "true",
306
+ // };
307
+ // };
308
+
309
+ // const mappedSavedFilter: FilterOperationListProps[] =
310
+ // columnsData?.saved_filter?.map(normalizeFilter) ?? [];
311
+ // // console.log("mappedSavedFilter", mappedSavedFilter);
312
+
313
+ // const mappedSharedFilter: FilterOperationListProps[] =
314
+ // columnsData?.shared_filter?.map(normalizeFilter) ?? [];
315
+ // // console.log("mappedSharedFilter", mappedSharedFilter);
316
+
317
+ // // Reset on unmount
318
+ // useEffect(() => {
319
+ // return () => {
320
+ // const editModeFromTab =
321
+ // filterComponentOptions?.tabOptions?.savedFilter?.editMode;
322
+
323
+ // if (!editModeFromTab) {
324
+ // setEditMode && setEditMode(false);
325
+ // setFilterMaster(
326
+ // (prev) =>
327
+ // ({
328
+ // ...prev,
329
+ // saved_filters: {
330
+ // ...(prev?.saved_filters ?? {}),
331
+ // selectedId: "",
332
+ // selectedName: "",
333
+ // description: "",
334
+ // selectedCode: "",
335
+ // shareWithTeam: undefined,
336
+ // allowTeamEdit: undefined,
337
+ // },
338
+ // } as FilterMasterStateProps)
339
+ // );
340
+ // }
341
+ // };
342
+ // }, []);
343
+
344
+ // const applyFilterStates = (filter: FilterOperationListProps) => {
345
+ // const newFilterMaster = {
346
+ // ...filterMaster,
347
+ // saved_filters: {
348
+ // ...(filterMaster?.saved_filters ?? {}),
349
+ // selectedId: filter.value,
350
+ // selectedName: filter.label,
351
+ // description: filter.description,
352
+ // selectedCode: filter.code,
353
+ // shareWithTeam: filter.is_shared,
354
+ // allowTeamEdit: filter.is_editable,
355
+ // },
356
+ // attributes: {
357
+ // ...filterMaster?.attributes,
358
+ // radio: [],
359
+ // },
360
+ // activeFilterTabIndex: tabValue,
361
+ // } as FilterMasterStateProps;
362
+
363
+ // setFilterMaster(newFilterMaster);
364
+
365
+ // onChangeFunction &&
366
+ // onChangeFunction({
367
+ // filterMaster: newFilterMaster,
368
+ // filters,
369
+ // });
370
+ // };
371
+
372
+ // const handleListItemClick = (filter: FilterOperationListProps) => {
373
+ // applyFilterStates(filter);
374
+ // setEditMode && setEditMode(true);
375
+ // setFilterToDelete(filter);
376
+ // };
377
+
378
+ // const handleApplyFilter = (filter: FilterOperationListProps) => {
379
+ // applyFilterStates(filter);
380
+ // };
381
+ // const [openAccordion, setOpenAccordion] = useState<"my" | "shared">("my");
382
+
383
+ // /**
384
+ // * renderList
385
+ // * @param source - list to render
386
+ // * @param isSharedList - true when rendering Shared Filters (default false)
387
+ // *
388
+ // * Behavior:
389
+ // * - If isSharedList === true -> show Edit icon ONLY when filter.is_editable === true
390
+ // * - If isSharedList === false -> show Edit icon always (or as per filter.is_editable if you prefer)
391
+ // */
392
+ // const renderList = (
393
+ // source: FilterOperationListProps[],
394
+ // isSharedList: boolean = false,
395
+ // { emptyMessage = "No filters yet." } = {}
396
+ // ) =>
397
+ // source.length === 0 ? (
398
+ // <Typography>{emptyMessage}</Typography>
399
+ // ) : (
400
+ // <List
401
+ // sx={{
402
+ // display: "flex",
403
+ // flexDirection: "column",
404
+ // gap: 1,
405
+ // }}
406
+ // >
407
+ // {source
408
+ // .filter((f) =>
409
+ // f.label?.toLowerCase().includes(searchTerm.toLowerCase())
410
+ // )
411
+ // .map((filter) => (
412
+ // <ListItem
413
+ // key={filter.value}
414
+ // sx={{
415
+ // cursor: "pointer",
416
+ // // border:
417
+ // // filter.value ===
418
+ // // tableStates?.filterMaster?.saved_filters?.selectedId
419
+ // // ? `3px solid #7a5af8`
420
+ // // : "1px solid #C5C5C5",
421
+ // borderRadius: "8px",
422
+ // bgcolor: "#f2f6f8ff",
423
+ // display: "flex",
424
+ // justifyContent: "space-between",
425
+ // gap: 1,
426
+ // alignItems: "center",
427
+ // "&:hover .action-icons": {
428
+ // opacity: 1,
429
+ // visibility: "visible",
430
+ // },
431
+ // }}
432
+ // onClick={() => handleApplyFilter(filter)}
433
+ // >
434
+ // {filter.value ===
435
+ // tableStates?.filterMaster?.saved_filters?.selectedId && (
436
+ // <Box sx={{ display: "flex", alignItems: "center" }}>
437
+ // <CheckBox />
438
+ // </Box>
439
+ // )}
440
+
441
+ // <ListItemText primary={filter.label} />
442
+
443
+ // <Box
444
+ // onClick={(e) => e.stopPropagation()}
445
+ // className="action-icons"
446
+ // sx={{
447
+ // display: "flex",
448
+ // gap: 1,
449
+ // opacity: 0,
450
+ // visibility: "hidden",
451
+ // transition: "opacity 0.2s ease, visibility 0.2s ease",
452
+ // }}
453
+ // >
454
+ // {((!isSharedList && filter.is_editable === true) ||
455
+ // filter.is_owner === true) && (
456
+ // // ||
457
+ // // String(filter.created_by) !== String(filter.user_id))
458
+ // <IconButton
459
+ // size="large"
460
+ // onClick={() => handleListItemClick(filter)}
461
+ // >
462
+ // <EditIcon />
463
+ // </IconButton>
464
+ // )}
465
+ // {filter?.is_owner === true && (
466
+ // <IconButton
467
+ // size="small"
468
+ // onClick={() => {
469
+ // setFilterToDelete(filter);
470
+ // setDeleteFilterModalOpen?.(true);
471
+ // }}
472
+ // >
473
+ // <DeleteIcon />
474
+ // </IconButton>
475
+ // )}
476
+ // </Box>
477
+ // </ListItem>
478
+ // ))}
479
+ // </List>
480
+ // );
481
+
482
+ // return (
483
+ // <Box
484
+ // // sx={{
485
+ // // ...filterStyles.filterMainComponentWrapper,
486
+ // // ...filterStyles.scrollbarCustom,
487
+ // // }}
488
+ // className="saved-filter-component-wrapper"
489
+ // >
490
+ // {!editMode && (
491
+ // <>
492
+ // {/* Search Box */}
493
+ // <Box sx={{ mb: 2 }}>
494
+ // <CustomSearch
495
+ // value={searchTerm}
496
+ // onChange={setSearchTerm}
497
+ // className="search-input"
498
+ // />
499
+ // </Box>
500
+
501
+ // {/* ---- My Filters Section ---- */}
502
+ // <Box
503
+ // sx={{
504
+ // background: "#fff",
505
+ // borderRadius: "12px",
506
+ // border: "1px solid #eee",
507
+ // mb: 2,
508
+ // overflow: "hidden",
509
+ // }}
510
+ // >
511
+ // <Accordion
512
+ // // defaultExpanded
513
+ // disableGutters
514
+ // elevation={0}
515
+ // expanded={openAccordion === "my"}
516
+ // onChange={() =>
517
+ // setOpenAccordion(openAccordion === "my" ? "shared" : "my")
518
+ // }
519
+ // >
520
+ // <AccordionSummary
521
+ // expandIcon={<ExpandMoreIcon fontSize="small" />}
522
+ // >
523
+ // <Typography fontWeight={600}>My Filters</Typography>
524
+ // </AccordionSummary>
525
+ // <Divider sx={{ width: "100%" }} />
526
+ // <AccordionDetails
527
+ // sx={{
528
+ // p: "9px",
529
+ // maxHeight: "320px",
530
+ // overflowY: "auto",
531
+ // scrollbarWidth: "thin",
532
+ // }}
533
+ // >
534
+ // {renderList(mappedSavedFilter) || (
535
+ // <Typography>No My Filters</Typography>
536
+ // )}
537
+ // </AccordionDetails>
538
+ // </Accordion>
539
+ // </Box>
540
+
541
+ // {/* ---- Shared Filters Section ---- */}
542
+ // <Box
543
+ // sx={{
544
+ // background: "#fff",
545
+ // borderRadius: "12px",
546
+ // border: "1px solid #eee",
547
+ // mb: 2,
548
+ // overflow: "hidden",
549
+ // }}
550
+ // >
551
+ // <Accordion
552
+ // disableGutters
553
+ // elevation={0}
554
+ // expanded={openAccordion === "shared"}
555
+ // onChange={() =>
556
+ // setOpenAccordion(openAccordion === "shared" ? "my" : "shared")
557
+ // }
558
+ // >
559
+ // <AccordionSummary
560
+ // expandIcon={<ExpandMoreIcon fontSize="small" />}
561
+ // >
562
+ // <Typography fontWeight={600}>Shared Filters</Typography>
563
+ // </AccordionSummary>
564
+ // <Divider sx={{ width: "100%" }} />
565
+
566
+ // <AccordionDetails
567
+ // sx={{
568
+ // p: "9px",
569
+ // maxHeight: "320px",
570
+ // overflowY: "auto",
571
+ // scrollbarWidth: "thin",
572
+ // }}
573
+ // >
574
+ // {renderList(mappedSharedFilter) || (
575
+ // <Typography>No Shared Filters</Typography>
576
+ // )}
577
+ // </AccordionDetails>
578
+ // </Accordion>
579
+ // </Box>
580
+ // </>
581
+ // )}
582
+
583
+ // {/* Edit Component */}
584
+ // {editMode && (
585
+ // <SavedFilterEditComponent
586
+ // columnsData={columnsData}
587
+ // dropdownData={dropdownData}
588
+ // tableStates={tableStates}
589
+ // editMode={editMode}
590
+ // setEditMode={setEditMode}
591
+ // searchTerm={searchTerm}
592
+ // setSearchTerm={setSearchTerm}
593
+ // onSaveFilterButtonClick={onSaveFilterButtonClick}
594
+ // setDeleteFilterModalOpen={setDeleteFilterModalOpen}
595
+ // onChangeFunction={onChangeFunction}
596
+ // filterComponentOptions={filterComponentOptions}
597
+ // />
598
+ // )}
599
+ // </Box>
600
+ // );
601
+ // };
602
+
603
+ // export default SavedFilter;
604
+
246
605
  import { useEffect, useState } from "react";
247
606
  import {
248
607
  FilterFormComponentProps,
@@ -264,7 +623,6 @@ import {
264
623
  import CustomSearch from "./search";
265
624
  import { DeleteIcon, EditIcon } from "../../../../assets/svg";
266
625
  import SavedFilterEditComponent from "./saved-edit-filter";
267
- // import { filterStyles } from "../style";
268
626
  import { CheckBox } from "../../../../assets/svg";
269
627
  import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
270
628
 
@@ -285,7 +643,20 @@ const SavedFilter = ({
285
643
 
286
644
  const [searchTerm, setSearchTerm] = useState<string>("");
287
645
 
288
- const normalizeFilter = (f: any): FilterOperationListProps => {
646
+ const MyFilter = (f: any): FilterOperationListProps => {
647
+ return {
648
+ label: f.name || f.label || "Unnamed Filter",
649
+ value: f.id || f.value,
650
+ code: f.code ?? "",
651
+ is_shared: false,
652
+ created_by: f.created_by || "",
653
+ description: f.description || "",
654
+ is_owner: true, // My filter = always owner
655
+ is_editable: f.is_editable === true || f.is_editable === "true",
656
+ };
657
+ };
658
+
659
+ const SharedFilter = (f: any): FilterOperationListProps => {
289
660
  const prefs =
290
661
  f.sharedPreferences || f.preferences || f.meta || f.shared_meta || {};
291
662
 
@@ -293,11 +664,10 @@ const SavedFilter = ({
293
664
  label: f.name || f.label || "Unnamed Filter",
294
665
  value: f.id || f.value,
295
666
  code: f.code ?? "",
296
- is_shared: f.is_shared ?? prefs.is_shared ?? false,
667
+ is_shared: f.is_shared ?? prefs.is_shared ?? true,
297
668
  created_by: f.created_by || "shared_filter",
298
669
  description: f.description || "",
299
670
  is_owner: f.is_owner === true || prefs.is_owner === "true",
300
-
301
671
  is_editable:
302
672
  f.is_editable === true ||
303
673
  f.is_editable === "true" ||
@@ -306,13 +676,13 @@ const SavedFilter = ({
306
676
  };
307
677
  };
308
678
 
309
- const mappedSavedFilter: FilterOperationListProps[] =
310
- columnsData?.saved_filter?.map(normalizeFilter) ?? [];
311
- console.log("mappedSavedFilter", mappedSavedFilter);
679
+ // SEPARATE DATA MAPPINGS
680
+
681
+ const myFilters: FilterOperationListProps[] =
682
+ columnsData?.saved_filter?.map(MyFilter) ?? [];
312
683
 
313
- const mappedSharedFilter: FilterOperationListProps[] =
314
- columnsData?.shared_filter?.map(normalizeFilter) ?? [];
315
- console.log("mappedSharedFilter", mappedSharedFilter);
684
+ const sharedFilters: FilterOperationListProps[] =
685
+ columnsData?.shared_filter?.map(SharedFilter) ?? [];
316
686
 
317
687
  // Reset on unmount
318
688
  useEffect(() => {
@@ -341,6 +711,8 @@ const SavedFilter = ({
341
711
  };
342
712
  }, []);
343
713
 
714
+ // APPLY FILTER
715
+
344
716
  const applyFilterStates = (filter: FilterOperationListProps) => {
345
717
  const newFilterMaster = {
346
718
  ...filterMaster,
@@ -378,32 +750,87 @@ const SavedFilter = ({
378
750
  const handleApplyFilter = (filter: FilterOperationListProps) => {
379
751
  applyFilterStates(filter);
380
752
  };
753
+
381
754
  const [openAccordion, setOpenAccordion] = useState<"my" | "shared">("my");
382
755
 
383
- /**
384
- * renderList
385
- * @param source - list to render
386
- * @param isSharedList - true when rendering Shared Filters (default false)
387
- *
388
- * Behavior:
389
- * - If isSharedList === true -> show Edit icon ONLY when filter.is_editable === true
390
- * - If isSharedList === false -> show Edit icon always (or as per filter.is_editable if you prefer)
391
- */
392
- const renderList = (
393
- source: FilterOperationListProps[],
394
- isSharedList: boolean = false,
395
- { emptyMessage = "No saved filters yet." } = {}
396
- ) =>
756
+ // RENDER: MY FILTERS
757
+
758
+ const renderMyFilters = (source: FilterOperationListProps[]) =>
759
+ source.length === 0 ? (
760
+ <Typography>No My Filters</Typography>
761
+ ) : (
762
+ <List sx={{ display: "flex", flexDirection: "column", gap: 1 }}>
763
+ {source
764
+ .filter((f) =>
765
+ f.label?.toLowerCase().includes(searchTerm.toLowerCase())
766
+ )
767
+ .map((filter) => (
768
+ <ListItem
769
+ key={filter.value}
770
+ sx={{
771
+ cursor: "pointer",
772
+ borderRadius: "8px",
773
+ bgcolor: "#f2f6f8ff",
774
+ display: "flex",
775
+ justifyContent: "space-between",
776
+ gap: 1,
777
+ alignItems: "center",
778
+ "&:hover .action-icons": {
779
+ opacity: 1,
780
+ visibility: "visible",
781
+ },
782
+ }}
783
+ onClick={() => handleApplyFilter(filter)}
784
+ >
785
+ {filter.value === filterMaster?.saved_filters?.selectedId && (
786
+ <Box sx={{ display: "flex", alignItems: "center" }}>
787
+ <CheckBox />
788
+ </Box>
789
+ )}
790
+
791
+ <ListItemText primary={filter.label} />
792
+
793
+ <Box
794
+ onClick={(e) => e.stopPropagation()}
795
+ className="action-icons"
796
+ sx={{
797
+ display: "flex",
798
+ gap: 1,
799
+ opacity: 0,
800
+ visibility: "hidden",
801
+ transition: "opacity 0.2s ease, visibility 0.2s ease",
802
+ }}
803
+ >
804
+ <IconButton
805
+ size="large"
806
+ onClick={() => handleListItemClick(filter)}
807
+ >
808
+ <EditIcon />
809
+ </IconButton>
810
+
811
+ <IconButton
812
+ size="small"
813
+ onClick={() => {
814
+ setFilterToDelete(filter);
815
+ setDeleteFilterModalOpen?.(true);
816
+ }}
817
+ >
818
+ <DeleteIcon />
819
+ </IconButton>
820
+ </Box>
821
+ </ListItem>
822
+ ))}
823
+ </List>
824
+ );
825
+
826
+ // ----------------------------------------
827
+ // RENDER: SHARED FILTERS
828
+ // ----------------------------------------
829
+ const renderSharedFilters = (source: FilterOperationListProps[]) =>
397
830
  source.length === 0 ? (
398
- <Typography>{emptyMessage}</Typography>
831
+ <Typography>No Shared Filters</Typography>
399
832
  ) : (
400
- <List
401
- sx={{
402
- display: "flex",
403
- flexDirection: "column",
404
- gap: 1,
405
- }}
406
- >
833
+ <List sx={{ display: "flex", flexDirection: "column", gap: 1 }}>
407
834
  {source
408
835
  .filter((f) =>
409
836
  f.label?.toLowerCase().includes(searchTerm.toLowerCase())
@@ -413,11 +840,6 @@ const SavedFilter = ({
413
840
  key={filter.value}
414
841
  sx={{
415
842
  cursor: "pointer",
416
- // border:
417
- // filter.value ===
418
- // tableStates?.filterMaster?.saved_filters?.selectedId
419
- // ? `3px solid #7a5af8`
420
- // : "1px solid #C5C5C5",
421
843
  borderRadius: "8px",
422
844
  bgcolor: "#f2f6f8ff",
423
845
  display: "flex",
@@ -431,8 +853,7 @@ const SavedFilter = ({
431
853
  }}
432
854
  onClick={() => handleApplyFilter(filter)}
433
855
  >
434
- {filter.value ===
435
- tableStates?.filterMaster?.saved_filters?.selectedId && (
856
+ {filter.value === filterMaster?.saved_filters?.selectedId && (
436
857
  <Box sx={{ display: "flex", alignItems: "center" }}>
437
858
  <CheckBox />
438
859
  </Box>
@@ -451,11 +872,7 @@ const SavedFilter = ({
451
872
  transition: "opacity 0.2s ease, visibility 0.2s ease",
452
873
  }}
453
874
  >
454
- {(!isSharedList ||
455
- filter.is_editable === true ||
456
- filter.is_owner === true) && (
457
- // ||
458
- // String(filter.created_by) !== String(filter.user_id))
875
+ {(filter.is_editable || filter.is_owner) && (
459
876
  <IconButton
460
877
  size="large"
461
878
  onClick={() => handleListItemClick(filter)}
@@ -463,7 +880,7 @@ const SavedFilter = ({
463
880
  <EditIcon />
464
881
  </IconButton>
465
882
  )}
466
- {filter?.is_owner === true && (
883
+ {filter.is_owner && (
467
884
  <IconButton
468
885
  size="small"
469
886
  onClick={() => {
@@ -480,17 +897,14 @@ const SavedFilter = ({
480
897
  </List>
481
898
  );
482
899
 
900
+ // ----------------------------------------
901
+ // RENDER MAIN COMPONENT
902
+ // ----------------------------------------
483
903
  return (
484
- <Box
485
- // sx={{
486
- // ...filterStyles.filterMainComponentWrapper,
487
- // ...filterStyles.scrollbarCustom,
488
- // }}
489
- className="saved-filter-component-wrapper"
490
- >
904
+ <Box className="saved-filter-component-wrapper">
491
905
  {!editMode && (
492
906
  <>
493
- {/* Search Box */}
907
+ {/* Search */}
494
908
  <Box sx={{ mb: 2 }}>
495
909
  <CustomSearch
496
910
  value={searchTerm}
@@ -499,7 +913,7 @@ const SavedFilter = ({
499
913
  />
500
914
  </Box>
501
915
 
502
- {/* ---- My Filters Section ---- */}
916
+ {/* ---- My Filters ---- */}
503
917
  <Box
504
918
  sx={{
505
919
  background: "#fff",
@@ -510,7 +924,6 @@ const SavedFilter = ({
510
924
  }}
511
925
  >
512
926
  <Accordion
513
- // defaultExpanded
514
927
  disableGutters
515
928
  elevation={0}
516
929
  expanded={openAccordion === "my"}
@@ -532,19 +945,19 @@ const SavedFilter = ({
532
945
  scrollbarWidth: "thin",
533
946
  }}
534
947
  >
535
- {renderList(mappedSavedFilter, false)}
948
+ {renderMyFilters(myFilters)}
536
949
  </AccordionDetails>
537
950
  </Accordion>
538
951
  </Box>
539
952
 
540
- {/* ---- Shared Filters Section ---- */}
953
+ {/* ---- Shared Filters ---- */}
541
954
  <Box
542
955
  sx={{
543
956
  background: "#fff",
544
957
  borderRadius: "12px",
545
- border: "1px solid #eee",
546
- mb: 2,
547
- overflow: "hidden",
958
+ // border: "1px solid "#eee",
959
+ // mb: 2,
960
+ // overflow: "hidden",
548
961
  }}
549
962
  >
550
963
  <Accordion
@@ -561,7 +974,6 @@ const SavedFilter = ({
561
974
  <Typography fontWeight={600}>Shared Filters</Typography>
562
975
  </AccordionSummary>
563
976
  <Divider sx={{ width: "100%" }} />
564
-
565
977
  <AccordionDetails
566
978
  sx={{
567
979
  p: "9px",
@@ -570,7 +982,7 @@ const SavedFilter = ({
570
982
  scrollbarWidth: "thin",
571
983
  }}
572
984
  >
573
- {renderList(mappedSharedFilter, true)}
985
+ {renderSharedFilters(sharedFilters)}
574
986
  </AccordionDetails>
575
987
  </Accordion>
576
988
  </Box>
@@ -202,6 +202,7 @@ export function TableFilter({
202
202
  }
203
203
  } else {
204
204
  onSaveFilter && onSaveFilter(selectedName);
205
+ setTabValue(1);
205
206
  }
206
207
 
207
208
  setSavedFilterModalOpen(false);