@optifye/dashboard-core 6.12.31 → 6.12.32

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.
@@ -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";
@@ -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.js CHANGED
@@ -38092,6 +38092,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
38092
38092
  "clipboard-x"
38093
38093
  ]);
38094
38094
  var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
38095
+ var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
38096
+ "machine_maintenance",
38097
+ "machine_downtime",
38098
+ "no_material"
38099
+ ]);
38100
+ var shouldRenderVideoGridStatusBadge = (badge) => {
38101
+ if (badge.kind !== "idle_reason") {
38102
+ return true;
38103
+ }
38104
+ const reasonTokens = [
38105
+ normalizeStatusBadgeToken(badge.label),
38106
+ normalizeStatusBadgeToken(badge.display_name),
38107
+ normalizeStatusBadgeToken(badge.title)
38108
+ ];
38109
+ return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
38110
+ };
38095
38111
  var resolveVideoGridStatusBadgeIconToken = (badge) => {
38096
38112
  if (badge.kind === "no_plan") {
38097
38113
  return "clipboard-x";
@@ -38171,7 +38187,7 @@ var VideoCard = React144__namespace.default.memo(({
38171
38187
  const shouldRenderMetricBadge = hasDisplayMetric;
38172
38188
  const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
38173
38189
  const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
38174
- const statusBadges = workspace.video_grid_badges || [];
38190
+ const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
38175
38191
  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
38192
  const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
38177
38193
  const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
package/dist/index.mjs CHANGED
@@ -38063,6 +38063,22 @@ var VALID_STATUS_BADGE_ICON_TOKENS = /* @__PURE__ */ new Set([
38063
38063
  "clipboard-x"
38064
38064
  ]);
38065
38065
  var normalizeStatusBadgeToken = (value) => String(value || "").trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
38066
+ var TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS = /* @__PURE__ */ new Set([
38067
+ "machine_maintenance",
38068
+ "machine_downtime",
38069
+ "no_material"
38070
+ ]);
38071
+ var shouldRenderVideoGridStatusBadge = (badge) => {
38072
+ if (badge.kind !== "idle_reason") {
38073
+ return true;
38074
+ }
38075
+ const reasonTokens = [
38076
+ normalizeStatusBadgeToken(badge.label),
38077
+ normalizeStatusBadgeToken(badge.display_name),
38078
+ normalizeStatusBadgeToken(badge.title)
38079
+ ];
38080
+ return !reasonTokens.some((token) => TEMPORARILY_DISABLED_STATUS_BADGE_TOKENS.has(token));
38081
+ };
38066
38082
  var resolveVideoGridStatusBadgeIconToken = (badge) => {
38067
38083
  if (badge.kind === "no_plan") {
38068
38084
  return "clipboard-x";
@@ -38142,7 +38158,7 @@ var VideoCard = React144__default.memo(({
38142
38158
  const shouldRenderMetricBadge = hasDisplayMetric;
38143
38159
  const badgeTitle = isHighEfficiencyOverride ? `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%` : hasVideoGridRecentFlow(workspace) ? `Flow ${Math.round(videoGridDisplayValue ?? 0)}%` : isRecentFlowCard ? "Flow unavailable" : `Efficiency ${Math.round(videoGridDisplayValue ?? 0)}%`;
38144
38160
  const badgeLabel = `${Math.round(videoGridDisplayValue ?? 0)}%`;
38145
- const statusBadges = workspace.video_grid_badges || [];
38161
+ const statusBadges = (workspace.video_grid_badges || []).filter(shouldRenderVideoGridStatusBadge);
38146
38162
  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
38163
  const efficiencyBarClass = videoGridColorState === "green" ? "bg-[#00AB45]" : videoGridColorState === "blue" ? "bg-[#0EA5E9]" : videoGridColorState === "yellow" ? "bg-[#FFB020]" : videoGridColorState === "red" ? "bg-[#E34329]" : "bg-gray-500/70";
38148
38164
  const efficiencyStatus = videoGridColorState === "green" ? "High" : videoGridColorState === "blue" ? "Best" : videoGridColorState === "yellow" ? "Medium" : videoGridColorState === "red" ? "Low" : "Neutral";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.31",
3
+ "version": "6.12.32",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",