@optifye/dashboard-core 6.12.37 → 6.12.38

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.css CHANGED
@@ -4479,6 +4479,9 @@ body {
4479
4479
  .leading-5 {
4480
4480
  line-height: 1.25rem;
4481
4481
  }
4482
+ .leading-6 {
4483
+ line-height: 1.5rem;
4484
+ }
4482
4485
  .leading-\[1\.45\] {
4483
4486
  line-height: 1.45;
4484
4487
  }
package/dist/index.js CHANGED
@@ -72988,19 +72988,31 @@ var LeaderboardDetailView = React146.memo(({
72988
72988
  if (lineId2 === line2Id) return "Line 2";
72989
72989
  return `Line ${lineId2.substring(0, 8)}`;
72990
72990
  }, [dbLineNames, configuredLineNames, lineNames, line1Id, line2Id]);
72991
- const configuredLineIds = React146.useMemo(() => {
72992
- return getConfiguredLineIds(entityConfig);
72993
- }, [entityConfig]);
72994
72991
  const accessibleLineIdSet = React146.useMemo(
72995
72992
  () => new Set((userAccessibleLineIds || []).filter(Boolean)),
72996
72993
  [userAccessibleLineIds]
72997
72994
  );
72995
+ const configuredLineIds = React146.useMemo(() => {
72996
+ const allConfiguredLineIds = getConfiguredLineIds(entityConfig);
72997
+ if (!userAccessibleLineIds) {
72998
+ return allConfiguredLineIds;
72999
+ }
73000
+ if (accessibleLineIdSet.size === 0) {
73001
+ return [];
73002
+ }
73003
+ return allConfiguredLineIds.filter((lineId2) => accessibleLineIdSet.has(lineId2));
73004
+ }, [accessibleLineIdSet, entityConfig, userAccessibleLineIds]);
72998
73005
  const canOpenWorkspace = React146.useCallback((workspaceLineId) => {
72999
73006
  if (!workspaceLineId) return false;
73000
73007
  if (!userAccessibleLineIds) return true;
73001
73008
  if (accessibleLineIdSet.size === 0) return false;
73002
73009
  return accessibleLineIdSet.has(workspaceLineId);
73003
73010
  }, [accessibleLineIdSet, userAccessibleLineIds]);
73011
+ React146.useEffect(() => {
73012
+ if (selectedLineFilter !== "all" && !configuredLineIds.includes(selectedLineFilter)) {
73013
+ setSelectedLineFilter("all");
73014
+ }
73015
+ }, [configuredLineIds, selectedLineFilter]);
73004
73016
  const { hasUptime: lineModeHasUptime, hasOutput: lineModeHasOutput } = React146.useMemo(() => {
73005
73017
  if (!lines || lines.length === 0) {
73006
73018
  return { hasUptime: false, hasOutput: false };
@@ -73431,6 +73443,13 @@ var LeaderboardDetailView = React146.memo(({
73431
73443
  fetchMonthlyLeaderboard();
73432
73444
  }
73433
73445
  }, [activeTab, fetchMonthlyLeaderboard]);
73446
+ const retryLeaderboard = React146.useCallback(() => {
73447
+ if (activeTab === "monthly") {
73448
+ fetchMonthlyLeaderboard();
73449
+ return;
73450
+ }
73451
+ fetchTodayLeaderboard();
73452
+ }, [activeTab, fetchMonthlyLeaderboard, fetchTodayLeaderboard]);
73434
73453
  React146.useEffect(() => {
73435
73454
  if (!supabase || !entityConfig.companyId) return;
73436
73455
  if (!realtimeEnabled) return;
@@ -73694,9 +73713,26 @@ var LeaderboardDetailView = React146.memo(({
73694
73713
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xl text-gray-600", children: "Loading workspaces..." }) });
73695
73714
  }
73696
73715
  if (error) {
73697
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-xl text-red-600", children: [
73698
- "Error: ",
73699
- error.message
73716
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full max-w-md mx-4 rounded-lg border border-slate-200 bg-white p-6 text-center shadow-sm", children: [
73717
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-full bg-amber-50 text-amber-600", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertTriangle, { className: "h-5 w-5", "aria-hidden": "true" }) }),
73718
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-base font-semibold text-slate-900", children: "Leaderboard could not be refreshed" }),
73719
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-2 text-sm leading-6 text-slate-600", children: "Your access may have changed or the dashboard data service may be temporarily unavailable." }),
73720
+ /* @__PURE__ */ jsxRuntime.jsxs(
73721
+ "button",
73722
+ {
73723
+ type: "button",
73724
+ onClick: retryLeaderboard,
73725
+ className: "mt-5 inline-flex items-center justify-center gap-2 rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2",
73726
+ children: [
73727
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "h-4 w-4", "aria-hidden": "true" }),
73728
+ "Retry"
73729
+ ]
73730
+ }
73731
+ ),
73732
+ error.code && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "mt-3 text-xs text-slate-400", children: [
73733
+ "Reference: ",
73734
+ error.code
73735
+ ] })
73700
73736
  ] }) });
73701
73737
  }
