@optifye/dashboard-core 6.3.3 → 6.3.4

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
@@ -12080,8 +12080,11 @@ var useHourlyTargetAchievements = ({
12080
12080
  targetThreshold,
12081
12081
  enabled
12082
12082
  });
12083
- const currentHourIndex = hourlyData.length - 1;
12084
- if (currentHourIndex < 0 || hourlyData[currentHourIndex] === void 0) {
12083
+ let currentHourIndex = hourlyData.length - 1;
12084
+ while (currentHourIndex >= 0 && (hourlyData[currentHourIndex] === void 0 || hourlyData[currentHourIndex] === 0)) {
12085
+ currentHourIndex--;
12086
+ }
12087
+ if (currentHourIndex < 0) {
12085
12088
  console.log("[HOURLY TARGET CHECK] No hourly data available");
12086
12089
  return;
12087
12090
  }
@@ -12179,8 +12182,11 @@ var useHourlyTargetMisses = ({
12179
12182
  targetThreshold,
12180
12183
  enabled
12181
12184
  });
12182
- const currentHourIndex = hourlyData.length - 1;
12183
- if (currentHourIndex < 0 || hourlyData[currentHourIndex] === void 0) {
12185
+ let currentHourIndex = hourlyData.length - 1;
12186
+ while (currentHourIndex >= 0 && (hourlyData[currentHourIndex] === void 0 || hourlyData[currentHourIndex] === 0)) {
12187
+ currentHourIndex--;
12188
+ }
12189
+ if (currentHourIndex < 0) {
12184
12190
  console.log("[HOURLY TARGET MISS CHECK] No hourly data available");
12185
12191
  return;
12186
12192
  }
@@ -35500,6 +35506,10 @@ var TargetsViewUI = ({
35500
35506
  ),
35501
35507
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-8 w-px bg-gray-200/80" }),
35502
35508
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "ml-4 text-sm font-medium text-gray-600", children: [
35509
+ line.shiftStartTime,
35510
+ " \u2013 ",
35511
+ line.shiftEndTime,
35512
+ " \u2022 ",
35503
35513
  line.shiftHours,
35504
35514
  " hours"
35505
35515
  ] }) })
@@ -36162,7 +36172,7 @@ var TargetsView = ({
36162
36172
  const handleShiftChange = (shiftId) => {
36163
36173
  setSelectedShift(shiftId);
36164
36174
  const loadShiftHours = async () => {
36165
- const updatedLineWorkspaces = { ...lineWorkspaces };
36175
+ const updatedLineWorkspaces = { ...allShiftsData[shiftId] };
36166
36176
  let hasUpdates = false;
36167
36177
  for (const lineId of lineIds) {
36168
36178
  try {
@@ -36210,7 +36220,10 @@ var TargetsView = ({
36210
36220
  }
36211
36221
  }
36212
36222
  if (hasUpdates) {
36213
- setLineWorkspaces(updatedLineWorkspaces);
36223
+ setAllShiftsData((prev) => ({
36224
+ ...prev,
36225
+ [shiftId]: updatedLineWorkspaces
36226
+ }));
36214
36227
  }
36215
36228
  };
36216
36229
  loadShiftHours();
package/dist/index.mjs CHANGED
@@ -12050,8 +12050,11 @@ var useHourlyTargetAchievements = ({
12050
12050
  targetThreshold,
12051
12051
  enabled
12052
12052
  });
12053
- const currentHourIndex = hourlyData.length - 1;
12054
- if (currentHourIndex < 0 || hourlyData[currentHourIndex] === void 0) {
12053
+ let currentHourIndex = hourlyData.length - 1;
12054
+ while (currentHourIndex >= 0 && (hourlyData[currentHourIndex] === void 0 || hourlyData[currentHourIndex] === 0)) {
12055
+ currentHourIndex--;
12056
+ }
12057
+ if (currentHourIndex < 0) {
12055
12058
  console.log("[HOURLY TARGET CHECK] No hourly data available");
12056
12059
  return;
12057
12060
  }
@@ -12149,8 +12152,11 @@ var useHourlyTargetMisses = ({
12149
12152
  targetThreshold,
12150
12153
  enabled
12151
12154
  });
12152
- const currentHourIndex = hourlyData.length - 1;
12153
- if (currentHourIndex < 0 || hourlyData[currentHourIndex] === void 0) {
12155
+ let currentHourIndex = hourlyData.length - 1;
12156
+ while (currentHourIndex >= 0 && (hourlyData[currentHourIndex] === void 0 || hourlyData[currentHourIndex] === 0)) {
12157
+ currentHourIndex--;
12158
+ }
12159
+ if (currentHourIndex < 0) {
12154
12160
  console.log("[HOURLY TARGET MISS CHECK] No hourly data available");
12155
12161
  return;
12156
12162
  }
@@ -35470,6 +35476,10 @@ var TargetsViewUI = ({
35470
35476
  ),
35471
35477
  /* @__PURE__ */ jsx("div", { className: "h-8 w-px bg-gray-200/80" }),
35472
35478
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs("div", { className: "ml-4 text-sm font-medium text-gray-600", children: [
35479
+ line.shiftStartTime,
35480
+ " \u2013 ",
35481
+ line.shiftEndTime,
35482
+ " \u2022 ",
35473
35483
  line.shiftHours,
35474
35484
  " hours"
35475
35485
  ] }) })
@@ -36132,7 +36142,7 @@ var TargetsView = ({
36132
36142
  const handleShiftChange = (shiftId) => {
36133
36143
  setSelectedShift(shiftId);
36134
36144
  const loadShiftHours = async () => {
36135
- const updatedLineWorkspaces = { ...lineWorkspaces };
36145
+ const updatedLineWorkspaces = { ...allShiftsData[shiftId] };
36136
36146
  let hasUpdates = false;
36137
36147
  for (const lineId of lineIds) {
36138
36148
  try {
@@ -36180,7 +36190,10 @@ var TargetsView = ({
36180
36190
  }
36181
36191
  }
36182
36192
  if (hasUpdates) {
36183
- setLineWorkspaces(updatedLineWorkspaces);
36193
+ setAllShiftsData((prev) => ({
36194
+ ...prev,
36195
+ [shiftId]: updatedLineWorkspaces
36196
+ }));
36184
36197
  }
36185
36198
  };
36186
36199
  loadShiftHours();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optifye/dashboard-core",
3
- "version": "6.3.3",
3
+ "version": "6.3.4",
4
4
  "description": "Reusable UI & logic for Optifye dashboard",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",