@seedtactics/insight-client 17.0.1-beta.13 → 17.0.1-beta.15
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/README.md +5 -4
- package/dist/assets/index-Z6GAS_qc.js +367 -0
- package/dist/cell-status/loading.d.ts +7 -0
- package/dist/cell-status/loading.js +25 -0
- package/dist/components/App.d.ts +0 -5
- package/dist/components/App.js +1 -1
- package/dist/components/operations/AllMaterial.js +9 -12
- package/dist/components/station-monitor/BasketLoadStationWork.d.ts +1 -7
- package/dist/components/station-monitor/BasketLoadStationWork.js +11 -7
- package/dist/components/station-monitor/InvalidateCycle.js +21 -17
- package/dist/components/station-monitor/LoadStation.d.ts +0 -5
- package/dist/components/station-monitor/LoadStation.js +29 -69
- package/dist/components/station-monitor/Material.js +4 -2
- package/dist/components/station-monitor/QuarantineButton.js +17 -26
- package/dist/components/station-monitor/Whiteboard.js +14 -15
- package/dist/data/material-operation-policy.d.ts +6 -0
- package/dist/data/material-operation-policy.js +26 -2
- package/dist/extension.d.ts +0 -1
- package/dist/index.html +1 -1
- package/dist/index.js +1 -6
- package/dist/network/api.d.ts +16 -34
- package/dist/network/api.js +64 -64
- package/dist/network/backend-mock.js +3 -0
- package/dist/network/backend.d.ts +1 -0
- package/docs/material-quarantine.md +5 -4
- package/docs/mazak.md +9 -12
- package/docs/operator-procedures.md +14 -0
- package/package.json +9 -4
- package/dist/assets/index-Dxxgr-QV.js +0 -367
- package/dist/components/station-monitor/BasketMovementArrival.d.ts +0 -40
- package/dist/components/station-monitor/BasketMovementArrival.js +0 -165
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as api from "../../network/api.js";
|
|
2
|
-
export interface BasketMovementCompletionCommand {
|
|
3
|
-
readonly commandId: string;
|
|
4
|
-
readonly instructionId: string;
|
|
5
|
-
readonly observedBasketId: number;
|
|
6
|
-
}
|
|
7
|
-
export interface BasketMovementCompletionReceipt {
|
|
8
|
-
readonly stationNumber: number;
|
|
9
|
-
readonly instructionId: string;
|
|
10
|
-
readonly observationId: string;
|
|
11
|
-
readonly observedBasketId: number;
|
|
12
|
-
}
|
|
13
|
-
export type SubmitBasketMovementCompletion = (stationNumber: number, command: BasketMovementCompletionCommand) => Promise<BasketMovementCompletionReceipt | "conflict">;
|
|
14
|
-
export interface BasketLocationCorrectionCommand {
|
|
15
|
-
readonly correctionId: string;
|
|
16
|
-
readonly targetObservationId: string;
|
|
17
|
-
readonly replacementBasketId: number | null;
|
|
18
|
-
readonly replacementObservationId: string | null;
|
|
19
|
-
}
|
|
20
|
-
export type SubmitBasketLocationCorrection = (stationNumber: number, command: BasketLocationCorrectionCommand) => Promise<"accepted" | "conflict">;
|
|
21
|
-
export interface BasketArrivalReceipt {
|
|
22
|
-
readonly stationNumber: number;
|
|
23
|
-
readonly instruction: Readonly<api.IBasketMoveInstruction>;
|
|
24
|
-
readonly command: BasketMovementCompletionCommand;
|
|
25
|
-
readonly receipt: BasketMovementCompletionReceipt;
|
|
26
|
-
readonly status: "recorded" | "corrected" | "retracted";
|
|
27
|
-
}
|
|
28
|
-
export declare function loadStationArrivalInstruction(instructions: ReadonlyArray<Readonly<api.IBasketMoveInstruction>>, stationNumber: number): Readonly<api.IBasketMoveInstruction> | undefined;
|
|
29
|
-
interface BasketMovementArrivalProps {
|
|
30
|
-
readonly stationNumber: number;
|
|
31
|
-
readonly basketName: string;
|
|
32
|
-
readonly instruction: Readonly<api.IBasketMoveInstruction>;
|
|
33
|
-
readonly submitCommand: SubmitBasketMovementCompletion | undefined;
|
|
34
|
-
readonly submitCorrection: SubmitBasketLocationCorrection | undefined;
|
|
35
|
-
readonly receipt?: BasketArrivalReceipt;
|
|
36
|
-
readonly onAccepted?: (receipt: BasketArrivalReceipt) => void;
|
|
37
|
-
readonly onCorrected?: (command: BasketLocationCorrectionCommand) => void;
|
|
38
|
-
}
|
|
39
|
-
export declare function BasketMovementArrival(props: BasketMovementArrivalProps): import("react").JSX.Element;
|
|
40
|
-
export {};
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/* Copyright (c) 2026, John Lenz
|
|
3
|
-
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
* Redistributions of source code must retain the above copyright
|
|
10
|
-
notice, this list of conditions and the following disclaimer.
|
|
11
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
12
|
-
notice, this list of conditions and the following disclaimer in the
|
|
13
|
-
documentation and/or other materials provided with the distribution.
|
|
14
|
-
* Neither the name of John Lenz, Black Maple Software, SeedTactics,
|
|
15
|
-
nor the names of other contributors may be used to endorse or
|
|
16
|
-
promote products derived from this software without specific
|
|
17
|
-
prior written permission.
|
|
18
|
-
|
|
19
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
20
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
21
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
22
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
23
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
24
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
25
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
26
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
27
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/
|
|
31
|
-
import { useEffect, useRef, useState } from "react";
|
|
32
|
-
import { Alert, Box, Button, Paper, Stack, TextField, Typography } from "@mui/material";
|
|
33
|
-
import * as api from "../../network/api.js";
|
|
34
|
-
export function loadStationArrivalInstruction(instructions, stationNumber) {
|
|
35
|
-
const activeIds = new Set(instructions.map((instruction) => instruction.instructionId));
|
|
36
|
-
return instructions.find((instruction) => instruction.basketId !== undefined &&
|
|
37
|
-
instruction.destination.location === api.BasketLocationEnum.LoadUnload &&
|
|
38
|
-
instruction.destination.locationNum === stationNumber &&
|
|
39
|
-
(instruction.prerequisiteInstructionId === undefined ||
|
|
40
|
-
!activeIds.has(instruction.prerequisiteInstructionId)));
|
|
41
|
-
}
|
|
42
|
-
function basketMovementArrivalKey({ stationNumber, instruction, receipt, }) {
|
|
43
|
-
return [
|
|
44
|
-
stationNumber,
|
|
45
|
-
instruction.instructionId,
|
|
46
|
-
receipt?.status ?? "pending",
|
|
47
|
-
receipt?.receipt.observationId ?? "",
|
|
48
|
-
].join(":");
|
|
49
|
-
}
|
|
50
|
-
export function BasketMovementArrival(props) {
|
|
51
|
-
return _jsx(BasketMovementArrivalContent, { ...props }, basketMovementArrivalKey(props));
|
|
52
|
-
}
|
|
53
|
-
function BasketMovementArrivalContent({ stationNumber, basketName, instruction, submitCommand, submitCorrection, receipt, onAccepted, onCorrected, }) {
|
|
54
|
-
const mounted = useRef(true);
|
|
55
|
-
const [chooseDifferent, setChooseDifferent] = useState(false);
|
|
56
|
-
const [differentBasket, setDifferentBasket] = useState("");
|
|
57
|
-
const [submission, setSubmission] = useState();
|
|
58
|
-
const [changingRecordedBasket, setChangingRecordedBasket] = useState(false);
|
|
59
|
-
const [correctionSubmission, setCorrectionSubmission] = useState();
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
mounted.current = true;
|
|
62
|
-
return () => {
|
|
63
|
-
mounted.current = false;
|
|
64
|
-
};
|
|
65
|
-
}, []);
|
|
66
|
-
const expectedBasketId = instruction.basketId;
|
|
67
|
-
if (expectedBasketId === undefined) {
|
|
68
|
-
return (_jsx(Alert, { severity: "warning", children: "This tracked basket must be handled through the recovery workflow." }));
|
|
69
|
-
}
|
|
70
|
-
async function record(command) {
|
|
71
|
-
if (submitCommand === undefined)
|
|
72
|
-
return;
|
|
73
|
-
setSubmission({ state: "submitting", command });
|
|
74
|
-
try {
|
|
75
|
-
const result = await submitCommand(stationNumber, command);
|
|
76
|
-
if (!mounted.current)
|
|
77
|
-
return;
|
|
78
|
-
if (result === "conflict") {
|
|
79
|
-
setSubmission({ state: result, command });
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
setSubmission({ state: "accepted", command, receipt: result });
|
|
83
|
-
onAccepted?.({
|
|
84
|
-
stationNumber,
|
|
85
|
-
instruction,
|
|
86
|
-
command,
|
|
87
|
-
receipt: result,
|
|
88
|
-
status: "recorded",
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
if (!mounted.current)
|
|
94
|
-
return;
|
|
95
|
-
setSubmission({
|
|
96
|
-
state: "error",
|
|
97
|
-
command,
|
|
98
|
-
message: error instanceof Error ? error.message : "Unable to record basket arrival",
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
async function correct(command) {
|
|
103
|
-
if (submitCorrection === undefined || activeCommand === undefined)
|
|
104
|
-
return;
|
|
105
|
-
setCorrectionSubmission({ state: "submitting", command });
|
|
106
|
-
try {
|
|
107
|
-
const result = await submitCorrection(stationNumber, command);
|
|
108
|
-
if (!mounted.current)
|
|
109
|
-
return;
|
|
110
|
-
setCorrectionSubmission({ state: result, command });
|
|
111
|
-
if (result === "accepted")
|
|
112
|
-
onCorrected?.(command);
|
|
113
|
-
}
|
|
114
|
-
catch {
|
|
115
|
-
if (!mounted.current)
|
|
116
|
-
return;
|
|
117
|
-
setCorrectionSubmission({ state: "error", command });
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function createCommand(basketId) {
|
|
121
|
-
return {
|
|
122
|
-
commandId: crypto.randomUUID(),
|
|
123
|
-
instructionId: instruction.instructionId,
|
|
124
|
-
observedBasketId: basketId,
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const parsedDifferentBasket = Number(differentBasket);
|
|
128
|
-
const activeCommand = receipt?.status === "retracted"
|
|
129
|
-
? undefined
|
|
130
|
-
: (receipt?.command ??
|
|
131
|
-
(submission?.state === "accepted" &&
|
|
132
|
-
submission.command.instructionId === instruction.instructionId
|
|
133
|
-
? submission.command
|
|
134
|
-
: undefined));
|
|
135
|
-
const activeObservationId = receipt?.status === "retracted"
|
|
136
|
-
? undefined
|
|
137
|
-
: (receipt?.receipt.observationId ??
|
|
138
|
-
(submission?.state === "accepted" ? submission.receipt.observationId : undefined));
|
|
139
|
-
function createCorrection(replacementBasketId) {
|
|
140
|
-
return {
|
|
141
|
-
correctionId: crypto.randomUUID(),
|
|
142
|
-
targetObservationId: activeObservationId ?? "",
|
|
143
|
-
replacementBasketId,
|
|
144
|
-
replacementObservationId: replacementBasketId === null ? null : crypto.randomUUID(),
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
const validDifferentBasket = Number.isInteger(parsedDifferentBasket) &&
|
|
148
|
-
parsedDifferentBasket > 0 &&
|
|
149
|
-
parsedDifferentBasket !== (activeCommand?.observedBasketId ?? expectedBasketId);
|
|
150
|
-
const disabled = submitCommand === undefined ||
|
|
151
|
-
activeCommand !== undefined ||
|
|
152
|
-
(submission !== undefined && submission.state !== "error");
|
|
153
|
-
const receiptMessage = receipt?.status === "retracted"
|
|
154
|
-
? "Arrival observation retracted."
|
|
155
|
-
: receipt?.status === "corrected"
|
|
156
|
-
? `Arrival corrected to ${basketName.toLocaleLowerCase()} ${receipt.command.observedBasketId}.`
|
|
157
|
-
: "Arrival recorded. Waiting for updated status.";
|
|
158
|
-
return (_jsx(Paper, { component: "section", elevation: 2, sx: { margin: 1, padding: 2 }, children: _jsxs(Stack, { spacing: 2, children: [_jsxs(Box, { children: [_jsx(Typography, { variant: "overline", children: receipt === undefined ? "Basket arrival" : "Basket arrival receipt" }), _jsx(Typography, { variant: "h4", children: receipt?.status === "retracted"
|
|
159
|
-
? "Retracted basket arrival"
|
|
160
|
-
: receipt === undefined
|
|
161
|
-
? `Bring ${basketName.toLocaleLowerCase()} ${expectedBasketId} to this station`
|
|
162
|
-
: `${basketName} ${receipt.command.observedBasketId} at this station` }), receipt === undefined ? (_jsx(Typography, { children: "Record arrival after the basket is physically in place." })) : null] }), receipt === undefined ? (_jsxs(Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [_jsx(Button, { disabled: disabled, onClick: () => void record(createCommand(expectedBasketId)), size: "large", variant: "contained", children: submission?.state === "submitting"
|
|
163
|
-
? "Recording arrival…"
|
|
164
|
-
: `${basketName} ${expectedBasketId} arrived` }), _jsxs(Button, { disabled: disabled, onClick: () => setChooseDifferent((visible) => !visible), size: "large", variant: "outlined", children: ["Different ", basketName.toLocaleLowerCase()] })] })) : null, receipt === undefined && chooseDifferent && !disabled ? (_jsxs(Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [_jsx(TextField, { label: `${basketName} number`, onChange: (event) => setDifferentBasket(event.target.value), type: "number", value: differentBasket, slotProps: { htmlInput: { inputMode: "numeric", min: 1 } } }), _jsxs(Button, { disabled: !validDifferentBasket, onClick: () => void record(createCommand(parsedDifferentBasket)), variant: "contained", children: ["Record ", basketName.toLocaleLowerCase(), " arrival"] })] })) : null, submitCommand === undefined ? (_jsx(Alert, { severity: "warning", children: "Basket arrival completion is not configured." })) : activeCommand !== undefined || receipt?.status === "retracted" ? (_jsxs(Stack, { spacing: 1, children: [_jsx(Alert, { severity: "success", children: receiptMessage }), submitCorrection === undefined || activeCommand === undefined ? null : (_jsxs(Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [_jsx(Button, { disabled: correctionSubmission !== undefined, onClick: () => setChangingRecordedBasket((visible) => !visible), variant: "outlined", children: "Change" }), _jsx(Button, { color: "error", disabled: correctionSubmission !== undefined, onClick: () => void correct(createCorrection(null)), variant: "text", children: "Undo" })] })), changingRecordedBasket && correctionSubmission === undefined ? (_jsxs(Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, children: [_jsx(TextField, { label: `Correct ${basketName.toLocaleLowerCase()} number`, onChange: (event) => setDifferentBasket(event.target.value), type: "number", value: differentBasket, slotProps: { htmlInput: { inputMode: "numeric", min: 1 } } }), _jsx(Button, { disabled: !validDifferentBasket, onClick: () => void correct(createCorrection(parsedDifferentBasket)), variant: "contained", children: "Save correction" })] })) : null, correctionSubmission?.state === "accepted" ? (_jsx(Alert, { severity: "success", children: "Correction recorded." })) : correctionSubmission?.state === "conflict" ? (_jsx(Alert, { severity: "warning", children: "Basket status changed. Review the refreshed status." })) : correctionSubmission?.state === "error" ? (_jsx(Alert, { action: _jsx(Button, { color: "inherit", onClick: () => void correct(correctionSubmission.command), children: "Retry correction" }), severity: "error", children: "Unable to correct the recorded arrival." })) : null] })) : submission?.state === "conflict" ? (_jsx(Alert, { severity: "warning", children: "Basket movement changed. Review the refreshed instruction." })) : submission?.state === "error" ? (_jsx(Alert, { action: _jsx(Button, { onClick: () => void record(submission.command), color: "inherit", children: "Retry arrival" }), severity: "error", children: submission.message })) : null] }) }));
|
|
165
|
-
}
|