73702
73738
  const hasCycleTimeLeaderboardRows = sortedWorkspaces.some(
package/dist/index.mjs CHANGED
@@ -10,7 +10,7 @@ import { EventEmitter } from 'events';
10
10
  import { createClient, REALTIME_SUBSCRIBE_STATES } from '@supabase/supabase-js';
11
11
  import Hls, { Events, ErrorTypes } from 'hls.js';
12
12
  import useSWR from 'swr';
13
- import { Camera, AlertTriangle, ChevronDown, ChevronUp, Check, ShieldCheck, Star, Award, Filter, X, Coffee, Plus, ArrowUp, ArrowDown, ArrowRight, HelpCircle, ClipboardX, Activity, Wrench, UserX, Clock, Package, RefreshCw, CheckCircle2, ArrowLeft, Calendar, Save, AlertCircle, Loader2, Minus, ChevronLeft, ChevronRight, TrendingUp, Sparkles, Pause, Play, XCircle, Palette, LockKeyhole, TrendingDown, FolderOpen, Folder, ArrowDownWideNarrow, Tag, Sliders, Layers, Search, Edit2, CheckCircle, User, Users, Shield, Building2, Mail, Lock, Info, Share2, Trophy, Target, Download, Video, Copy, Sun, Moon, MousePointer, UserPlus, UserCog, Trash2, Eye, MoreVertical, BarChart3, Pencil, UserCheck, LogOut, Film, MessageSquare, Menu, Send, Settings, LifeBuoy, EyeOff, Zap, Flame, Crown, Medal } from 'lucide-react';
13
+ import { Camera, AlertTriangle, ChevronDown, ChevronUp, Check, ShieldCheck, Star, Award, RefreshCw, Filter, X, Coffee, Plus, ArrowUp, ArrowDown, ArrowRight, HelpCircle, ClipboardX, Activity, Wrench, UserX, Clock, Package, CheckCircle2, ArrowLeft, Calendar, Save, AlertCircle, Loader2, Minus, ChevronLeft, ChevronRight, TrendingUp, Sparkles, Pause, Play, XCircle, Palette, LockKeyhole, TrendingDown, FolderOpen, Folder, ArrowDownWideNarrow, Tag, Sliders, Layers, Search, Edit2, CheckCircle, User, Users, Shield, Building2, Mail, Lock, Info, Share2, Trophy, Target, Download, Video, Copy, Sun, Moon, MousePointer, UserPlus, UserCog, Trash2, Eye, MoreVertical, BarChart3, Pencil, UserCheck, LogOut, Film, MessageSquare, Menu, Send, Settings, LifeBuoy, EyeOff, Zap, Flame, Crown, Medal } from 'lucide-react';
14
14
  import { memo, noop, warning, invariant, progress, secondsToMilliseconds, millisecondsToSeconds } from 'motion-utils';
15
15
  import { BarChart as BarChart$1, CartesianGrid, XAxis, YAxis, ReferenceLine, Tooltip, Legend, Bar, LabelList, ResponsiveContainer, LineChart as LineChart$1, Line, Customized, Cell, PieChart, Pie, ComposedChart, Area, ScatterChart, Scatter } from 'recharts';
16
16
  import { Slot } from '@radix-ui/react-slot';
@@ -72959,19 +72959,31 @@ var LeaderboardDetailView = memo$1(({
72959
72959
  if (lineId2 === line2Id) return "Line 2";
72960
72960
  return `Line ${lineId2.substring(0, 8)}`;
72961
72961
  }, [dbLineNames, configuredLineNames, lineNames, line1Id, line2Id]);
72962
- const configuredLineIds = useMemo(() => {
72963
- return getConfiguredLineIds(entityConfig);
72964
- }, [entityConfig]);
72965
72962
  const accessibleLineIdSet = useMemo(
72966
72963
  () => new Set((userAccessibleLineIds || []).filter(Boolean)),
72967
72964
  [userAccessibleLineIds]
72968
72965
  );
72966
+ const configuredLineIds = useMemo(() => {
72967
+ const allConfiguredLineIds = getConfiguredLineIds(entityConfig);
72968
+ if (!userAccessibleLineIds) {
72969
+ return allConfiguredLineIds;
72970
+ }
72971
+ if (accessibleLineIdSet.size === 0) {
72972
+ return [];
72973
+ }
72974
+ return allConfiguredLineIds.filter((lineId2) => accessibleLineIdSet.has(lineId2));
72975
+ }, [accessibleLineIdSet, entityConfig, userAccessibleLineIds]);
72969
72976
  const canOpenWorkspace = useCallback((workspaceLineId) => {
72970
72977
  if (!workspaceLineId) return false;
72971
72978
  if (!userAccessibleLineIds) return true;
72972
72979
  if (accessibleLineIdSet.size === 0) return false;
72973
72980
  return accessibleLineIdSet.has(workspaceLineId);
72974
72981
  }, [accessibleLineIdSet, userAccessibleLineIds]);
72982
+ useEffect(() => {
72983
+ if (selectedLineFilter !== "all" && !configuredLineIds.includes(selectedLineFilter)) {
72984
+ setSelectedLineFilter("all");
72985
+ }
72986
+ }, [configuredLineIds, selectedLineFilter]);
72975
72987
  const { hasUptime: lineModeHasUptime, hasOutput: lineModeHasOutput } = useMemo(() => {
72976
72988
  if (!lines || lines.length === 0) {
72977
72989
  return { hasUptime: false, hasOutput: false };
@@ -73402,6 +73414,13 @@ var LeaderboardDetailView = memo$1(({
73402
73414
  fetchMonthlyLeaderboard();
73403
73415
  }
73404
73416
  }, [activeTab, fetchMonthlyLeaderboard]);
73417
+ const retryLeaderboard = useCallback(() => {
73418
+ if (activeTab === "monthly") {
73419
+ fetchMonthlyLeaderboard();
73420
+ return;
73421
+ }
73422
+ fetchTodayLeaderboard();
73423
+ }, [activeTab, fetchMonthlyLeaderboard, fetchTodayLeaderboard]);
73405
73424
  useEffect(() => {
73406
73425
  if (!supabase || !entityConfig.companyId) return;
73407
73426
  if (!realtimeEnabled) return;
@@ -73665,9 +73684,26 @@ var LeaderboardDetailView = memo$1(({
73665
73684
  return /* @__PURE__ */ jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsx("div", { className: "text-xl text-gray-600", children: "Loading workspaces..." }) });
73666
73685
  }
73667
73686
  if (error) {
73668
- return /* @__PURE__ */ jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "text-xl text-red-600", children: [
73669
- "Error: ",
73670
- error.message
73687
+ return /* @__PURE__ */ jsx("div", { className: `h-[calc(100vh-64px)] flex items-center justify-center bg-slate-50 ${className}`, children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-md mx-4 rounded-lg border border-slate-200 bg-white p-6 text-center shadow-sm", children: [
73688
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-4 flex h-11 w-11 items-center justify-center rounded-full bg-amber-50 text-amber-600", children: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-5 w-5", "aria-hidden": "true" }) }),
73689
+ /* @__PURE__ */ jsx("h2", { className: "text-base font-semibold text-slate-900", children: "Leaderboard could not be refreshed" }),
73690
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm leading-6 text-slate-600", children: "Your access may have changed or the dashboard data service may be temporarily unavailable." }),
73691
+ /* @__PURE__ */ jsxs(
73692
+ "button",
73693
+ {
73694
+ type: "button",
73695
+ onClick: retryLeaderboard,
73696
+ className: "mt-5 inline-flex items-center justify-center gap-2 rounded-md bg-slate-900 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-slate-800 focus:outline-none focus:ring-2 focus:ring-slate-400 focus:ring-offset-2",
73697
+ children: [
73698
+ /* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4", "aria-hidden": "true" }),
73699
+ "Retry"
73700
+ ]
73701
+ }
73702
+ ),
73703
+ error.code && /* @__PURE__ */ jsxs("p", { className: "mt-3 text-xs text-slate-400", children: [
73704
+ "Reference: ",
73705
+ error.code
73706
+ ] })
73671
73707
  ] }) });
73672
73708
  }
73673
73709
  const hasCycleTimeLeaderboardRows = sortedWorkspaces.some(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.37",
3
+ "version": "6.12.38",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",