@seedtactics/insight-client 17.0.7 → 17.0.9

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.
@@ -30,8 +30,13 @@ export interface MaterialSummaryAndCompletedData extends MaterialSummary {
30
30
  };
31
31
  readonly currently_quarantined?: boolean;
32
32
  }
33
+ interface QuarantineSignal {
34
+ readonly counter: number;
35
+ readonly note: string | undefined;
36
+ }
33
37
  interface MaterialSummaryFromEvents extends MaterialSummaryAndCompletedData {
34
38
  readonly last_event: Date;
39
+ readonly quarantineSignals?: HashMap<number, QuarantineSignal>;
35
40
  }
36
41
  export interface MatSummaryState {
37
42
  readonly matsById: HashMap<number, MaterialSummaryFromEvents>;
@@ -177,8 +177,18 @@ function process_event(st, e) {
177
177
  case LogType.CloseOut:
178
178
  mat = { ...mat, closeout_completed: e.endUTC, closeout_failed: e.result === "Failed" };
179
179
  break;
180
- case LogType.SignalQuarantine:
181
- mat = { ...mat, quarantineAfterUnload: true };
180
+ case LogType.SignalQuarantine: {
181
+ const signals = mat.quarantineSignals ?? HashMap.empty();
182
+ const previous = signals.get(logMat.proc);
183
+ mat = {
184
+ ...mat,
185
+ quarantineAfterUnload: true,
186
+ quarantineSignals: previous && previous.counter >= e.counter
187
+ ? signals
188
+ : signals.set(logMat.proc, { counter: e.counter, note: e.details?.note?.trim() }),
189
+ };
190
+ break;
191
+ }
182
192
  }
183
193
  mats = mats.set(logMat.id, mat);
184
194
  }
@@ -212,7 +222,7 @@ export const updateLast30MatSummary = atom(null, (_, set, { evt, now, expire })
212
222
  set(last30MaterialSummaryRW, (st) => {
213
223
  const newSt = process_event(st, log);
214
224
  if (newSt === st || !expire) {
215
- return st;
225
+ return newSt;
216
226
  }
217
227
  else {
218
228
  return filter_old(addDays(now, -30), newSt);
@@ -40,7 +40,7 @@ import { useSortable } from "@dnd-kit/sortable";
40
40
  import * as api from "../../network/api.js";
41
41
  import * as matDetails from "../../cell-status/material-details.js";
42
42
  import { LogEntries } from "../LogEntry.js";
43
- import { inproc_mat_to_summary, } from "../../cell-status/material-summary.js";
43
+ import { inproc_mat_to_summary, last30MaterialSummary, } from "../../cell-status/material-summary.js";
44
44
  import { currentOperator } from "../../data/operators.js";
45
45
  import { DisplayLoadingAndError } from "../ErrorsAndLoading.js";
46
46
  import { ErrorBoundary } from "react-error-boundary";
@@ -50,7 +50,7 @@ import { useAtom, useAtomValue, useSetAtom } from "jotai";
50
50
  import { last30Rebookings } from "../../cell-status/rebookings.js";
51
51
  import { fmsInformation } from "../../network/server-settings.js";
52
52
  import { basketDisplayName, basketSlotLabel } from "../../cell-status/station-cycles.js";
53
- import { canAddOrMoveMaterialToQueue, canReorderQueuedMaterial, materialOperationState, } from "../../data/material-operation-policy.js";
53
+ import { canAddOrMoveMaterialToQueue, canReorderQueuedMaterial, materialOperationState, quarantineRoute, } from "../../data/material-operation-policy.js";
54
54
  export class PartIdenticon extends PureComponent {
55
55
  render() {
56
56
  const iconSize = this.props.size || 50;
@@ -294,24 +294,29 @@ function materialActionDescription(mat, curSt, basketName, displayActionForSingl
294
294
  }
295
295
  return null;
296
296
  }
297
- function Warning({ mat }) {
297
+ function Warning({ mat, inProcMat, }) {
298
+ const summary = useAtomValue(last30MaterialSummary).matsById.get(mat.materialID);
299
+ const reason = inProcMat
300
+ ? summary?.quarantineSignals?.get(quarantineRoute(inProcMat).process)?.note
301
+ : undefined;
298
302
  let tooltip = null;
299
303
  if (mat.signaledInspections.length > 0) {
300
304
  tooltip = "Inspect: " + mat.signaledInspections.join(", ");
301
305
  }
302
306
  if (mat.quarantineAfterUnload) {
307
+ const quarantine = "Material will quarantine after unload" + (reason ? `: ${reason}` : "");
303
308
  if (tooltip === null) {
304
- tooltip = "Material will quarantine after unload";
309
+ tooltip = quarantine;
305
310
  }
306
311
  else {
307
- tooltip += "; Material will quarantine after unload";
312
+ tooltip += `; ${quarantine}`;
308
313
  }
309
314
  }
310
315
  if (tooltip === null) {
311
316
  return null;
312
317
  }
313
318
  else {
314
- return (_jsx(Tooltip, { title: tooltip, children: _jsx(WarningIcon, {}) }));
319
+ return (_jsx(Tooltip, { title: tooltip, describeChild: true, children: _jsx(WarningIcon, { titleAccess: "Material warnings" }) }));
315
320
  }
316
321
  }
317
322
  function JobRawMaterial({ fsize, mat, }) {
@@ -413,7 +418,7 @@ const MatCard = function MatCard({ mat, materialCount = 1, inProcMat, fsize, foc
413
418
  alignItems: "flex-end",
414
419
  alignSelf: "start",
415
420
  flexShrink: 0,
416
- }, children: [mat.serial && mat.serial.length >= 1 && !hideAvatar ? (_jsx("div", { children: _jsx(Avatar, { style: { width: "30px", height: "30px" }, children: mat.serial.slice(-1) }) })) : undefined, hideWarningIcon ? undefined : (_jsx("div", { children: _jsx(Warning, { mat: mat }) }))] })] }) })] }));
421
+ }, children: [mat.serial && mat.serial.length >= 1 && !hideAvatar ? (_jsx("div", { children: _jsx(Avatar, { style: { width: "30px", height: "30px" }, children: mat.serial.slice(-1) }) })) : undefined, hideWarningIcon ? undefined : (_jsx("div", { children: _jsx(Warning, { mat: mat, inProcMat: inProcMat }) }))] })] }) })] }));
417
422
  };
