@optifye/dashboard-core 6.12.43 → 6.12.44

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
@@ -39719,10 +39719,11 @@ var WorkspaceMetricCardsImpl = ({
39719
39719
  }
39720
39720
  return null;
39721
39721
  }, [activeSku, skuAware, activeSkuId, liveSkuId, skuBreakdown]);
39722
- const pphValue = activeSku ? activeSku.avg_pph : workspace.avg_pph;
39723
- const pphThreshold = activeSku ? activeSku.pph_threshold : workspace.pph_threshold;
39724
- const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
39725
- const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
39722
+ const metricSku = displaySku;
39723
+ const pphValue = metricSku ? metricSku.avg_pph : workspace.avg_pph;
39724
+ const pphThreshold = metricSku ? metricSku.pph_threshold : workspace.pph_threshold;
39725
+ const cycleValue = metricSku ? metricSku.avg_cycle_time : workspace.avg_cycle_time;
39726
+ const cycleStandard = metricSku ? metricSku.ideal_cycle_time : workspace.ideal_cycle_time;
39726
39727
  const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
39727
39728
  const efficiencyValue = workspace.avg_efficiency || 0;
39728
39729
  const efficiencyTarget = effectiveLegend.green_min;
@@ -55827,8 +55828,9 @@ var WorkspaceCycleTimeMetricCards = ({
55827
55828
  }
55828
55829
  return null;
55829
55830
  }, [activeSku, skuAware, activeSkuId, liveSkuId, skuBreakdown]);
55830
- const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
55831
- const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
55831
+ const metricSku = displaySku;
55832
+ const cycleValue = metricSku ? metricSku.avg_cycle_time : workspace.avg_cycle_time;
55833
+ const cycleStandard = metricSku ? metricSku.ideal_cycle_time : workspace.ideal_cycle_time;
55832
55834
  const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
55833
55835
  const efficiencyValue = workspace.avg_efficiency || 0;
55834
55836
  const efficiencyTarget = effectiveLegend.green_min;
@@ -80213,6 +80215,8 @@ var WorkspaceDetailView = ({
80213
80215
  [workspace?.sku_segments]
80214
80216
  );
80215
80217
  const activeSkuId = selectedSkuId;
80218
+ const shouldUseLiveSkuForMetricCards = !isHistoricView || Boolean(date) && date === calculatedOperationalDate && parsedShiftId !== void 0 && parsedShiftId === calculatedShiftId;
80219
+ const metricCardLiveSkuId = shouldUseLiveSkuForMetricCards ? liveSkuId : null;
80216
80220
  const resolvedLineId = effectiveLineId || workspace?.line_id || cachedDetailedMetrics?.line_id || cachedOverviewMetrics?.line_id || overviewFallback?.line_id;
80217
80221
  const { timezone: cycleTimeTimezone } = useTimezone({
80218
80222
  lineId: resolvedLineId || void 0,
@@ -81285,7 +81289,7 @@ var WorkspaceDetailView = ({
81285
81289
  skuAware: isSkuAware,
81286
81290
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81287
81291
  activeSkuId,
81288
- liveSkuId: isHistoricView ? null : liveSkuId
81292
+ liveSkuId: metricCardLiveSkuId
81289
81293
  }
81290
81294
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
81291
81295
  WorkspaceMetricCards,
@@ -81296,7 +81300,7 @@ var WorkspaceDetailView = ({
81296
81300
  skuAware: isSkuAware,
81297
81301
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81298
81302
  activeSkuId,
81299
- liveSkuId: isHistoricView ? null : liveSkuId
81303
+ liveSkuId: metricCardLiveSkuId
81300
81304
  }
81301
81305
  ) })
81302
81306
  ] }),
@@ -81467,7 +81471,7 @@ var WorkspaceDetailView = ({
81467
81471
  skuAware: isSkuAware,
81468
81472
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81469
81473
  activeSkuId,
81470
- liveSkuId: isHistoricView ? null : liveSkuId
81474
+ liveSkuId: metricCardLiveSkuId
81471
81475
  }
81472
81476
  ) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx("flex min-h-0", desktopBottomSectionClass), children: /* @__PURE__ */ jsxRuntime.jsx(
81473
81477
  WorkspaceMetricCards,
@@ -81478,7 +81482,7 @@ var WorkspaceDetailView = ({
81478
81482
  skuAware: isSkuAware,
81479
81483
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81480
81484
  activeSkuId,
81481
- liveSkuId: isHistoricView ? null : liveSkuId
81485
+ liveSkuId: metricCardLiveSkuId
81482
81486
  }
81483
81487
  ) })
81484
81488
  ] })
package/dist/index.mjs CHANGED
@@ -39690,10 +39690,11 @@ var WorkspaceMetricCardsImpl = ({
39690
39690
  }
39691
39691
  return null;
39692
39692
  }, [activeSku, skuAware, activeSkuId, liveSkuId, skuBreakdown]);
