sevago-sso-fe 1.0.36 → 1.0.37

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.
@@ -3,6 +3,7 @@ interface AppsSidebarProps {
3
3
  isOpen: boolean;
4
4
  onClose: () => void;
5
5
  position?: "left" | "right";
6
+ blacklist?: string[];
6
7
  }
7
8
  export declare const AppsSidebar: React.FC<AppsSidebarProps>;
8
9
  export {};
package/dist/index.cjs.js CHANGED
@@ -27674,7 +27674,8 @@ const TimeAgoContentComponent = ({ time: time2, content, height: height2 = HEIGH
27674
27674
  const AppsSidebar = ({
27675
27675
  isOpen,
27676
27676
  onClose,
27677
- position = "left"
27677
+ position = "left",
27678
+ blacklist
27678
27679
  }) => {
27679
27680
  const theme = useTheme();
27680
27681
  const navigate = reactRouterDom.useNavigate();
@@ -27684,6 +27685,16 @@ const AppsSidebar = ({
27684
27685
  const { setActiveExpandMenu } = useSidebar();
27685
27686
  const { palette } = useTheme();
27686
27687
  if (!isOpen) return null;
27688
+ const displayApps = React.useMemo(() => {
27689
+ if (!blacklist || blacklist.length === 0) return allApps;
27690
+ const matched = allApps.filter(
27691
+ (a) => a.path ? blacklist.includes(a.path) : false
27692
+ );
27693
+ return matched.length > 0 ? matched : allApps;
27694
+ }, [allApps, blacklist]);
27695
+ const groups = React.useMemo(() => {
27696
+ return Array.from(new Set(displayApps.map((v) => v.group)));
27697
+ }, [displayApps]);
27687
27698
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
27688
27699
  /* @__PURE__ */ jsxRuntime.jsx(
27689
27700
  material.Box,
@@ -27760,79 +27771,7 @@ const AppsSidebar = ({
27760
27771
  ]
27761
27772
  }
27762
27773
  ),
27763
- /* @__PURE__ */ jsxRuntime.jsxs(
27764
- material.Box,
27765
- {
27766
- sx: {
27767
- gap: PADDING_GAP_ITEM,
27768
- display: "flex",
27769
- flexDirection: "column"
27770
- },
27771
- children: [
27772
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "subtitle2", children: "Workflow Engine" }),
27773
- /* @__PURE__ */ jsxRuntime.jsx(
27774
- AppGrid,
27775
- {
27776
- apps: allApps.filter(
27777
- (app) => app.group === AppGroup.WORKFLOW_ENGINE
27778
- ),
27779
- columns: 4,
27780
- iconSize: 60,
27781
- iconRadius: 5.5,
27782
- gap: PADDING_GAP_ITEM,
27783
- titleVariant: "body1",
27784
- captionVariant: "caption",
27785
- titleColor: theme.palette.grey[800],
27786
- captionColor: theme.palette.grey[600],
27787
- selectedAppId: currentApp?.path,
27788
- onClickItem: async (app) => {
27789
- await dispatch(
27790
- ACTION_ACCOUNT.updateCurrentAccess(app.path)
27791
- ).unwrap();
27792
- setActiveExpandMenu(null);
27793
- onClose();
27794
- }
27795
- }
27796
- )
27797
- ]
27798
- }
27799
- ),
27800
- /* @__PURE__ */ jsxRuntime.jsxs(
27801
- material.Box,
27802
- {
27803
- sx: {
27804
- gap: PADDING_GAP_ITEM,
27805
- display: "flex",
27806
- flexDirection: "column"
27807
- },
27808
- children: [
27809
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "subtitle2", children: "HRM" }),
27810
- /* @__PURE__ */ jsxRuntime.jsx(
27811
- AppGrid,
27812
- {
27813
- apps: allApps.filter((app) => app.group === AppGroup.HRM),
27814
- columns: 4,
27815
- iconSize: 60,
27816
- iconRadius: 5.5,
27817
- gap: PADDING_GAP_ITEM,
27818
- titleVariant: "body1",
27819
- captionVariant: "caption",
27820
- titleColor: theme.palette.grey[800],
27821
- captionColor: theme.palette.grey[600],
27822
- selectedAppId: currentApp?.path,
27823
- onClickItem: async (app) => {
27824
- await dispatch(
27825
- ACTION_ACCOUNT.updateCurrentAccess(app.path)
27826
- ).unwrap();
27827
- setActiveExpandMenu(null);
27828
- onClose();
27829
- }
27830
- }
27831
- )
27832
- ]
27833
- }
27834
- ),
27835
- /* @__PURE__ */ jsxRuntime.jsxs(
27774
+ groups.map((group) => /* @__PURE__ */ jsxRuntime.jsxs(
27836
27775
  material.Box,
27837
27776
  {
27838
27777
  sx: {
@@ -27841,13 +27780,11 @@ const AppsSidebar = ({
27841
27780
  flexDirection: "column"
27842
27781
  },
27843
27782
  children: [
27844
- /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "subtitle2", children: "Platform Info" }),
27783
+ /* @__PURE__ */ jsxRuntime.jsx(material.Typography, { variant: "subtitle2", children: group === AppGroup.PLATFORM_AND_INFO ? "Platform & Info" : group }),
27845
27784
  /* @__PURE__ */ jsxRuntime.jsx(
27846
27785
  AppGrid,
27847
27786
  {
27848
- apps: allApps.filter(
27849
- (app) => app.group === AppGroup.PLATFORM_AND_INFO
27850
- ),
27787
+ apps: displayApps.filter((app) => app.group === group),
27851
27788
  columns: 4,
27852
27789
  iconSize: 60,
27853
27790
  iconRadius: 5.5,
@@ -27867,8 +27804,9 @@ const AppsSidebar = ({
27867
27804
  }
27868
27805
  )
27869
27806
  ]
27870
- }
27871
- )
27807
+ },
27808
+ group
27809
+ ))
27872
27810
  ]
27873
27811
  }
27874
27812
  )