@seedtactics/insight-client 16.5.2 → 16.7.0
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/assets/ProgramHighlight-DPTeZ8Si.js +3 -0
- package/dist/assets/index-bPAFn3jp.js +364 -0
- package/dist/cell-status/basket-cycles.d.ts +21 -0
- package/dist/cell-status/basket-cycles.js +80 -0
- package/dist/cell-status/current-status.js +11 -3
- package/dist/cell-status/estimated-cycle-times.js +8 -4
- package/dist/cell-status/inspections.js +2 -2
- package/dist/cell-status/loading.js +4 -0
- package/dist/cell-status/material-details.d.ts +12 -4
- package/dist/cell-status/material-details.js +24 -13
- package/dist/cell-status/rebookings.js +15 -17
- package/dist/cell-status/scheduled-jobs.d.ts +1 -1
- package/dist/cell-status/scheduled-jobs.js +10 -3
- package/dist/cell-status/sim-production.js +3 -3
- package/dist/cell-status/sim-station-use.d.ts +1 -0
- package/dist/cell-status/sim-station-use.js +14 -8
- package/dist/cell-status/station-cycles.d.ts +29 -2
- package/dist/cell-status/station-cycles.js +81 -11
- package/dist/cell-status/tool-replacements.js +1 -1
- package/dist/cell-status/tool-usage.js +1 -1
- package/dist/components/App.js +101 -66
- package/dist/components/BarcodeScanning.js +12 -2
- package/dist/components/ErrorsAndLoading.js +10 -1
- package/dist/components/LogEntry.d.ts +0 -1
- package/dist/components/LogEntry.js +50 -26
- package/dist/components/Navigation.js +30 -4
- package/dist/components/analysis/AnalysisSelectToolbar.js +5 -1
- package/dist/components/analysis/BasketCycleCards.d.ts +1 -0
- package/dist/components/analysis/BasketCycleCards.js +145 -0
- package/dist/components/analysis/BufferChart.js +10 -4
- package/dist/components/analysis/CostPerPiece.js +28 -8
- package/dist/components/analysis/CycleChart.js +1 -1
- package/dist/components/analysis/DataTable.js +6 -4
- package/dist/components/analysis/HeatChart.js +27 -14
- package/dist/components/analysis/InspectionSankey.js +17 -6
- package/dist/components/analysis/PalletCycleCards.js +15 -4
- package/dist/components/analysis/PartCycleCards.js +62 -18
- package/dist/components/analysis/StationDataTable.js +14 -11
- package/dist/components/analysis/ToolReplacements.js +16 -10
- package/dist/components/log-entry-queue-filter.d.ts +2 -0
- package/dist/components/log-entry-queue-filter.js +21 -0
- package/dist/components/operations/AllMaterial.js +26 -10
- package/dist/components/operations/ChartRangeEdit.js +82 -4
- package/dist/components/operations/CloseoutReport.js +13 -4
- package/dist/components/operations/CompletedParts.js +23 -11
- package/dist/components/operations/CurrentWorkorders.js +31 -9
- package/dist/components/operations/OEEChart.js +8 -2
- package/dist/components/operations/Outliers.js +18 -7
- package/dist/components/operations/ProgramHighlight.js +4 -6
- package/dist/components/operations/Programs.js +9 -3
- package/dist/components/operations/Rebookings.js +8 -4
- package/dist/components/operations/RecentCycleChart.js +5 -3
- package/dist/components/operations/RecentProduction.js +30 -13
- package/dist/components/operations/RecentSchedules.js +6 -2
- package/dist/components/operations/RecentStationCycles.js +38 -11
- package/dist/components/operations/ShiftSettings.js +3 -3
- package/dist/components/operations/SimDayUsage.js +27 -4
- package/dist/components/operations/ToolReport.js +5 -1
- package/dist/components/operations/WorkorderGantt.js +22 -2
- package/dist/components/quality/QualityMaterial.js +11 -8
- package/dist/components/quality/RecentFailedInspections.js +3 -1
- package/dist/components/routes.d.ts +3 -0
- package/dist/components/routes.js +2 -0
- package/dist/components/station-monitor/BulkRawMaterial.js +11 -7
- package/dist/components/station-monitor/Closeout.js +14 -2
- package/dist/components/station-monitor/CustomStationMonitorDialog.js +1 -1
- package/dist/components/station-monitor/Inspection.js +23 -11
- package/dist/components/station-monitor/InvalidateCycle.js +3 -3
- package/dist/components/station-monitor/JobDetails.js +15 -2
- package/dist/components/station-monitor/LoadStation.js +274 -31
- package/dist/components/station-monitor/Material.js +71 -11
- package/dist/components/station-monitor/MoveMaterialArrows.js +4 -4
- package/dist/components/station-monitor/QuarantineButton.js +11 -0
- package/dist/components/station-monitor/Queues.js +28 -9
- package/dist/components/station-monitor/QueuesAddMaterial.js +8 -6
- package/dist/components/station-monitor/SelectInspType.js +1 -1
- package/dist/components/station-monitor/SelectWorkorder.js +1 -1
- package/dist/components/station-monitor/StationToolbar.js +17 -5
- package/dist/components/station-monitor/SystemOverview.d.ts +19 -1
- package/dist/components/station-monitor/SystemOverview.js +439 -20
- package/dist/components/station-monitor/Whiteboard.js +15 -7
- package/dist/data/all-material-bins.d.ts +7 -0
- package/dist/data/all-material-bins.js +47 -1
- package/dist/data/cost-per-piece.js +11 -8
- package/dist/data/current-cycles.d.ts +1 -1
- package/dist/data/current-cycles.js +62 -17
- package/dist/data/move-arrows.d.ts +5 -1
- package/dist/data/move-arrows.js +54 -4
- package/dist/data/part-summary.js +13 -13
- package/dist/data/path-lookup.js +6 -23
- package/dist/data/queue-material.d.ts +1 -1
- package/dist/data/queue-material.js +18 -17
- package/dist/data/results.completed-parts.js +4 -3
- package/dist/data/results.cycles.d.ts +15 -6
- package/dist/data/results.cycles.js +51 -30
- package/dist/data/results.inspection.js +11 -6
- package/dist/data/results.oee.js +8 -8
- package/dist/data/results.schedules.js +2 -11
- package/dist/data/tools-programs.js +5 -6
- package/dist/index.html +1 -1
- package/dist/network/api.d.ts +22 -4
- package/dist/network/api.js +40 -5
- package/dist/network/backend-mock.js +15 -8
- package/dist/network/backend.js +3 -3
- package/dist/network/websocket.js +15 -15
- package/dist/util/chart-helpers.d.ts +1 -1
- package/dist/util/chart-helpers.js +14 -8
- package/package.json +29 -31
- package/dist/assets/ProgramHighlight-LvRM40Qr.js +0 -3
- package/dist/assets/index-gAFi3Oss.js +0 -364
|
@@ -60,9 +60,30 @@ import { PromptForQueue } from "./QueuesAddMaterial.js";
|
|
|
60
60
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
61
61
|
import { PrintLabelButton } from "./PrintedLabel.js";
|
|
62
62
|
import { hideNonLoadingMaterialOnLoadStation } from "../../data/queue-material.js";
|
|
63
|
+
import { basketDisplayName, loadStationDisplayName } from "../../cell-status/station-cycles.js";
|
|
64
|
+
function encodeLoadStationRegionIdPart(value) {
|
|
65
|
+
return encodeURIComponent(value.toString());
|
|
66
|
+
}
|
|
67
|
+
function materialColumnTestId(region) {
|
|
68
|
+
switch (region.kind) {
|
|
69
|
+
case "queue":
|
|
70
|
+
return `load-station-queue-${encodeLoadStationRegionIdPart(region.label)}`;
|
|
71
|
+
case "baskets":
|
|
72
|
+
return "load-station-baskets";
|
|
73
|
+
case "free":
|
|
74
|
+
return "load-station-material";
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function isLoadingToDisplayedTarget(mat, pallet, activeBasket) {
|
|
78
|
+
return (mat.action.type === api.ActionType.Loading &&
|
|
79
|
+
((pallet !== undefined && mat.action.loadOntoPalletNum === pallet.palletNum) ||
|
|
80
|
+
(activeBasket !== undefined && mat.action.loadFromBasketId === activeBasket.basketId)));
|
|
81
|
+
}
|
|
63
82
|
function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading) {
|
|
64
83
|
// search for pallet
|
|
65
84
|
let pal;
|
|
85
|
+
let activeBasket;
|
|
86
|
+
const basketsToShow = new Set();
|
|
66
87
|
if (loadNum >= 0) {
|
|
67
88
|
for (const p of Object.values(curSt.pallets)) {
|
|
68
89
|
if (p.currentPalletLocation.loc === api.PalletLocationEnum.LoadUnload &&
|
|
@@ -71,6 +92,16 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
71
92
|
break;
|
|
72
93
|
}
|
|
73
94
|
}
|
|
95
|
+
for (const basket of Object.values(curSt.baskets ?? {})) {
|
|
96
|
+
if (basket.locationNum !== loadNum)
|
|
97
|
+
continue;
|
|
98
|
+
if (basket.location === api.BasketLocationEnum.LoadUnload) {
|
|
99
|
+
activeBasket = basket;
|
|
100
|
+
}
|
|
101
|
+
else if (basket.location === api.BasketLocationEnum.LoadStationStaging) {
|
|
102
|
+
basketsToShow.add(basket.basketId);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
74
105
|
}
|
|
75
106
|
// calculate queues to show, which is all configured queues and any queues with
|
|
76
107
|
// material loading onto the pallet
|
|
@@ -83,6 +114,20 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
83
114
|
m.location.currentQueue) {
|
|
84
115
|
queuesToShow.add(m.location.currentQueue);
|
|
85
116
|
}
|
|
117
|
+
// Loading from basket
|
|
118
|
+
if (m.action.type === api.ActionType.Loading &&
|
|
119
|
+
m.action.loadOntoPalletNum === pal.palletNum &&
|
|
120
|
+
m.action.loadFromBasketId) {
|
|
121
|
+
basketsToShow.add(m.action.loadFromBasketId);
|
|
122
|
+
}
|
|
123
|
+
// Unloading to basket
|
|
124
|
+
if ((m.action.type === api.ActionType.UnloadToInProcess ||
|
|
125
|
+
m.action.type === api.ActionType.UnloadToCompletedMaterial) &&
|
|
126
|
+
m.action.unloadToBasketId &&
|
|
127
|
+
m.location.type === api.LocType.OnPallet &&
|
|
128
|
+
m.location.palletNum === pal.palletNum) {
|
|
129
|
+
basketsToShow.add(m.action.unloadToBasketId);
|
|
130
|
+
}
|
|
86
131
|
if ((m.action.type === api.ActionType.UnloadToInProcess ||
|
|
87
132
|
m.action.type === api.ActionType.UnloadToCompletedMaterial) &&
|
|
88
133
|
m.action.unloadIntoQueue &&
|
|
@@ -92,7 +137,25 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
92
137
|
}
|
|
93
138
|
}
|
|
94
139
|
}
|
|
140
|
+
else if (activeBasket !== undefined) {
|
|
141
|
+
for (const m of curSt.material) {
|
|
142
|
+
if (m.location.type === api.LocType.InBasket &&
|
|
143
|
+
m.location.basketId === activeBasket.basketId &&
|
|
144
|
+
(m.action.type === api.ActionType.UnloadToInProcess ||
|
|
145
|
+
m.action.type === api.ActionType.UnloadToCompletedMaterial) &&
|
|
146
|
+
m.action.unloadIntoQueue) {
|
|
147
|
+
queuesToShow.add(m.action.unloadIntoQueue);
|
|
148
|
+
}
|
|
149
|
+
if (m.location.type === api.LocType.InQueue &&
|
|
150
|
+
m.location.currentQueue &&
|
|
151
|
+
m.action.type === api.ActionType.Loading &&
|
|
152
|
+
m.action.loadFromBasketId === activeBasket.basketId) {
|
|
153
|
+
queuesToShow.add(m.location.currentQueue);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
95
157
|
const queueMat = new Map(LazySeq.of(queuesToShow).map((q) => [q, { mats: [], hiddenCnt: 0 }]));
|
|
158
|
+
const basketMat = new Map(LazySeq.of(basketsToShow).map((b) => [b, { mats: [], hiddenCnt: 0 }]));
|
|
96
159
|
const freeLoading = [];
|
|
97
160
|
let palFaces = OrderedMap.empty();
|
|
98
161
|
let elapsedLoadingTime = null;
|
|
@@ -102,6 +165,9 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
102
165
|
palFaces = palFaces.set(i, []);
|
|
103
166
|
}
|
|
104
167
|
}
|
|
168
|
+
else if (activeBasket) {
|
|
169
|
+
palFaces = palFaces.set(1, []);
|
|
170
|
+
}
|
|
105
171
|
for (const m of curSt.material) {
|
|
106
172
|
if (pal) {
|
|
107
173
|
// if loading onto pallet, set elapsed load time, ensure face exists, and set free loading
|
|
@@ -134,13 +200,33 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
134
200
|
});
|
|
135
201
|
}
|
|
136
202
|
}
|
|
203
|
+
else if (activeBasket) {
|
|
204
|
+
if (isLoadingToDisplayedTarget(m, pal, activeBasket) && m.action.elapsedLoadUnloadTime) {
|
|
205
|
+
elapsedLoadingTime = m.action.elapsedLoadUnloadTime;
|
|
206
|
+
}
|
|
207
|
+
if (m.location.type === api.LocType.InBasket && m.location.basketId === activeBasket.basketId) {
|
|
208
|
+
if ((m.action.type === api.ActionType.UnloadToCompletedMaterial ||
|
|
209
|
+
m.action.type === api.ActionType.UnloadToInProcess) &&
|
|
210
|
+
m.action.elapsedLoadUnloadTime) {
|
|
211
|
+
elapsedLoadingTime = m.action.elapsedLoadUnloadTime;
|
|
212
|
+
}
|
|
213
|
+
palFaces = palFaces.alter(1, (oldMats) => {
|
|
214
|
+
if (oldMats) {
|
|
215
|
+
oldMats.push(m);
|
|
216
|
+
return oldMats;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
return [m];
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
137
224
|
// add all material in the configured queues
|
|
138
225
|
if (m.location.type === api.LocType.InQueue &&
|
|
139
226
|
m.location.currentQueue &&
|
|
140
227
|
queueMat.has(m.location.currentQueue)) {
|
|
141
228
|
const old = queueMat.get(m.location.currentQueue);
|
|
142
|
-
if (hideNonLoading &&
|
|
143
|
-
(m.action.type !== api.ActionType.Loading || m.action.loadOntoPalletNum !== pal?.palletNum)) {
|
|
229
|
+
if (hideNonLoading && !isLoadingToDisplayedTarget(m, pal, activeBasket)) {
|
|
144
230
|
if (old === undefined) {
|
|
145
231
|
queueMat.set(m.location.currentQueue, { mats: [], hiddenCnt: 1 });
|
|
146
232
|
}
|
|
@@ -157,14 +243,39 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
157
243
|
}
|
|
158
244
|
}
|
|
159
245
|
}
|
|
246
|
+
// add all material in baskets
|
|
247
|
+
if (m.location.type === api.LocType.InBasket &&
|
|
248
|
+
m.location.basketId &&
|
|
249
|
+
basketMat.has(m.location.basketId)) {
|
|
250
|
+
const old = basketMat.get(m.location.basketId);
|
|
251
|
+
if (hideNonLoading && !isLoadingToDisplayedTarget(m, pal, activeBasket)) {
|
|
252
|
+
if (old === undefined) {
|
|
253
|
+
basketMat.set(m.location.basketId, { mats: [], hiddenCnt: 1 });
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
old.hiddenCnt += 1;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
if (old === undefined) {
|
|
261
|
+
basketMat.set(m.location.basketId, { mats: [m], hiddenCnt: 0 });
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
old.mats.push(m);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
160
268
|
}
|
|
161
|
-
queueMat.forEach((
|
|
269
|
+
queueMat.forEach((queue) => queue.mats.sort(mkCompareByProperties((mat) => mat.location.queuePosition ?? 0)));
|
|
270
|
+
basketMat.forEach((basket) => basket.mats.sort(mkCompareByProperties((mat) => mat.location.basketSubPosition ?? 0)));
|
|
162
271
|
const matCount = freeLoading.length + palFaces.valuesToAscLazySeq().sumBy((x) => x.length);
|
|
163
272
|
return {
|
|
164
273
|
pallet: pal,
|
|
274
|
+
activeBasket,
|
|
165
275
|
face: palFaces,
|
|
166
276
|
freeLoadingMaterial: freeLoading,
|
|
167
277
|
queues: queueMat,
|
|
278
|
+
baskets: basketMat,
|
|
168
279
|
elapsedLoadingTime,
|
|
169
280
|
fsize: matCount <= 2 ? "x-large" : matCount <= 6 ? "large" : "normal",
|
|
170
281
|
};
|
|
@@ -235,30 +346,100 @@ function ElapsedLoadTime({ elapsedLoadTime }) {
|
|
|
235
346
|
}
|
|
236
347
|
function PalletFace({ data, faceNum }) {
|
|
237
348
|
const face = data.face.get(faceNum);
|
|
238
|
-
|
|
349
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
350
|
+
const basketName = basketDisplayName(fmsInfo.basketName);
|
|
351
|
+
if (!face)
|
|
239
352
|
return null;
|
|
240
|
-
|
|
353
|
+
if (data.activeBasket && !data.pallet) {
|
|
354
|
+
return (_jsxs("div", { "data-testid": "load-station-active-basket", children: [faceNum === 1 ? (_jsxs(Box, { sx: {
|
|
355
|
+
display: "grid",
|
|
356
|
+
gridTemplateColumns: "1fr auto",
|
|
357
|
+
}, children: [_jsxs(Typography, { variant: "h4", children: [basketName, " ", data.activeBasket.basketId] }), _jsx(Box, { sx: {
|
|
358
|
+
justifySelf: "flex-end",
|
|
359
|
+
}, children: _jsx(ElapsedLoadTime, { elapsedLoadTime: data.elapsedLoadingTime }) })] })) : null, _jsx(Box, { sx: {
|
|
360
|
+
ml: "4em",
|
|
361
|
+
mr: "4em",
|
|
362
|
+
}, children: _jsx(MoveMaterialArrowNode, { kind: {
|
|
363
|
+
type: MoveMaterialNodeKindType.BasketZone,
|
|
364
|
+
basketId: data.activeBasket.basketId,
|
|
365
|
+
}, children: _jsx(Box, { sx: {
|
|
366
|
+
display: "flex",
|
|
367
|
+
flexWrap: "wrap",
|
|
368
|
+
justifyContent: "space-around",
|
|
369
|
+
}, children: face.map((m, idx) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: m }, children: _jsx(InProcMaterial, { mat: m, fsize: data.fsize }) }, idx))) }) }) })] }));
|
|
370
|
+
}
|
|
371
|
+
if (!data.pallet)
|
|
372
|
+
return null;
|
|
373
|
+
return (_jsxs("div", { "data-testid": `load-station-pallet-face-${faceNum}`, children: [faceNum === 1 ? (_jsxs(Box, { sx: {
|
|
374
|
+
display: "grid",
|
|
375
|
+
gridTemplateColumns: data.pallet.numFaces > 1 ? "1fr 1fr 1fr" : "1fr 1fr",
|
|
376
|
+
}, children: [_jsxs(Typography, { variant: "h4", children: ["Pallet ", data.pallet.palletNum] }), data.pallet.numFaces > 1 ? (_jsx(Typography, { variant: "h6", sx: {
|
|
377
|
+
justifySelf: "center",
|
|
378
|
+
}, children: data.pallet.faceNames?.[faceNum - 1] ?? "Face 1" })) : undefined, _jsx(Box, { sx: {
|
|
379
|
+
justifySelf: "flex-end",
|
|
380
|
+
}, children: _jsx(ElapsedLoadTime, { elapsedLoadTime: data.elapsedLoadingTime }) })] })) : data.pallet.numFaces > 1 ? (_jsx(Box, { sx: {
|
|
381
|
+
display: "flex",
|
|
382
|
+
justifyContent: "center",
|
|
383
|
+
}, children: _jsx(Typography, { variant: "h6", children: data.pallet.faceNames?.[faceNum - 1] ?? `Face ${faceNum}` }) })) : undefined, _jsx(Box, { sx: {
|
|
384
|
+
ml: "4em",
|
|
385
|
+
mr: "4em",
|
|
386
|
+
}, children: _jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.PalletFaceZone, face: faceNum }, children: _jsx(Box, { sx: {
|
|
387
|
+
display: "flex",
|
|
388
|
+
flexWrap: "wrap",
|
|
389
|
+
justifyContent: "space-around",
|
|
390
|
+
}, children: face.map((m, idx) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: m }, children: _jsx(InProcMaterial, { mat: m, fsize: data.fsize }) }, idx))) }) }) })] }));
|
|
241
391
|
}
|
|
242
392
|
function MaterialRegion({ data, mat, }) {
|
|
243
|
-
return (_jsxs("div", { children: [_jsx(Typography, { variant: "h4", children: mat.label }), mat.material.mats.map((m, matIdx) => (_jsx(MoveMaterialArrowNode, { kind: {
|
|
393
|
+
return (_jsxs("div", { children: [mat.label !== "" ? _jsx(Typography, { variant: "h4", children: mat.label }) : null, mat.material.mats.map((m, matIdx) => (_jsx(MoveMaterialArrowNode, { kind: {
|
|
244
394
|
type: MoveMaterialNodeKindType.Material,
|
|
245
|
-
material:
|
|
246
|
-
}, children: mat.isFree ? (_jsx(InProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, fsize: data.fsize, showRawMaterial: true, showJobComment: true })) : (_jsx(SortableInProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, shake: m.action.type === api.ActionType.Loading &&
|
|
395
|
+
material: m,
|
|
396
|
+
}, children: mat.isFree || mat.sortable === false ? (_jsx(InProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, fsize: data.fsize, showRawMaterial: true, showJobComment: true })) : (_jsx(SortableInProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, shake: m.action.type === api.ActionType.Loading &&
|
|
247
397
|
m.action.loadOntoPalletNum === data.pallet?.palletNum, fsize: m.action.type === api.ActionType.Loading &&
|
|
248
398
|
m.action.loadOntoPalletNum === data.pallet?.palletNum
|
|
249
399
|
? data.fsize
|
|
250
|
-
: undefined, showRawMaterial: true, showJobComment: true })) }, matIdx))), mat.material.hiddenCnt > 0 ? (_jsxs(Typography, { variant: "body2", color: "textSecondary",
|
|
400
|
+
: undefined, showRawMaterial: true, showJobComment: true })) }, matIdx))), mat.material.hiddenCnt > 0 ? (_jsxs(Typography, { variant: "body2", color: "textSecondary", sx: {
|
|
401
|
+
textAlign: "center",
|
|
402
|
+
mt: "0.5em",
|
|
403
|
+
}, children: ["+", mat.material.hiddenCnt, " hidden"] })) : null] }));
|
|
404
|
+
}
|
|
405
|
+
function BasketRegion({ data, label, baskets, }) {
|
|
406
|
+
return (_jsxs("div", { children: [_jsx(Typography, { variant: "h4", children: label }), baskets.map((basket, idx) => (_jsxs(Box, { "data-testid": `load-station-basket-${encodeLoadStationRegionIdPart(basket.basketId)}`, sx: {
|
|
407
|
+
mt: idx === 0 ? "0.5em" : "1.5em",
|
|
408
|
+
pt: idx === 0 ? undefined : "1em",
|
|
409
|
+
}, children: [_jsx(Typography, { variant: "h6", sx: {
|
|
410
|
+
mb: "0.5em",
|
|
411
|
+
}, children: basket.label }), _jsx(MoveMaterialArrowNode, { kind: {
|
|
412
|
+
type: MoveMaterialNodeKindType.BasketZone,
|
|
413
|
+
basketId: basket.basketId,
|
|
414
|
+
}, children: _jsx(MaterialRegion, { data: data, mat: {
|
|
415
|
+
label: "",
|
|
416
|
+
material: basket.material,
|
|
417
|
+
isFree: false,
|
|
418
|
+
sortable: false,
|
|
419
|
+
} }) })] }, basket.basketId)))] }));
|
|
251
420
|
}
|
|
252
421
|
function MaterialColumn({ data, region, }) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
: {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
422
|
+
switch (region.kind) {
|
|
423
|
+
case "free":
|
|
424
|
+
return (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.FreeMaterialZone }, children: _jsx(MaterialRegion, { data: data, mat: {
|
|
425
|
+
label: region.label,
|
|
426
|
+
material: region.material,
|
|
427
|
+
isFree: true,
|
|
428
|
+
sortable: false,
|
|
429
|
+
} }) }));
|
|
430
|
+
case "queue":
|
|
431
|
+
return (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.QueueZone, queue: region.label }, children: _jsx(SortableRegion, { matIds: region.material.mats.map((m) => m.materialID), direction: "vertical", queueName: region.label, renderDragOverlay: (mat) => (_jsx(DragOverlayInProcMaterial, { mat: mat, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, fsize: mat.action.type === api.ActionType.Loading &&
|
|
432
|
+
mat.action.loadOntoPalletNum === data.pallet?.palletNum
|
|
433
|
+
? data.fsize
|
|
434
|
+
: undefined })), children: _jsx(MaterialRegion, { data: data, mat: {
|
|
435
|
+
label: region.label,
|
|
436
|
+
material: region.material,
|
|
437
|
+
isFree: false,
|
|
438
|
+
sortable: true,
|
|
439
|
+
} }) }) }));
|
|
440
|
+
case "baskets":
|
|
441
|
+
return _jsx(BasketRegion, { data: data, label: region.label, baskets: region.baskets });
|
|
442
|
+
}
|
|
262
443
|
}
|
|
263
444
|
function RecentCompletedMaterial() {
|
|
264
445
|
const matSummary = useAtomValue(last30MaterialSummary);
|
|
@@ -280,13 +461,37 @@ const CompletedCol = memo(function CompletedCol({ fillViewPort, showMaterial, })
|
|
|
280
461
|
: MoveMaterialNodeKindType.CompletedCollapsedMaterialZone,
|
|
281
462
|
});
|
|
282
463
|
if (showMaterial && fillViewPort) {
|
|
283
|
-
return (_jsxs(Box, {
|
|
464
|
+
return (_jsxs(Box, { ref: ref, sx: {
|
|
465
|
+
padding: "8px",
|
|
466
|
+
display: "flex",
|
|
467
|
+
flexDirection: "column",
|
|
468
|
+
height: "100%",
|
|
469
|
+
}, children: [_jsx(Typography, { variant: "h4", children: "Completed" }), _jsx(Box, { sx: {
|
|
470
|
+
position: "relative",
|
|
471
|
+
flexGrow: 1,
|
|
472
|
+
}, children: _jsx(Box, { sx: {
|
|
473
|
+
position: "absolute",
|
|
474
|
+
top: "0",
|
|
475
|
+
left: "0",
|
|
476
|
+
right: "0",
|
|
477
|
+
bottom: "0",
|
|
478
|
+
overflow: "auto",
|
|
479
|
+
}, children: _jsx(RecentCompletedMaterial, {}) }) })] }));
|
|
284
480
|
}
|
|
285
481
|
else if (showMaterial) {
|
|
286
|
-
return (_jsxs(Box, {
|
|
482
|
+
return (_jsxs(Box, { ref: ref, sx: {
|
|
483
|
+
padding: "8px",
|
|
484
|
+
}, children: [_jsx(Typography, { variant: "h4", children: "Completed" }), _jsx(RecentCompletedMaterial, {})] }));
|
|
287
485
|
}
|
|
288
486
|
else {
|
|
289
|
-
return (_jsx(Box, {
|
|
487
|
+
return (_jsx(Box, { ref: ref, sx: {
|
|
488
|
+
display: "flex",
|
|
489
|
+
justifyContent: fillViewPort ? "flex-end" : undefined,
|
|
490
|
+
padding: "8px",
|
|
491
|
+
}, children: _jsx(Typography, { variant: "h4", sx: {
|
|
492
|
+
margin: "4px",
|
|
493
|
+
...(fillViewPort ? { textOrientation: "mixed", writingMode: "vertical-rl" } : {}),
|
|
494
|
+
}, children: "Completed" }) }));
|
|
290
495
|
}
|
|
291
496
|
});
|
|
292
497
|
function InstructionButton({ pallet }) {
|
|
@@ -340,7 +545,7 @@ function AddMatButton({ queues, onClose, toQueue, showAddToQueue, setShowAddToQu
|
|
|
340
545
|
return (_jsx(Button, { color: "primary", onClick: () => setShowAddToQueue(true), children: "Add To Queue" }));
|
|
341
546
|
}
|
|
342
547
|
else {
|
|
343
|
-
return (_jsxs(Button, { color: "primary", disabled: toQueue === null || addingExistingMat
|
|
548
|
+
return (_jsxs(Button, { color: "primary", disabled: toQueue === null || addingExistingMat, onClick: () => {
|
|
344
549
|
addExistingMat({
|
|
345
550
|
materialId: existingMat.materialID,
|
|
346
551
|
queue: toQueue ?? "",
|
|
@@ -415,24 +620,46 @@ function useGridLayout({ numMatCols, maxNumFaces, horizontal, showMatInCompleted
|
|
|
415
620
|
return `${rows} / ${cols}`;
|
|
416
621
|
}
|
|
417
622
|
export function LoadStation(props) {
|
|
623
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
624
|
+
const basketName = basketDisplayName(fmsInfo.basketName);
|
|
625
|
+
const basketRegionLabel = basketName.endsWith("s") ? basketName : `${basketName}s`;
|
|
418
626
|
const currentSt = useAtomValue(currentStatus);
|
|
419
627
|
const hideNonLoading = useAtomValue(hideNonLoadingMaterialOnLoadStation);
|
|
420
628
|
const data = useMemo(() => selectLoadStationAndQueueProps(props.loadNum, props.queues, currentSt, hideNonLoading), [currentSt, props.loadNum, props.queues, hideNonLoading]);
|
|
421
|
-
|
|
629
|
+
const queueCols = LazySeq.of(data.queues)
|
|
422
630
|
.sortBy(([q, _]) => q)
|
|
423
631
|
.map(([q, mats]) => ({
|
|
632
|
+
kind: "queue",
|
|
424
633
|
label: q,
|
|
425
634
|
material: mats,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
635
|
+
}))
|
|
636
|
+
.toRArray();
|
|
637
|
+
const matCols = [...queueCols];
|
|
638
|
+
if (data.baskets.size > 0) {
|
|
639
|
+
const baskets = LazySeq.of(data.baskets)
|
|
640
|
+
.filter(([b, _]) => b !== data.activeBasket?.basketId)
|
|
641
|
+
.sortBy(([b, _]) => b)
|
|
642
|
+
.map(([b, mats]) => ({
|
|
643
|
+
basketId: b,
|
|
644
|
+
label: `${basketName} ${b}`,
|
|
645
|
+
material: mats,
|
|
646
|
+
}))
|
|
647
|
+
.toRArray();
|
|
648
|
+
if (baskets.length > 0) {
|
|
649
|
+
matCols.push({
|
|
650
|
+
kind: "baskets",
|
|
651
|
+
label: basketRegionLabel,
|
|
652
|
+
baskets,
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
if ((data.queues.size === 0 && data.baskets.size === 0) || data.freeLoadingMaterial.length > 0) {
|
|
657
|
+
matCols.push({
|
|
658
|
+
kind: "free",
|
|
430
659
|
label: "Material",
|
|
431
660
|
material: { mats: data.freeLoadingMaterial, hiddenCnt: 0 },
|
|
432
|
-
isFree: true,
|
|
433
661
|
});
|
|
434
662
|
}
|
|
435
|
-
const matCols = matColsSeq.toRArray();
|
|
436
663
|
const numNonPalCols = matCols.length + (props.completed ? 1 : 0);
|
|
437
664
|
const fillViewPort = useMediaQuery(numNonPalCols <= 1
|
|
438
665
|
? "(min-width: 720px)"
|
|
@@ -455,10 +682,26 @@ export function LoadStation(props) {
|
|
|
455
682
|
md: "calc(100vh - 64px)",
|
|
456
683
|
},
|
|
457
684
|
padding: fillViewPort ? undefined : "8px",
|
|
458
|
-
}, children: [matCols.map((col, idx) => (_jsx(Box, {
|
|
685
|
+
}, children: [matCols.map((col, idx) => (_jsx(Box, { "data-testid": materialColumnTestId(col), sx: {
|
|
686
|
+
gridArea: `mat${idx}`,
|
|
687
|
+
padding: "8px",
|
|
688
|
+
borderRight: fillViewPort ? "1px solid black" : undefined,
|
|
689
|
+
borderBottom: !fillViewPort ? "1px solid black" : undefined,
|
|
690
|
+
}, children: _jsx(MaterialColumn, { data: data, region: col }) }, idx))), data.face.keysToAscLazySeq().map((faceNum, idx) => (_jsx(Box, { sx: {
|
|
691
|
+
marginLeft: "15px",
|
|
692
|
+
gridArea: `palface${idx}`,
|
|
693
|
+
padding: "8px",
|
|
694
|
+
borderTop: data.pallet && idx !== 0 ? "1px solid black" : undefined,
|
|
695
|
+
}, children: _jsx(PalletFace, { data: data, faceNum: faceNum }) }, faceNum))), _jsx(Box, { "data-testid": "load-station-completed", sx: {
|
|
696
|
+
borderLeft: fillViewPort ? "1px solid black" : undefined,
|
|
697
|
+
borderTop: !fillViewPort ? "1px solid black" : undefined,
|
|
698
|
+
gridArea: "completed",
|
|
699
|
+
}, children: _jsx(CompletedCol, { fillViewPort: fillViewPort, showMaterial: props.completed }) }), _jsx(MultiInstructionButton, { loadData: data }), _jsx(SelectWorkorderDialog, {}), _jsx(SelectInspTypeDialog, {}), _jsx(LoadMatDialog, { pallet: data.pallet?.palletNum ?? null, queues: props.queues })] }) }));
|
|
459
700
|
}
|
|
460
701
|
function LoadStationCheckWidth(props) {
|
|
461
|
-
|
|
702
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
703
|
+
const title = loadStationDisplayName(props.loadNum, fmsInfo.loadStationNames);
|
|
704
|
+
useSetTitle(title);
|
|
462
705
|
return _jsx(LoadStation, { ...props });
|
|
463
706
|
}
|
|
464
707
|
export default LoadStationCheckWidth;
|
|
@@ -46,8 +46,9 @@ import { DisplayLoadingAndError } from "../ErrorsAndLoading.js";
|
|
|
46
46
|
import { ErrorBoundary } from "react-error-boundary";
|
|
47
47
|
import { currentStatus } from "../../cell-status/current-status.js";
|
|
48
48
|
import { useAtom, useAtomValue, useSetAtom } from "jotai";
|
|
49
|
-
import { loadable } from "jotai/utils";
|
|
50
49
|
import { last30Rebookings } from "../../cell-status/rebookings.js";
|
|
50
|
+
import { fmsInformation } from "../../network/server-settings.js";
|
|
51
|
+
import { basketDisplayName } from "../../cell-status/station-cycles.js";
|
|
51
52
|
export class PartIdenticon extends PureComponent {
|
|
52
53
|
render() {
|
|
53
54
|
const iconSize = this.props.size || 50;
|
|
@@ -66,13 +67,18 @@ const shakeHorizKeyframes = keyframes `
|
|
|
66
67
|
60% { transform: translate(0, 0) }
|
|
67
68
|
`;
|
|
68
69
|
const shakeHorizAnimation = `${shakeHorizKeyframes} 1s ease-in-out infinite`;
|
|
70
|
+
function isCssAnimation(animation) {
|
|
71
|
+
return "animationName" in animation;
|
|
72
|
+
}
|
|
69
73
|
// global sync of all shake animations
|
|
70
74
|
// the start time can drift due to the pause on hover, so to keep it in sync always
|
|
71
75
|
// round the start time down to be a multiple of the duration (1s)
|
|
72
76
|
function shakeAnimationIteration(event) {
|
|
73
77
|
const anim = event.currentTarget
|
|
74
78
|
.getAnimations()
|
|
75
|
-
.find((
|
|
79
|
+
.find((animation) => {
|
|
80
|
+
return isCssAnimation(animation) && animation.animationName === shakeHorizKeyframes.name;
|
|
81
|
+
});
|
|
76
82
|
if (anim && typeof anim.startTime === "number") {
|
|
77
83
|
anim.startTime = anim.startTime - (anim.startTime % 1000);
|
|
78
84
|
}
|
|
@@ -158,8 +164,29 @@ const MatCardDetail = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
158
164
|
});
|
|
159
165
|
export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
160
166
|
const curSt = useAtomValue(currentStatus);
|
|
167
|
+
const fmsInfo = useAtomValue(fmsInformation);
|
|
168
|
+
const basketName = basketDisplayName(fmsInfo.basketName);
|
|
161
169
|
switch (mat.action.type) {
|
|
162
170
|
case api.ActionType.Loading:
|
|
171
|
+
// Check if loading from basket
|
|
172
|
+
if (mat.action.loadFromBasketId) {
|
|
173
|
+
if (mat.action.loadOntoPalletNum === null || mat.action.loadOntoPalletNum === undefined) {
|
|
174
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load into ", basketName, " ", mat.action.loadFromBasketId] }));
|
|
175
|
+
}
|
|
176
|
+
else if (displayActionForSinglePallet === undefined) {
|
|
177
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load from ", basketName, " ", mat.action.loadFromBasketId, " to pal ", mat.action.loadOntoPalletNum ?? ""] }));
|
|
178
|
+
}
|
|
179
|
+
else if (displayActionForSinglePallet === mat.action.loadOntoPalletNum) {
|
|
180
|
+
const faceNum = mat.action.loadOntoFace ?? 0;
|
|
181
|
+
const faceName = mat.action.loadOntoPalletNum
|
|
182
|
+
? curSt.pallets[mat.action.loadOntoPalletNum]?.faceNames?.[faceNum - 1]
|
|
183
|
+
: null;
|
|
184
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load from ", basketName, " ", mat.action.loadFromBasketId, " to ", faceName ?? `face ${faceNum}`] }));
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
163
190
|
switch (mat.location.type) {
|
|
164
191
|
case api.LocType.OnPallet:
|
|
165
192
|
if (displayActionForSinglePallet === undefined ||
|
|
@@ -202,7 +229,12 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
202
229
|
}
|
|
203
230
|
case api.ActionType.UnloadToInProcess:
|
|
204
231
|
case api.ActionType.UnloadToCompletedMaterial:
|
|
205
|
-
if (mat.action.
|
|
232
|
+
if (mat.action.unloadToBasketId) {
|
|
233
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload to ", basketName, " ", mat.action.unloadToBasketId, mat.action.unloadToBasketSubPosition
|
|
234
|
+
? ` position ${mat.action.unloadToBasketSubPosition + 1}`
|
|
235
|
+
: ""] }));
|
|
236
|
+
}
|
|
237
|
+
else if (mat.action.unloadIntoQueue) {
|
|
206
238
|
return _jsxs(MatCardDetail, { fsize: fsize, children: ["Unload into queue ", mat.action.unloadIntoQueue] });
|
|
207
239
|
}
|
|
208
240
|
else {
|
|
@@ -212,6 +244,9 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
212
244
|
if (mat.location.type === api.LocType.InQueue && !!mat.jobUnique && mat.jobUnique !== "") {
|
|
213
245
|
return _jsxs(MatCardDetail, { fsize: fsize, children: ["Waiting; next process is #", mat.process + 1] });
|
|
214
246
|
}
|
|
247
|
+
else if (mat.location.type === api.LocType.InBasket) {
|
|
248
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["In ", basketName, " ", mat.location.basketId] }));
|
|
249
|
+
}
|
|
215
250
|
else if (mat.location.type === api.LocType.OnPallet &&
|
|
216
251
|
(mat.lastCompletedMachiningRouteStopIndex === null ||
|
|
217
252
|
mat.lastCompletedMachiningRouteStopIndex === undefined)) {
|
|
@@ -310,14 +345,29 @@ const MatCard = forwardRef(function MatCard(props, ref) {
|
|
|
310
345
|
touchAction: "none",
|
|
311
346
|
}, ...props.dragHandleProps, children: _jsx(DragIndicator, { fontSize: "large", color: "action" }) })) : undefined, _jsx(ButtonBase, { focusRipple: true, sx: { width: "100%" }, onClick: () => setMatToShow(props.inProcMat
|
|
312
347
|
? { type: "InProcMat", inproc: props.inProcMat }
|
|
313
|
-
: { type: "MatSummary", summary: props.mat }), children: _jsxs(Box, {
|
|
348
|
+
: { type: "MatSummary", summary: props.mat }), children: _jsxs(Box, { sx: {
|
|
349
|
+
display: "flex",
|
|
350
|
+
textAlign: "left",
|
|
351
|
+
alignItems: "center",
|
|
352
|
+
width: "100%",
|
|
353
|
+
}, children: [_jsx(PartIdenticon, { part: props.mat.partName }), _jsxs(Box, { sx: {
|
|
354
|
+
marginLeft: "8px",
|
|
355
|
+
flexGrow: 1,
|
|
356
|
+
}, children: [_jsx(MatCardHeader, { fsize: props.fsize, children: props.mat.partName }), props.displayJob ? (_jsx(MatCardDetail, { fsize: props.fsize, children: props.mat.jobUnique && props.mat.jobUnique !== ""
|
|
314
357
|
? "Assigned to " + props.mat.jobUnique
|
|
315
358
|
: "Unassigned material" })) : undefined, !props.hideEmptySerial || props.mat.serial ? (_jsxs(MatCardDetail, { fsize: props.fsize, children: ["Serial: ", props.mat.serial ? props.mat.serial : "none"] })) : undefined, props.mat.workorderId === undefined ||
|
|
316
359
|
props.mat.workorderId === "" ||
|
|
317
360
|
props.mat.workorderId === props.mat.serial ? undefined : (_jsxs(MatCardDetail, { fsize: props.fsize, children: ["Workorder: ", props.mat.workorderId] })), props.mat.jobUnique !== undefined &&
|
|
318
361
|
props.showRawMaterial &&
|
|
319
362
|
props.inProcMat &&
|
|
320
|
-
props.inProcMat.process === 0 ? (_jsx(JobRawMaterial, { fsize: props.fsize, mat: props.inProcMat })) : undefined, props.showJobComment && props.mat.jobUnique && props.mat.jobUnique !== "" ? (_jsx(RebookingNoteElipsis, { fsize: props.fsize, uniq: props.mat.jobUnique })) : undefined, props.inProcMat ? (_jsx(MaterialAction, { mat: props.inProcMat, displayActionForSinglePallet: props.displayActionForSinglePallet, fsize: props.fsize })) : undefined,
|
|
363
|
+
props.inProcMat.process === 0 ? (_jsx(JobRawMaterial, { fsize: props.fsize, mat: props.inProcMat })) : undefined, props.showJobComment && props.mat.jobUnique && props.mat.jobUnique !== "" ? (_jsx(RebookingNoteElipsis, { fsize: props.fsize, uniq: props.mat.jobUnique })) : undefined, props.inProcMat ? (_jsx(MaterialAction, { mat: props.inProcMat, displayActionForSinglePallet: props.displayActionForSinglePallet, fsize: props.fsize })) : undefined, props.inProcMat?.problem ? (_jsx(MatCardDetail, { fsize: props.fsize, children: _jsxs(Typography, { variant: "body2", color: "error", sx: { fontWeight: "bold" }, children: ["\u26A0 ", props.inProcMat.problem] }) })) : undefined, completedMsg] }), _jsxs(Box, { sx: {
|
|
364
|
+
marginLeft: "4px",
|
|
365
|
+
display: "flex",
|
|
366
|
+
flexDirection: "column",
|
|
367
|
+
justifyContent: "space-between",
|
|
368
|
+
alignItems: "flex-end",
|
|
369
|
+
alignSelf: "start",
|
|
370
|
+
}, children: [props.mat.serial && props.mat.serial.length >= 1 && !props.hideAvatar ? (_jsx("div", { children: _jsx(Avatar, { style: { width: "30px", height: "30px" }, children: props.mat.serial.slice(-1) }) })) : undefined, props.hideWarningIcon ? undefined : (_jsx("div", { children: _jsx(Warning, { mat: props.mat }) }))] })] }) })] }));
|
|
321
371
|
});
|
|
322
372
|
export const MatSummary = memo(MatCard);
|
|
323
373
|
export const InProcMaterial = memo(function InProcMaterial(props) {
|
|
@@ -349,7 +399,13 @@ export function DragOverlayInProcMaterial(props) {
|
|
|
349
399
|
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, showDragHandle: true, hideAvatar: props.hideAvatar, displayJob: props.displayJob, fsize: props.fsize, hideEmptySerial: props.hideEmptySerial, isDragOverlay: true }));
|
|
350
400
|
}
|
|
351
401
|
export const MultiMaterial = memo(function MultiMaterial(props) {
|
|
352
|
-
return (_jsx(Paper, { elevation: 4, sx: { display: "flex", minWidth: "10em", padding: "8px", margin: "8px" }, children: _jsx(Badge, { badgeContent: props.material.length < 2 ? 0 : props.material.length, color: "secondary", children: _jsx(ButtonBase, { focusRipple: true, onClick: () => props.onOpen(), children: _jsxs(Box, {
|
|
402
|
+
return (_jsx(Paper, { elevation: 4, sx: { display: "flex", minWidth: "10em", padding: "8px", margin: "8px" }, children: _jsx(Badge, { badgeContent: props.material.length < 2 ? 0 : props.material.length, color: "secondary", children: _jsx(ButtonBase, { focusRipple: true, onClick: () => props.onOpen(), children: _jsxs(Box, { sx: {
|
|
403
|
+
display: "flex",
|
|
404
|
+
textAlign: "left",
|
|
405
|
+
}, children: [_jsx(PartIdenticon, { part: props.partOrCasting }), _jsxs(Box, { sx: {
|
|
406
|
+
marginLeft: "8px",
|
|
407
|
+
flexGrow: 1,
|
|
408
|
+
}, children: [_jsx(Typography, { variant: "h6", children: props.partOrCasting }), _jsx(MatCardDetail, { fsize: props.fsize, children: props.assignedJobUnique && props.assignedJobUnique !== ""
|
|
353
409
|
? "Assigned to " + props.assignedJobUnique
|
|
354
410
|
: "Unassigned material" })] }), props.material.length > 0 && props.material[0].serial && props.material[0].serial.length >= 1 ? (_jsx("div", { children: _jsx(Avatar, { style: { width: "30px", height: "30px" }, children: props.material[0].serial.slice(-1) }) })) : undefined] }) }) }) }));
|
|
355
411
|
});
|
|
@@ -374,13 +430,17 @@ export const MaterialDetailTitle = memo(function MaterialDetailTitle({ partName,
|
|
|
374
430
|
title = partName + " - " + serial;
|
|
375
431
|
}
|
|
376
432
|
}
|
|
377
|
-
return (_jsxs(Box, {
|
|
433
|
+
return (_jsxs(Box, { sx: {
|
|
434
|
+
display: "flex",
|
|
435
|
+
textAlign: "left",
|
|
436
|
+
}, children: [partName === "" ? _jsx(SearchIcon, {}) : _jsx(PartIdenticon, { part: partName }), _jsxs(Box, { sx: {
|
|
437
|
+
marginLeft: "8px",
|
|
438
|
+
flexGrow: 1,
|
|
439
|
+
}, children: [_jsx(Typography, { variant: "h6", children: title }), subtitle ? _jsx(Typography, { variant: "caption", children: subtitle }) : undefined] })] }));
|
|
378
440
|
});
|
|
379
441
|
function MaterialDialogTitle({ notes }) {
|
|
380
|
-
const
|
|
381
|
-
const
|
|
382
|
-
const mat = matL.state === "hasData" ? matL.data : null;
|
|
383
|
-
const serial = serialL.state === "hasData" ? serialL.data : null;
|
|
442
|
+
const mat = useAtomValue(matDetails.materialInDialogInfoUnwrapped);
|
|
443
|
+
const serial = useAtomValue(matDetails.serialInMaterialDialogUnwrapped);
|
|
384
444
|
return _jsx(MaterialDetailTitle, { notes: notes, partName: mat?.partName ?? "", serial: mat?.serial ?? serial });
|
|
385
445
|
}
|
|
386
446
|
function MaterialInspections() {
|
|
@@ -74,7 +74,7 @@ const MoveMaterialArrows = memo(function MoveMaterialArrows({ container, arrowsW
|
|
|
74
74
|
const MoveMaterialArrowCtx = createContext(undefined);
|
|
75
75
|
export const MoveMaterialArrowContainer = memo(function MoveMaterialArrowContainer({ children, hideArrows, whiteBackground, }) {
|
|
76
76
|
const container = useRef(null);
|
|
77
|
-
const [
|
|
77
|
+
const [registeredNodes, setNodes] = useState(HashMap.empty());
|
|
78
78
|
const ctx = useMemo(() => {
|
|
79
79
|
return {
|
|
80
80
|
registerNode(id, kind, ref) {
|
|
@@ -82,7 +82,7 @@ export const MoveMaterialArrowContainer = memo(function MoveMaterialArrowContain
|
|
|
82
82
|
setNodes((ns) => ns.set(id, { ...kind, elem: ref }));
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
setNodes((
|
|
85
|
+
setNodes((currentNodes) => currentNodes.delete(id));
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
};
|
|
@@ -96,7 +96,7 @@ export const MoveMaterialArrowContainer = memo(function MoveMaterialArrowContain
|
|
|
96
96
|
right: 0,
|
|
97
97
|
zIndex: -1,
|
|
98
98
|
backgroundColor: whiteBackground ? "white" : "#F8F8F8",
|
|
99
|
-
}, children: [_jsx("defs", { children: _jsx("marker", { id: "arrow", markerWidth: 6, markerHeight: 10, refX: "0", refY: "3", orient: "auto", markerUnits: "strokeWidth", children: _jsx("path", { d: "M0,0 L0,6 L5,3 z", fill: "rgba(0,0,0,0.15)" }) }) }), !hideArrows ? _jsx(MoveMaterialArrows, { container: container, arrowsWithRefs:
|
|
99
|
+
}, children: [_jsx("defs", { children: _jsx("marker", { id: "arrow", markerWidth: 6, markerHeight: 10, refX: "0", refY: "3", orient: "auto", markerUnits: "strokeWidth", children: _jsx("path", { d: "M0,0 L0,6 L5,3 z", fill: "rgba(0,0,0,0.15)" }) }) }), !hideArrows ? (_jsx(MoveMaterialArrows, { container: container, arrowsWithRefs: registeredNodes })) : undefined] }), _jsx("div", { ref: container, children: _jsx(MoveMaterialArrowCtx.Provider, { value: ctx, children: children }) })] }));
|
|
100
100
|
});
|
|
101
101
|
export function useMoveMaterialArrowRef(kind) {
|
|
102
102
|
const ctx = useContext(MoveMaterialArrowCtx);
|
|
@@ -110,7 +110,7 @@ export function useMoveMaterialArrowRef(kind) {
|
|
|
110
110
|
return () => {
|
|
111
111
|
ctx.registerNode(id, null, null);
|
|
112
112
|
};
|
|
113
|
-
//
|
|
113
|
+
// oxlint-disable-next-line react/exhaustive-deps
|
|
114
114
|
}, [ctx, ...memoPropsForNodeKind(kind)]);
|
|
115
115
|
return ref;
|
|
116
116
|
}
|