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.esm.js CHANGED
@@ -13740,6 +13740,12 @@ const AppGrid = ({
13740
13740
  const start = page * pageSize;
13741
13741
  const end = start + pageSize;
13742
13742
  const visibleApps = totalPages > 1 ? apps.slice(start, end) : apps;
13743
+ const getPath2 = (url) => {
13744
+ if (url.startsWith("http")) {
13745
+ return new URL(url).pathname;
13746
+ }
13747
+ return url.startsWith("/") ? url : `/${url}`;
13748
+ };
13743
13749
  return /* @__PURE__ */ jsxs(Box, { sx: { position: "relative" }, children: [
13744
13750
  /* @__PURE__ */ jsx(
13745
13751
  Box,
@@ -13750,8 +13756,16 @@ const AppGrid = ({
13750
13756
  gap: gap2
13751
13757
  },
13752
13758
  children: visibleApps.map((app, index) => {
13753
- const appUrl = app.path?.[env];
13754
- const absoluteUrl = typeof appUrl === "string" ? appUrl.startsWith("https://") ? appUrl : `${window.location.origin}${appUrl.startsWith("/") ? appUrl : `/${appUrl}`}` : "#";
13759
+ const appUrl = [
13760
+ env,
13761
+ Environment.PRODUCTION,
13762
+ Environment.STAGING,
13763
+ Environment.DEVELOP
13764
+ ].map((e) => app.path?.[e]).find((url) => url) || "";
13765
+ const isEnvValid = Object.values(Environment).includes(
13766
+ env
13767
+ );
13768
+ const absoluteUrl = appUrl && typeof appUrl === "string" ? !isEnvValid ? `${window.location.origin}${getPath2(appUrl)}` : appUrl.startsWith("http") ? appUrl : `${window.location.origin}${getPath2(appUrl)}` : "#";
13755
13769
  return /* @__PURE__ */ jsx(
13756
13770
  "a",
13757
13771
  {
@@ -13790,7 +13804,7 @@ const AppGrid = ({
13790
13804
  alignItems: "center",
13791
13805
  justifyContent: "center",
13792
13806
  background: app.color,
13793
- boxShadow: app.path[env] === window.location.origin ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
13807
+ boxShadow: appUrl === window.location.origin ? `0 0 0 1px ${theme.palette.primary.main}, ${iconShadow}` : iconShadow
13794
13808
  },
13795
13809
  children: typeof app.icon === "string" && app.icon && /* @__PURE__ */ jsx(
13796
13810
  ImageElement,