@optifye/dashboard-core 6.12.35 → 6.12.36

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.js CHANGED
@@ -59619,6 +59619,11 @@ var isLeaderboardRoute = (asPath) => {
59619
59619
  if (path !== "/kpis") return false;
59620
59620
  return new URLSearchParams(queryString2).get("tab") === "leaderboard";
59621
59621
  };
59622
+ var isAuthRoute = (asPath) => {
59623
+ const { path } = getRoutePathAndQuery(asPath);
59624
+ return path === "/login" || path === "/debug-auth" || path === "/accept-invite" || path === "/auth/callback";
59625
+ };
59626
+ var isSuppressedRoute = (asPath) => isLeaderboardRoute(asPath) || isAuthRoute(asPath);
59622
59627
  var getLocalQaSimulationMode = (asPath) => {
59623
59628
  if (typeof window === "undefined") return null;
59624
59629
  if (process.env.NODE_ENV === "production") return null;
@@ -59873,7 +59878,7 @@ var LineOvertakeNotificationManager = ({
59873
59878
  const [visibleLines, setVisibleLines] = React146.useState([]);
59874
59879
  const [linesLoaded, setLinesLoaded] = React146.useState(false);
59875
59880
  const [notificationEvents, setNotificationEvents] = React146.useState([]);
59876
- const isOnLeaderboardRoute = isLeaderboardRoute(router$1.asPath);
59881
+ const isOnSuppressedRoute = isSuppressedRoute(router$1.asPath);
59877
59882
  const qaSimulationMode = getLocalQaSimulationMode(router$1.asPath);
59878
59883
  const qaSimulationEnabled = Boolean(qaSimulationMode);
59879
59884
  const realRoleMode = resolveRoleMode(user?.role_level || user?.role);
@@ -59950,17 +59955,17 @@ var LineOvertakeNotificationManager = ({
59950
59955
  scopeKeyRef.current = scopeKey;
59951
59956
  }, [scopeKey]);
59952
59957
  React146.useEffect(() => {
59953
- if (!isOnLeaderboardRoute) return;
59958
+ if (!isOnSuppressedRoute) return;
59954
59959
  previousSnapshotRef.current = null;
59955
59960
  notificationEventsRef.current = [];
59956
59961
  setNotificationEvents([]);
59957
59962
  setVisibleLines([]);
59958
59963
  setLinesLoaded(false);
59959
- }, [isOnLeaderboardRoute]);
59964
+ }, [isOnSuppressedRoute]);
59960
59965
  React146.useEffect(() => {
59961
59966
  let cancelled = false;
59962
59967
  const loadLines = async () => {
59963
- if (isOnLeaderboardRoute) {
59968
+ if (isOnSuppressedRoute) {
59964
59969
  setVisibleLines([]);
59965
59970
  setLinesLoaded(false);
59966
59971
  return;
@@ -59999,7 +60004,7 @@ var LineOvertakeNotificationManager = ({
59999
60004
  return () => {
60000
60005
  cancelled = true;
60001
60006
  };
60002
- }, [companyId, isOnLeaderboardRoute, qaSimulationEnabled, roleMode, supabase]);
60007
+ }, [companyId, isOnSuppressedRoute, qaSimulationEnabled, roleMode, supabase]);
60003
60008
  const openLeaderboard = React146.useCallback(() => {
60004
60009
  notificationEventsRef.current = [];
60005
60010
  setNotificationEvents([]);
@@ -60045,7 +60050,7 @@ var LineOvertakeNotificationManager = ({
60045
60050
  });
60046
60051
  }, [dedupeScopeKey]);
60047
60052
  const pollLeaderboard = React146.useCallback(async () => {
60048
- if (isOnLeaderboardRoute) return;
60053
+ if (isOnSuppressedRoute) return;
60049
60054
  if (qaSimulationEnabled) {
60050
60055
  if (pollInFlightRef.current) return;
60051
60056
  pollInFlightRef.current = true;
@@ -60104,7 +60109,7 @@ var LineOvertakeNotificationManager = ({
60104
60109
  companyId,
60105
60110
  currentShift.date,
60106
60111
  currentShift.shiftId,
60107
- isOnLeaderboardRoute,
60112
+ isOnSuppressedRoute,
60108
60113
  linesLoaded,
60109
60114
  qaSimulationEnabled,
60110
60115
  qaSimulationMode,
@@ -60126,7 +60131,7 @@ var LineOvertakeNotificationManager = ({
60126
60131
  window.clearInterval(intervalId);
60127
60132
  };
60128
60133
  }, [pollIntervalMs, pollLeaderboard]);
60129
- if (isOnLeaderboardRoute) return null;
60134
+ if (isOnSuppressedRoute) return null;
60130
60135
  return /* @__PURE__ */ jsxRuntime.jsx(
60131
60136
  LineOvertakeNotificationPopup,
60132
60137
  {
package/dist/index.mjs CHANGED
@@ -59590,6 +59590,11 @@ var isLeaderboardRoute = (asPath) => {
59590
59590
  if (path !== "/kpis") return false;
59591
59591
  return new URLSearchParams(queryString2).get("tab") === "leaderboard";
59592
59592
  };
59593
+ var isAuthRoute = (asPath) => {
59594
+ const { path } = getRoutePathAndQuery(asPath);
59595
+ return path === "/login" || path === "/debug-auth" || path === "/accept-invite" || path === "/auth/callback";
59596
+ };
59597
+ var isSuppressedRoute = (asPath) => isLeaderboardRoute(asPath) || isAuthRoute(asPath);
59593
59598
  var getLocalQaSimulationMode = (asPath) => {
59594
59599
  if (typeof window === "undefined") return null;
59595
59600
  if (process.env.NODE_ENV === "production") return null;
@@ -59844,7 +59849,7 @@ var LineOvertakeNotificationManager = ({
59844
59849
  const [visibleLines, setVisibleLines] = useState([]);
59845
59850
  const [linesLoaded, setLinesLoaded] = useState(false);
59846
59851
  const [notificationEvents, setNotificationEvents] = useState([]);
59847
- const isOnLeaderboardRoute = isLeaderboardRoute(router.asPath);
59852
+ const isOnSuppressedRoute = isSuppressedRoute(router.asPath);
59848
59853
  const qaSimulationMode = getLocalQaSimulationMode(router.asPath);
59849
59854
  const qaSimulationEnabled = Boolean(qaSimulationMode);
59850
59855
  const realRoleMode = resolveRoleMode(user?.role_level || user?.role);
@@ -59921,17 +59926,17 @@ var LineOvertakeNotificationManager = ({
59921
59926
  scopeKeyRef.current = scopeKey;
59922
59927
  }, [scopeKey]);
59923
59928
  useEffect(() => {
59924
- if (!isOnLeaderboardRoute) return;
59929
+ if (!isOnSuppressedRoute) return;
59925
59930
  previousSnapshotRef.current = null;
59926
59931
  notificationEventsRef.current = [];
59927
59932
  setNotificationEvents([]);
59928
59933
  setVisibleLines([]);
59929
59934
  setLinesLoaded(false);
59930
- }, [isOnLeaderboardRoute]);
59935
+ }, [isOnSuppressedRoute]);
59931
59936
  useEffect(() => {
59932
59937
  let cancelled = false;
59933
59938
  const loadLines = async () => {
59934
- if (isOnLeaderboardRoute) {
59939
+ if (isOnSuppressedRoute) {
59935
59940
  setVisibleLines([]);
59936
59941
  setLinesLoaded(false);
59937
59942
  return;
@@ -59970,7 +59975,7 @@ var LineOvertakeNotificationManager = ({
59970
59975
  return () => {
59971
59976
  cancelled = true;
59972
59977
  };
59973
- }, [companyId, isOnLeaderboardRoute, qaSimulationEnabled, roleMode, supabase]);
59978
+ }, [companyId, isOnSuppressedRoute, qaSimulationEnabled, roleMode, supabase]);
59974
59979
  const openLeaderboard = useCallback(() => {
59975
59980
  notificationEventsRef.current = [];
59976
59981
  setNotificationEvents([]);
@@ -60016,7 +60021,7 @@ var LineOvertakeNotificationManager = ({
60016
60021
  });
60017
60022
  }, [dedupeScopeKey]);
60018
60023
  const pollLeaderboard = useCallback(async () => {
60019
- if (isOnLeaderboardRoute) return;
60024
+ if (isOnSuppressedRoute) return;
60020
60025
  if (qaSimulationEnabled) {
60021
60026
  if (pollInFlightRef.current) return;
60022
60027
  pollInFlightRef.current = true;
@@ -60075,7 +60080,7 @@ var LineOvertakeNotificationManager = ({
60075
60080
  companyId,
60076
60081
  currentShift.date,
60077
60082
  currentShift.shiftId,
60078
- isOnLeaderboardRoute,
60083
+ isOnSuppressedRoute,
60079
60084
  linesLoaded,
60080
60085
  qaSimulationEnabled,
60081
60086
  qaSimulationMode,
@@ -60097,7 +60102,7 @@ var LineOvertakeNotificationManager = ({
60097
60102
  window.clearInterval(intervalId);
60098
60103
  };
60099
60104
  }, [pollIntervalMs, pollLeaderboard]);
60100
- if (isOnLeaderboardRoute) return null;
60105
+ if (isOnSuppressedRoute) return null;
60101
60106
  return /* @__PURE__ */ jsx(
60102
60107
  LineOvertakeNotificationPopup,
60103
60108
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.35",
3
+ "version": "6.12.36",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",