@optifye/dashboard-core 6.12.31 → 6.12.33
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/automation.js +17 -1
- package/dist/automation.mjs +17 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +50 -21
- package/dist/index.mjs +50 -21
- package/package.json +1 -1
package/dist/automation.js
CHANGED
|
@@ -1993,6 +1993,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
|
|
|
1993
1993
|
"clipboard-x"
|
|
1994
1994
|
]);
|
|
1995
1995
|
var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
1996
|
+
var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
|
|
1997
|
+
"machine_maintenance",
|
|
1998
|
+
"machine_downtime",
|
|
1999
|
+
"no_material"
|
|
2000
|
+
]);
|
|
2001
|
+
var shouldRenderVideoGridStatusBadge = (badge) => {
|
|
2002
|
+
if (badge.kind !== "idle_reason") {
|
|
2003
|
+
return true;
|
|
2004
|
+
}
|
|
2005
|
+
const reasonTokens = [
|
|
2006
|
+
normalizeStatusBadgeToken(badge.label),
|
|
2007
|
+
normalizeStatusBadgeToken(badge.display_name),
|
|
2008
|
+
normalizeStatusBadgeToken(badge.title)
|
|
2009
|
+
];
|
|
2010
|
+
return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
|
|
2011
|
+
};
|
|
1996
2012
|
var resolveVideoGridStatusBadgeIconToken = (badge) => {
|
|
1997
2013
|
if (badge.kind === "no_plan") {
|
|
1998
2014
|
return "clipboard-x";
|
|
@@ -2072,7 +2088,7 @@ var VideoCard = React__default.default.memo(({
|
|
|
2072
2088
|
const shouldRenderMetricBadge = hasDisplayMetric;
|
|
2073
2089
|
const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
2074
2090
|
const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
2075
|
-
const statusBadges = workspace.video_grid_badges || [];
|
|
2091
|
+
const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
|
|
2076
2092
|
const efficiencyOverlayClass = videoGridColorState === "green" ? "bg-[#00D654]/25" : videoGridColorState === "blue" ? "bg-[#0EA5E9]/30" : videoGridColorState === "yellow" ? "bg-[#FFD700]/30" : videoGridColorState === "red" ? "bg-[#FF2D0A]/30" : "bg-transparent";
|
|
2077
2093
|
const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
|
|
2078
2094
|
const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
|
package/dist/automation.mjs
CHANGED
|
@@ -1986,6 +1986,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
|
|
|
1986
1986
|
"clipboard-x"
|
|
1987
1987
|
]);
|
|
1988
1988
|
var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
1989
|
+
var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
|
|
1990
|
+
"machine_maintenance",
|
|
1991
|
+
"machine_downtime",
|
|
1992
|
+
"no_material"
|
|
1993
|
+
]);
|
|
1994
|
+
var shouldRenderVideoGridStatusBadge = (badge) => {
|
|
1995
|
+
if (badge.kind !== "idle_reason") {
|
|
1996
|
+
return true;
|
|
1997
|
+
}
|
|
1998
|
+
const reasonTokens = [
|
|
1999
|
+
normalizeStatusBadgeToken(badge.label),
|
|
2000
|
+
normalizeStatusBadgeToken(badge.display_name),
|
|
2001
|
+
normalizeStatusBadgeToken(badge.title)
|
|
2002
|
+
];
|
|
2003
|
+
return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
|
|
2004
|
+
};
|
|
1989
2005
|
var resolveVideoGridStatusBadgeIconToken = (badge) => {
|
|
1990
2006
|
if (badge.kind === "no_plan") {
|
|
1991
2007
|
return "clipboard-x";
|
|
@@ -2065,7 +2081,7 @@ var VideoCard = React.memo(({
|
|
|
2065
2081
|
const shouldRenderMetricBadge = hasDisplayMetric;
|
|
2066
2082
|
const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
2067
2083
|
const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
2068
|
-
const statusBadges = workspace.video_grid_badges || [];
|
|
2084
|
+
const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
|
|
2069
2085
|
const efficiencyOverlayClass = videoGridColorState === "green" ? "bg-[#00D654]/25" : videoGridColorState === "blue" ? "bg-[#0EA5E9]/30" : videoGridColorState === "yellow" ? "bg-[#FFD700]/30" : videoGridColorState === "red" ? "bg-[#FF2D0A]/30" : "bg-transparent";
|
|
2070
2086
|
const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
|
|
2071
2087
|
const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
|
package/dist/index.d.mts
CHANGED
|
@@ -4397,7 +4397,7 @@ declare const useWorkspaceUptimeTimeline: (options: UseWorkspaceUptimeTimelineOp
|
|
|
4397
4397
|
* console.log(formatTime(myDate, 'HH:mm:ss zzz')); // Formats using date-fns string in configured timezone
|
|
4398
4398
|
* console.log(`Current timezone: ${timezone}`);
|
|
4399
4399
|
*/
|
|
4400
|
-
declare function useDateFormatter(): {
|
|
4400
|
+
declare function useDateFormatter(timezoneOverride?: string): {
|
|
4401
4401
|
formatDate: (date: Date | string, formatString?: string) => string;
|
|
4402
4402
|
formatTime: (date: Date | string, formatString?: string) => string;
|
|
4403
4403
|
formatDateTime: (date: Date | string, formatString?: string) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -4397,7 +4397,7 @@ declare const useWorkspaceUptimeTimeline: (options: UseWorkspaceUptimeTimelineOp
|
|
|
4397
4397
|
* console.log(formatTime(myDate, 'HH:mm:ss zzz')); // Formats using date-fns string in configured timezone
|
|
4398
4398
|
* console.log(`Current timezone: ${timezone}`);
|
|
4399
4399
|
*/
|
|
4400
|
-
declare function useDateFormatter(): {
|
|
4400
|
+
declare function useDateFormatter(timezoneOverride?: string): {
|
|
4401
4401
|
formatDate: (date: Date | string, formatString?: string) => string;
|
|
4402
4402
|
formatTime: (date: Date | string, formatString?: string) => string;
|
|
4403
4403
|
formatDateTime: (date: Date | string, formatString?: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -20487,46 +20487,56 @@ var useWorkspaceUptimeTimeline = (options) => {
|
|
|
20487
20487
|
refetch: fetchTimeline
|
|
20488
20488
|
};
|
|
20489
20489
|
};
|
|
20490
|
-
function useDateFormatter() {
|
|
20490
|
+
function useDateFormatter(timezoneOverride) {
|
|
20491
20491
|
const { defaultTimezone, defaultLocale, dateFormatOptions, timeFormatOptions, dateTimeFormatOptions } = useDateTimeConfig();
|
|
20492
|
+
const resolvedTimezone = timezoneOverride || defaultTimezone || "UTC";
|
|
20492
20493
|
const formatDate2 = React144.useCallback(
|
|
20493
20494
|
(date, formatString) => {
|
|
20494
20495
|
const dateObj = typeof date === "string" ? dateFns.parseISO(date) : date;
|
|
20495
20496
|
if (!dateFns.isValid(dateObj)) return "Invalid Date";
|
|
20496
|
-
const tz =
|
|
20497
|
+
const tz = resolvedTimezone;
|
|
20497
20498
|
if (formatString) {
|
|
20498
20499
|
return dateFnsTz.formatInTimeZone(dateObj, tz, formatString);
|
|
20499
20500
|
}
|
|
20500
20501
|
const effectiveOptions = dateFormatOptions || { year: "numeric", month: "short", day: "numeric" };
|
|
20501
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20502
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20503
|
+
...effectiveOptions,
|
|
20504
|
+
timeZone: tz
|
|
20505
|
+
}).format(dateObj);
|
|
20502
20506
|
},
|
|
20503
|
-
[
|
|
20507
|
+
[resolvedTimezone, defaultLocale, dateFormatOptions]
|
|
20504
20508
|
);
|
|
20505
20509
|
const formatTime5 = React144.useCallback(
|
|
20506
20510
|
(date, formatString) => {
|
|
20507
20511
|
const dateObj = typeof date === "string" ? dateFns.parseISO(date) : date;
|
|
20508
20512
|
if (!dateFns.isValid(dateObj)) return "Invalid Time";
|
|
20509
|
-
const tz =
|
|
20513
|
+
const tz = resolvedTimezone;
|
|
20510
20514
|
if (formatString) {
|
|
20511
20515
|
return dateFnsTz.formatInTimeZone(dateObj, tz, formatString);
|
|
20512
20516
|
}
|
|
20513
20517
|
const effectiveOptions = timeFormatOptions || { hour: "numeric", minute: "numeric" };
|
|
20514
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20518
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20519
|
+
...effectiveOptions,
|
|
20520
|
+
timeZone: tz
|
|
20521
|
+
}).format(dateObj);
|
|
20515
20522
|
},
|
|
20516
|
-
[
|
|
20523
|
+
[resolvedTimezone, defaultLocale, timeFormatOptions]
|
|
20517
20524
|
);
|
|
20518
20525
|
const formatDateTime = React144.useCallback(
|
|
20519
20526
|
(date, formatString) => {
|
|
20520
20527
|
const dateObj = typeof date === "string" ? dateFns.parseISO(date) : date;
|
|
20521
20528
|
if (!dateFns.isValid(dateObj)) return "Invalid Date/Time";
|
|
20522
|
-
const tz =
|
|
20529
|
+
const tz = resolvedTimezone;
|
|
20523
20530
|
if (formatString) {
|
|
20524
20531
|
return dateFnsTz.formatInTimeZone(dateObj, tz, formatString);
|
|
20525
20532
|
}
|
|
20526
20533
|
const effectiveOptions = dateTimeFormatOptions || { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric" };
|
|
20527
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20534
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20535
|
+
...effectiveOptions,
|
|
20536
|
+
timeZone: tz
|
|
20537
|
+
}).format(dateObj);
|
|
20528
20538
|
},
|
|
20529
|
-
[
|
|
20539
|
+
[resolvedTimezone, defaultLocale, dateTimeFormatOptions]
|
|
20530
20540
|
);
|
|
20531
20541
|
const getNow = React144.useCallback(() => {
|
|
20532
20542
|
return /* @__PURE__ */ new Date();
|
|
@@ -20536,7 +20546,7 @@ function useDateFormatter() {
|
|
|
20536
20546
|
formatTime: formatTime5,
|
|
20537
20547
|
formatDateTime,
|
|
20538
20548
|
getNow,
|
|
20539
|
-
timezone:
|
|
20549
|
+
timezone: resolvedTimezone,
|
|
20540
20550
|
locale: defaultLocale || "en-US"
|
|
20541
20551
|
};
|
|
20542
20552
|
}
|
|
@@ -38092,6 +38102,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
|
|
|
38092
38102
|
"clipboard-x"
|
|
38093
38103
|
]);
|
|
38094
38104
|
var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
38105
|
+
var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
|
|
38106
|
+
"machine_maintenance",
|
|
38107
|
+
"machine_downtime",
|
|
38108
|
+
"no_material"
|
|
38109
|
+
]);
|
|
38110
|
+
var shouldRenderVideoGridStatusBadge = (badge) => {
|
|
38111
|
+
if (badge.kind !== "idle_reason") {
|
|
38112
|
+
return true;
|
|
38113
|
+
}
|
|
38114
|
+
const reasonTokens = [
|
|
38115
|
+
normalizeStatusBadgeToken(badge.label),
|
|
38116
|
+
normalizeStatusBadgeToken(badge.display_name),
|
|
38117
|
+
normalizeStatusBadgeToken(badge.title)
|
|
38118
|
+
];
|
|
38119
|
+
return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
|
|
38120
|
+
};
|
|
38095
38121
|
var resolveVideoGridStatusBadgeIconToken = (badge) => {
|
|
38096
38122
|
if (badge.kind === "no_plan") {
|
|
38097
38123
|
return "clipboard-x";
|
|
@@ -38171,7 +38197,7 @@ var VideoCard = React144__namespace.default.memo(({
|
|
|
38171
38197
|
const shouldRenderMetricBadge = hasDisplayMetric;
|
|
38172
38198
|
const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
38173
38199
|
const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
38174
|
-
const statusBadges = workspace.video_grid_badges || [];
|
|
38200
|
+
const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
|
|
38175
38201
|
const efficiencyOverlayClass = videoGridColorState === "green" ? "bg-[#00D654]/25" : videoGridColorState === "blue" ? "bg-[#0EA5E9]/30" : videoGridColorState === "yellow" ? "bg-[#FFD700]/30" : videoGridColorState === "red" ? "bg-[#FF2D0A]/30" : "bg-transparent";
|
|
38176
38202
|
const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
|
|
38177
38203
|
const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
|
|
@@ -40249,14 +40275,16 @@ var DateTimeDisplay = ({
|
|
|
40249
40275
|
const {
|
|
40250
40276
|
defaultTimezone
|
|
40251
40277
|
} = useDateTimeConfig();
|
|
40252
|
-
const
|
|
40253
|
-
const
|
|
40278
|
+
const appTimezone = useAppTimezone();
|
|
40279
|
+
const timezone = appTimezone || defaultTimezone || "UTC";
|
|
40280
|
+
const { formatDate: formatDate2, formatTime: formatTime5 } = useDateFormatter(timezone);
|
|
40281
|
+
const [now4, setNow] = React144.useState(() => /* @__PURE__ */ new Date());
|
|
40254
40282
|
React144.useEffect(() => {
|
|
40255
40283
|
const timerId = setInterval(() => {
|
|
40256
|
-
setNow(
|
|
40284
|
+
setNow(/* @__PURE__ */ new Date());
|
|
40257
40285
|
}, 1e3);
|
|
40258
40286
|
return () => clearInterval(timerId);
|
|
40259
|
-
}, [
|
|
40287
|
+
}, []);
|
|
40260
40288
|
if (!showDate && !showTime) {
|
|
40261
40289
|
return null;
|
|
40262
40290
|
}
|
|
@@ -42778,9 +42806,9 @@ var TimeDisplay = ({ className, variant = "default" }) => {
|
|
|
42778
42806
|
minute: "2-digit",
|
|
42779
42807
|
second: "2-digit",
|
|
42780
42808
|
hour12: true,
|
|
42781
|
-
|
|
42782
|
-
...dateTimeConfig?.timeFormatOptions || {}
|
|
42809
|
+
...dateTimeConfig?.timeFormatOptions || {},
|
|
42783
42810
|
// Allow override from config
|
|
42811
|
+
timeZone: timezoneToDisplay
|
|
42784
42812
|
};
|
|
42785
42813
|
try {
|
|
42786
42814
|
setTime(new Intl.DateTimeFormat(localeToUse, effectiveFormatOptions).format(now4));
|
|
@@ -42823,7 +42851,8 @@ var TimeDisplay_default = TimeDisplay;
|
|
|
42823
42851
|
var DateDisplay = ({ className, variant = "default" }) => {
|
|
42824
42852
|
const { dateTimeConfig } = useDashboardConfig();
|
|
42825
42853
|
const [date, setDate] = React144.useState("");
|
|
42826
|
-
const
|
|
42854
|
+
const dbTimezone = useAppTimezone();
|
|
42855
|
+
const timezoneToDisplay = dbTimezone || dateTimeConfig?.defaultTimezone || "UTC";
|
|
42827
42856
|
const localeToUse = dateTimeConfig?.defaultLocale || "en-US";
|
|
42828
42857
|
React144.useEffect(() => {
|
|
42829
42858
|
const getCurrentFormattedDate = () => {
|
|
@@ -42832,9 +42861,9 @@ var DateDisplay = ({ className, variant = "default" }) => {
|
|
|
42832
42861
|
weekday: "short",
|
|
42833
42862
|
day: "numeric",
|
|
42834
42863
|
month: "short",
|
|
42835
|
-
|
|
42836
|
-
...dateTimeConfig?.dateFormatOptions || {}
|
|
42864
|
+
...dateTimeConfig?.dateFormatOptions || {},
|
|
42837
42865
|
// Allow override from config
|
|
42866
|
+
timeZone: timezoneToDisplay
|
|
42838
42867
|
};
|
|
42839
42868
|
try {
|
|
42840
42869
|
return new Intl.DateTimeFormat(localeToUse, effectiveFormatOptions).format(now4);
|
package/dist/index.mjs
CHANGED
|
@@ -20458,46 +20458,56 @@ var useWorkspaceUptimeTimeline = (options) => {
|
|
|
20458
20458
|
refetch: fetchTimeline
|
|
20459
20459
|
};
|
|
20460
20460
|
};
|
|
20461
|
-
function useDateFormatter() {
|
|
20461
|
+
function useDateFormatter(timezoneOverride) {
|
|
20462
20462
|
const { defaultTimezone, defaultLocale, dateFormatOptions, timeFormatOptions, dateTimeFormatOptions } = useDateTimeConfig();
|
|
20463
|
+
const resolvedTimezone = timezoneOverride || defaultTimezone || "UTC";
|
|
20463
20464
|
const formatDate2 = useCallback(
|
|
20464
20465
|
(date, formatString) => {
|
|
20465
20466
|
const dateObj = typeof date === "string" ? parseISO(date) : date;
|
|
20466
20467
|
if (!isValid(dateObj)) return "Invalid Date";
|
|
20467
|
-
const tz =
|
|
20468
|
+
const tz = resolvedTimezone;
|
|
20468
20469
|
if (formatString) {
|
|
20469
20470
|
return formatInTimeZone(dateObj, tz, formatString);
|
|
20470
20471
|
}
|
|
20471
20472
|
const effectiveOptions = dateFormatOptions || { year: "numeric", month: "short", day: "numeric" };
|
|
20472
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20473
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20474
|
+
...effectiveOptions,
|
|
20475
|
+
timeZone: tz
|
|
20476
|
+
}).format(dateObj);
|
|
20473
20477
|
},
|
|
20474
|
-
[
|
|
20478
|
+
[resolvedTimezone, defaultLocale, dateFormatOptions]
|
|
20475
20479
|
);
|
|
20476
20480
|
const formatTime5 = useCallback(
|
|
20477
20481
|
(date, formatString) => {
|
|
20478
20482
|
const dateObj = typeof date === "string" ? parseISO(date) : date;
|
|
20479
20483
|
if (!isValid(dateObj)) return "Invalid Time";
|
|
20480
|
-
const tz =
|
|
20484
|
+
const tz = resolvedTimezone;
|
|
20481
20485
|
if (formatString) {
|
|
20482
20486
|
return formatInTimeZone(dateObj, tz, formatString);
|
|
20483
20487
|
}
|
|
20484
20488
|
const effectiveOptions = timeFormatOptions || { hour: "numeric", minute: "numeric" };
|
|
20485
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20489
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20490
|
+
...effectiveOptions,
|
|
20491
|
+
timeZone: tz
|
|
20492
|
+
}).format(dateObj);
|
|
20486
20493
|
},
|
|
20487
|
-
[
|
|
20494
|
+
[resolvedTimezone, defaultLocale, timeFormatOptions]
|
|
20488
20495
|
);
|
|
20489
20496
|
const formatDateTime = useCallback(
|
|
20490
20497
|
(date, formatString) => {
|
|
20491
20498
|
const dateObj = typeof date === "string" ? parseISO(date) : date;
|
|
20492
20499
|
if (!isValid(dateObj)) return "Invalid Date/Time";
|
|
20493
|
-
const tz =
|
|
20500
|
+
const tz = resolvedTimezone;
|
|
20494
20501
|
if (formatString) {
|
|
20495
20502
|
return formatInTimeZone(dateObj, tz, formatString);
|
|
20496
20503
|
}
|
|
20497
20504
|
const effectiveOptions = dateTimeFormatOptions || { year: "numeric", month: "short", day: "numeric", hour: "numeric", minute: "numeric" };
|
|
20498
|
-
return new Intl.DateTimeFormat(defaultLocale || "en-US",
|
|
20505
|
+
return new Intl.DateTimeFormat(defaultLocale || "en-US", {
|
|
20506
|
+
...effectiveOptions,
|
|
20507
|
+
timeZone: tz
|
|
20508
|
+
}).format(dateObj);
|
|
20499
20509
|
},
|
|
20500
|
-
[
|
|
20510
|
+
[resolvedTimezone, defaultLocale, dateTimeFormatOptions]
|
|
20501
20511
|
);
|
|
20502
20512
|
const getNow = useCallback(() => {
|
|
20503
20513
|
return /* @__PURE__ */ new Date();
|
|
@@ -20507,7 +20517,7 @@ function useDateFormatter() {
|
|
|
20507
20517
|
formatTime: formatTime5,
|
|
20508
20518
|
formatDateTime,
|
|
20509
20519
|
getNow,
|
|
20510
|
-
timezone:
|
|
20520
|
+
timezone: resolvedTimezone,
|
|
20511
20521
|
locale: defaultLocale || "en-US"
|
|
20512
20522
|
};
|
|
20513
20523
|
}
|
|
@@ -38063,6 +38073,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
|
|
|
38063
38073
|
"clipboard-x"
|
|
38064
38074
|
]);
|
|
38065
38075
|
var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
38076
|
+
var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
|
|
38077
|
+
"machine_maintenance",
|
|
38078
|
+
"machine_downtime",
|
|
38079
|
+
"no_material"
|
|
38080
|
+
]);
|
|
38081
|
+
var shouldRenderVideoGridStatusBadge = (badge) => {
|
|
38082
|
+
if (badge.kind !== "idle_reason") {
|
|
38083
|
+
return true;
|
|
38084
|
+
}
|
|
38085
|
+
const reasonTokens = [
|
|
38086
|
+
normalizeStatusBadgeToken(badge.label),
|
|
38087
|
+
normalizeStatusBadgeToken(badge.display_name),
|
|
38088
|
+
normalizeStatusBadgeToken(badge.title)
|
|
38089
|
+
];
|
|
38090
|
+
return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
|
|
38091
|
+
};
|
|
38066
38092
|
var resolveVideoGridStatusBadgeIconToken = (badge) => {
|
|
38067
38093
|
if (badge.kind === "no_plan") {
|
|
38068
38094
|
return "clipboard-x";
|
|
@@ -38142,7 +38168,7 @@ var VideoCard = React144__default.memo(({
|
|
|
38142
38168
|
const shouldRenderMetricBadge = hasDisplayMetric;
|
|
38143
38169
|
const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
38144
38170
|
const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
|
|
38145
|
-
const statusBadges = workspace.video_grid_badges || [];
|
|
38171
|
+
const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
|
|
38146
38172
|
const efficiencyOverlayClass = videoGridColorState === "green" ? "bg-[#00D654]/25" : videoGridColorState === "blue" ? "bg-[#0EA5E9]/30" : videoGridColorState === "yellow" ? "bg-[#FFD700]/30" : videoGridColorState === "red" ? "bg-[#FF2D0A]/30" : "bg-transparent";
|
|
38147
38173
|
const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
|
|
38148
38174
|
const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
|
|
@@ -40220,14 +40246,16 @@ var DateTimeDisplay = ({
|
|
|
40220
40246
|
const {
|
|
40221
40247
|
defaultTimezone
|
|
40222
40248
|
} = useDateTimeConfig();
|
|
40223
|
-
const
|
|
40224
|
-
const
|
|
40249
|
+
const appTimezone = useAppTimezone();
|
|
40250
|
+
const timezone = appTimezone || defaultTimezone || "UTC";
|
|
40251
|
+
const { formatDate: formatDate2, formatTime: formatTime5 } = useDateFormatter(timezone);
|
|
40252
|
+
const [now4, setNow] = useState(() => /* @__PURE__ */ new Date());
|
|
40225
40253
|
useEffect(() => {
|
|
40226
40254
|
const timerId = setInterval(() => {
|
|
40227
|
-
setNow(
|
|
40255
|
+
setNow(/* @__PURE__ */ new Date());
|
|
40228
40256
|
}, 1e3);
|
|
40229
40257
|
return () => clearInterval(timerId);
|
|
40230
|
-
}, [
|
|
40258
|
+
}, []);
|
|
40231
40259
|
if (!showDate && !showTime) {
|
|
40232
40260
|
return null;
|
|
40233
40261
|
}
|
|
@@ -42749,9 +42777,9 @@ var TimeDisplay = ({ className, variant = "default" }) => {
|
|
|
42749
42777
|
minute: "2-digit",
|
|
42750
42778
|
second: "2-digit",
|
|
42751
42779
|
hour12: true,
|
|
42752
|
-
|
|
42753
|
-
...dateTimeConfig?.timeFormatOptions || {}
|
|
42780
|
+
...dateTimeConfig?.timeFormatOptions || {},
|
|
42754
42781
|
// Allow override from config
|
|
42782
|
+
timeZone: timezoneToDisplay
|
|
42755
42783
|
};
|
|
42756
42784
|
try {
|
|
42757
42785
|
setTime(new Intl.DateTimeFormat(localeToUse, effectiveFormatOptions).format(now4));
|
|
@@ -42794,7 +42822,8 @@ var TimeDisplay_default = TimeDisplay;
|
|
|
42794
42822
|
var DateDisplay = ({ className, variant = "default" }) => {
|
|
42795
42823
|
const { dateTimeConfig } = useDashboardConfig();
|
|
42796
42824
|
const [date, setDate] = useState("");
|
|
42797
|
-
const
|
|
42825
|
+
const dbTimezone = useAppTimezone();
|
|
42826
|
+
const timezoneToDisplay = dbTimezone || dateTimeConfig?.defaultTimezone || "UTC";
|
|
42798
42827
|
const localeToUse = dateTimeConfig?.defaultLocale || "en-US";
|
|
42799
42828
|
useEffect(() => {
|
|
42800
42829
|
const getCurrentFormattedDate = () => {
|
|
@@ -42803,9 +42832,9 @@ var DateDisplay = ({ className, variant = "default" }) => {
|
|
|
42803
42832
|
weekday: "short",
|
|
42804
42833
|
day: "numeric",
|
|
42805
42834
|
month: "short",
|
|
42806
|
-
|
|
42807
|
-
...dateTimeConfig?.dateFormatOptions || {}
|
|
42835
|
+
...dateTimeConfig?.dateFormatOptions || {},
|
|
42808
42836
|
// Allow override from config
|
|
42837
|
+
timeZone: timezoneToDisplay
|
|
42809
42838
|
};
|
|
42810
42839
|
try {
|
|
42811
42840
|
return new Intl.DateTimeFormat(localeToUse, effectiveFormatOptions).format(now4);
|