418
423
  export const MatSummary = memo(MatCard);
419
424
  export const InProcMaterial = memo(function InProcMaterial(props) {
@@ -564,11 +569,22 @@ function RebookingNote() {
564
569
  }
565
570
  return null;
566
571
  }
572
+ function QuarantineReason({ material }) {
573
+ const events = useAtomValue(matDetails.materialInDialogLocalEvents);
574
+ const process = quarantineRoute(material).process;
575
+ const quarantine = events.reduce((latest, event) => event.type === api.LogType.SignalQuarantine &&
576
+ event.material.some((m) => m.id === material.materialID && m.proc === process) &&
577
+ (latest === null || event.counter > latest.counter)
578
+ ? event
579
+ : latest, null);
580
+ const reason = quarantine?.details?.note?.trim();
581
+ return reason ? `: ${reason}` : null;
582
+ }
567
583
  function MaterialOperationNotice() {
568
584
  const material = useAtomValue(matDetails.inProcessMaterialInDialog);
569
585
  const alarms = matDetails.useMaterialBlockingAlarms();
570
586
  const state = material ? materialOperationState(material) : null;
571
- return (_jsx(_Fragment, { children: material?.quarantineAfterUnload ? (_jsx(Typography, { variant: "caption", component: "p", children: "Quarantine requested" })) : alarms.length === 0 &&
587
+ return (_jsx(_Fragment, { children: material?.quarantineAfterUnload ? (_jsxs(Typography, { variant: "caption", component: "p", children: ["Quarantine requested", _jsx(ErrorBoundary, { fallback: null, resetKeys: [material.materialID, quarantineRoute(material).process], children: _jsx(QuarantineReason, { material: material }) })] })) : alarms.length === 0 &&
572
588
  state?.kind === "ActiveLoadStationOperation" &&
573
589
  state.cancellationId === null ? (_jsx(Typography, { variant: "caption", component: "p", children: "This material is part of the current load/unload operation. Complete the operation or cancel it at the machine control before making other changes." })) : null }));
574
590
  }
@@ -226,11 +226,8 @@ function useCellOverview() {
226
226
  });
227
227
  for (const lulNum of mach.possibleLoadStations) {
228
228
  // remove and lookup old load status
229
- let lul;
230
- loads = loads.alter(lulNum, (s) => {
231
- lul = s;
232
- return undefined;
233
- });
229
+ const lul = loads.get(lulNum);
230
+ loads = loads.delete(lulNum);
234
231
  const allMats = LazySeq.of(lul?.pal?.mats ?? []).toLookup((m) => {
235
232
  if (m.action.type === ActionType.Machining)
236
233
  return "Machining";
package/dist/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <link rel="shortcut icon" href="/assets/favicon-gWFxiJK2.ico" />
7
7
  <title>SeedTactic FMS Insight</title>
8
8
  <style type="text/css">.download-loader{width:100px;height:100px;display:inline-block}.download-circular{width:100px;height:100px;animation:2s linear infinite rotate}.download-path{stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;stroke:#8d6e63;animation:1.5s ease-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}</style>
9
- <script type="module" crossorigin src="/assets/index-CYOpFETi.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-CRYAXxTe.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
11
11
  </head>
12
12
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedtactics/insight-client",
3
- "version": "17.0.7",
3
+ "version": "17.0.9",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "url": "https://github.com/SeedTactics/fms-insight"
@@ -38,8 +38,8 @@
38
38
  "copy-to-clipboard": "^4.0.2",
39
39
  "d3-interpolate-path": "^2.3.0",
40
40
  "d3-sankey": "^0.12.3",
41
- "d3-scale": "^4.0.2",
42
- "d3-shape": "^3.2.0",
41
+ "d3-scale": "^4.0.3",
42
+ "d3-shape": "^3.2.1",
43
43
  "date-fns": "^4.4.0",
44
44
  "highlight.js": "^11.12.0",
45
45
  "jdenticon": "^3.3.0",
@@ -61,15 +61,15 @@
61
61
  "@types/d3-shape": "^3.2.0",
62
62
  "@types/react": "^19.3.0",
63
63
  "@types/react-dom": "^19.3.0",
64
- "@vitejs/plugin-react": "^6.1.2",
65
- "@vitest/browser-playwright": "^5.0.5",
64
+ "@vitejs/plugin-react": "^6.2.1",
65
+ "@vitest/browser-playwright": "^5.1.0",
66
66
  "jotai": "^3.0.1",
67
67
  "jsdom": "^30.1.3",
68
68
  "playwright": "^1.64.1",
69
69
  "react": "^19.3.1",
70
70
  "react-dom": "^19.3.1",
71
71
  "vite": "^8.3.5",
72
- "vitest": "^5.0.5",
72
+ "vitest": "^5.1.0",
73
73
  "vitest-browser-react": "^2.3.0"
74
74
  },
75
75
  "peerDependencies": {