39693
- const pphValue = activeSku ? activeSku.avg_pph : workspace.avg_pph;
39694
- const pphThreshold = activeSku ? activeSku.pph_threshold : workspace.pph_threshold;
39695
- const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
39696
- const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
39693
+ const metricSku = displaySku;
39694
+ const pphValue = metricSku ? metricSku.avg_pph : workspace.avg_pph;
39695
+ const pphThreshold = metricSku ? metricSku.pph_threshold : workspace.pph_threshold;
39696
+ const cycleValue = metricSku ? metricSku.avg_cycle_time : workspace.avg_cycle_time;
39697
+ const cycleStandard = metricSku ? metricSku.ideal_cycle_time : workspace.ideal_cycle_time;
39697
39698
  const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
39698
39699
  const efficiencyValue = workspace.avg_efficiency || 0;
39699
39700
  const efficiencyTarget = effectiveLegend.green_min;
@@ -55798,8 +55799,9 @@ var WorkspaceCycleTimeMetricCards = ({
55798
55799
  }
55799
55800
  return null;
55800
55801
  }, [activeSku, skuAware, activeSkuId, liveSkuId, skuBreakdown]);
55801
- const cycleValue = activeSku ? activeSku.avg_cycle_time : workspace.avg_cycle_time;
55802
- const cycleStandard = activeSku ? activeSku.ideal_cycle_time : workspace.ideal_cycle_time;
55802
+ const metricSku = displaySku;
55803
+ const cycleValue = metricSku ? metricSku.avg_cycle_time : workspace.avg_cycle_time;
55804
+ const cycleStandard = metricSku ? metricSku.ideal_cycle_time : workspace.ideal_cycle_time;
55803
55805
  const displaySkuLabel = displaySku ? getSkuDisplayName(displaySku) : "";
55804
55806
  const efficiencyValue = workspace.avg_efficiency || 0;
55805
55807
  const efficiencyTarget = effectiveLegend.green_min;
@@ -80184,6 +80186,8 @@ var WorkspaceDetailView = ({
80184
80186
  [workspace?.sku_segments]
80185
80187
  );
80186
80188
  const activeSkuId = selectedSkuId;
80189
+ const shouldUseLiveSkuForMetricCards = !isHistoricView || Boolean(date) && date === calculatedOperationalDate && parsedShiftId !== void 0 && parsedShiftId === calculatedShiftId;
80190
+ const metricCardLiveSkuId = shouldUseLiveSkuForMetricCards ? liveSkuId : null;
80187
80191
  const resolvedLineId = effectiveLineId || workspace?.line_id || cachedDetailedMetrics?.line_id || cachedOverviewMetrics?.line_id || overviewFallback?.line_id;
80188
80192
  const { timezone: cycleTimeTimezone } = useTimezone({
80189
80193
  lineId: resolvedLineId || void 0,
@@ -81256,7 +81260,7 @@ var WorkspaceDetailView = ({
81256
81260
  skuAware: isSkuAware,
81257
81261
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81258
81262
  activeSkuId,
81259
- liveSkuId: isHistoricView ? null : liveSkuId
81263
+ liveSkuId: metricCardLiveSkuId
81260
81264
  }
81261
81265
  ) : /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
81262
81266
  WorkspaceMetricCards,
@@ -81267,7 +81271,7 @@ var WorkspaceDetailView = ({
81267
81271
  skuAware: isSkuAware,
81268
81272
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81269
81273
  activeSkuId,
81270
- liveSkuId: isHistoricView ? null : liveSkuId
81274
+ liveSkuId: metricCardLiveSkuId
81271
81275
  }
81272
81276
  ) })
81273
81277
  ] }),
@@ -81438,7 +81442,7 @@ var WorkspaceDetailView = ({
81438
81442
  skuAware: isSkuAware,
81439
81443
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81440
81444
  activeSkuId,
81441
- liveSkuId: isHistoricView ? null : liveSkuId
81445
+ liveSkuId: metricCardLiveSkuId
81442
81446
  }
81443
81447
  ) : /* @__PURE__ */ jsx("div", { className: clsx("flex min-h-0", desktopBottomSectionClass), children: /* @__PURE__ */ jsx(
81444
81448
  WorkspaceMetricCards,
@@ -81449,7 +81453,7 @@ var WorkspaceDetailView = ({
81449
81453
  skuAware: isSkuAware,
81450
81454
  skuBreakdown: isSkuAware ? realSkuBreakdown : void 0,
81451
81455
  activeSkuId,
81452
- liveSkuId: isHistoricView ? null : liveSkuId
81456
+ liveSkuId: metricCardLiveSkuId
81453
81457
  }
81454
81458
  ) })
81455
81459
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.12.43",
3
+ "version": "6.12.44",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",