sevago-sso-fe 1.0.54 → 1.0.55

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.cjs.js CHANGED
@@ -13758,6 +13758,12 @@ const AppGrid = ({
13758
13758
  const start = page * pageSize;
13759
13759
  const end = start + pageSize;
13760
13760
  const visibleApps = totalPages > 1 ? apps.slice(start, end) : apps;
13761
+ const getPath2 = (url) => {
13762
+ if (url.startsWith("http")) {
13763
+ return new URL(url).pathname;
13764
+ }
13765
+ return url.startsWith("/") ? url : `/${url}`;
13766
+ };
13761
13767
  return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { position: "relative" }, children: [
13762
13768
  /* @__PURE__ */ jsxRuntime.jsx(
13763
13769
  material.Box,
@@ -13768,8 +13774,16 @@ const AppGrid = ({
13768
13774
  gap: gap2
13769
13775
  },
13770
13776
  children: visibleApps.map((app, index) => {
13771
- const appUrl = app.path?.[env];
13772
- const absoluteUrl = typeof appUrl === "string" ? appUrl.startsWith("https://") ? appUrl : `${window.location.origin}${appUrl.startsWith("/") ? appUrl : `/${appUrl}`}` : "#";
13777
+ const appUrl = [
13778
+ env,
13779
+ Environment.PRODUCTION,
13780
+ Environment.STAGING,
13781
+ Environment.DEVELOP
13782
+ ].map((e) => app.path?.[e]).find((url) => url) || "";
13783
+ const isEnvValid = Object.values(Environment).includes(
13784
+ env
13785
+ );
13786
+ const absoluteUrl = appUrl && typeof appUrl === "string" ? !isEnvValid ? `${window.location.origin}${getPath2(appUrl)}` : appUrl.startsWith("http") ? appUrl : `${window.location.origin}${getPath2(appUrl)}` : "#";
13773
13787
  return /* @__PURE__ */ jsxRuntime.jsx(
13774
13788
  "a",
13775
13789
  {
@@ -13808,7 +13822,7 @@ const AppGrid = ({
13808
13822
  alignItems: "center",
13809
13823
  justifyContent: "center",
13810
13824
  background: app.color,
13811
- boxShadow: app.path[env] === window.location.origin ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
13825
+ boxShadow: appUrl === window.location.origin ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
13812
13826
  },
13813
13827
  children: typeof app.icon === "string" && app.icon && /* @__PURE__ */ jsxRuntime.jsx(
13814
13828
  ImageElement,