@seedtactics/insight-client 17.0.1-beta.15 → 17.0.1-beta.17
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-CnZe9PDO.js → ProgramHighlight-mKbZxoXO.js} +1 -1
- package/dist/assets/index-htn3QO9k.js +367 -0
- package/dist/components/ChooseMode.js +15 -3
- package/dist/components/ErrorsAndLoading.js +2 -1
- package/dist/components/LoadingIcon.js +3 -1
- package/dist/components/quality/QualityMaterial.js +3 -12
- package/dist/components/station-monitor/BasketLoadStationWork.d.ts +4 -1
- package/dist/components/station-monitor/BasketLoadStationWork.js +60 -41
- package/dist/components/station-monitor/CancelLoadButton.js +3 -2
- package/dist/components/station-monitor/InvalidateCycle.js +2 -6
- package/dist/components/station-monitor/LoadStation.js +56 -44
- package/dist/components/station-monitor/Material.d.ts +6 -1
- package/dist/components/station-monitor/Material.js +19 -8
- package/dist/components/station-monitor/MoveMaterialArrows.js +9 -0
- package/dist/components/station-monitor/QuarantineButton.js +4 -3
- package/dist/components/station-monitor/QueuesAddMaterial.js +2 -5
- package/dist/components/station-monitor/SystemOverview.js +56 -17
- package/dist/data/move-arrows.d.ts +7 -0
- package/dist/data/move-arrows.js +107 -24
- package/dist/data/queue-material.d.ts +1 -0
- package/dist/data/queue-material.js +55 -48
- package/dist/index.html +1 -1
- package/dist/network/api-errors.d.ts +6 -0
- package/dist/network/api-errors.js +72 -0
- package/dist/network/websocket.js +5 -3
- package/dist/util/parseISODuration.js +10 -9
- package/docs/server-config.md +20 -12
- package/package.json +13 -13
- package/dist/assets/index-Z6GAS_qc.js +0 -367
|
@@ -31,7 +31,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
31
31
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
32
32
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
33
|
*/
|
|
34
|
-
import { ListItem, ListItemButton, Paper } from "@mui/material";
|
|
34
|
+
import { Alert, AlertTitle, ListItem, ListItemButton, Paper } from "@mui/material";
|
|
35
35
|
import { List } from "@mui/material";
|
|
36
36
|
import { ListItemIcon } from "@mui/material";
|
|
37
37
|
import { ListSubheader } from "@mui/material";
|
|
@@ -39,6 +39,11 @@ import { ListItemText } from "@mui/material";
|
|
|
39
39
|
import { Typography } from "@mui/material";
|
|
40
40
|
import { Build as BuildIcon, ShoppingBasket, Directions as DirectionsIcon, StarRate as StarIcon, InsertChart as ChartIcon, Extension as ExtensionIcon, Info as InfoIcon, Opacity as OpacityIcon, Memory as MemoryIcon, CalendarViewMonth, Paid as SalesIcon, } from "@mui/icons-material";
|
|
41
41
|
import { RouteLocation } from "./routes.js";
|
|
42
|
+
import { useAtomValue } from "jotai";
|
|
43
|
+
import { LazySeq } from "@seedtactics/immutable-collections";
|
|
44
|
+
import { currentStatus } from "../cell-status/current-status.js";
|
|
45
|
+
import { errorLoadingLast30 } from "../network/websocket.js";
|
|
46
|
+
import { errorLoadingSpecificMonthData } from "../network/load-specific-month.js";
|
|
42
47
|
export const defaultChooseModes = [
|
|
43
48
|
{ type: "Subheader", caption: "Shop Floor" },
|
|
44
49
|
{
|
|
@@ -130,12 +135,19 @@ export const defaultChooseModes = [
|
|
|
130
135
|
},
|
|
131
136
|
];
|
|
132
137
|
export function ChooseMode(p) {
|
|
138
|
+
const status = useAtomValue(currentStatus);
|
|
139
|
+
const recentError = useAtomValue(errorLoadingLast30);
|
|
140
|
+
const monthError = useAtomValue(errorLoadingSpecificMonthData);
|
|
141
|
+
const errors = LazySeq.of([...status.alarms, recentError, monthError])
|
|
142
|
+
.filter((error) => error !== null && error.length > 0)
|
|
143
|
+
.distinct()
|
|
144
|
+
.toRArray();
|
|
133
145
|
const navList = (_jsx(Paper, { children: _jsx(List, { component: "nav", dense: true, children: (p.modes ?? defaultChooseModes).map((mode, idx) => mode.type === "Subheader" ? (_jsx(ListSubheader, { children: mode.caption }, idx)) : (_jsx(ListItem, { children: _jsxs(ListItemButton, { onClick: () => p.setRoute(mode.route), children: [_jsx(ListItemIcon, { children: mode.icon }), _jsx(ListItemText, { children: mode.label })] }) }, idx))) }) }));
|
|
134
|
-
return (_jsx("main", { style: { display: "flex", justifyContent: "center" }, children: _jsxs("div", { children: [_jsxs("div", { style: { textAlign: "center" }, children: [_jsx(Typography, { variant: "h4", style: { marginTop: "2em" }, children: "Select user and computer location" }), _jsxs(Typography, { variant: "caption", style: {
|
|
146
|
+
return (_jsx("main", { style: { display: "flex", justifyContent: "center" }, children: _jsxs("div", { style: { maxWidth: "50em", padding: "0 1em" }, children: [_jsxs("div", { style: { textAlign: "center" }, children: [_jsx(Typography, { variant: "h4", style: { marginTop: "2em" }, children: "Select user and computer location" }), _jsxs(Typography, { variant: "caption", style: {
|
|
135
147
|
marginBottom: "2em",
|
|
136
148
|
maxWidth: "30em",
|
|
137
149
|
marginLeft: "auto",
|
|
138
150
|
marginRight: "auto",
|
|
139
|
-
}, children: ["We recommend that after selecting one of the following modes, you bookmark the page and visit it directly.", _jsx("a", { href: "https://fms-insight.seedtactics.com/docs/client-dashboard.html", children: "Learn More" })] })] }), navList] }) }));
|
|
151
|
+
}, children: ["We recommend that after selecting one of the following modes, you bookmark the page and visit it directly.", _jsx("a", { href: "https://fms-insight.seedtactics.com/docs/client-dashboard.html", children: "Learn More" })] })] }), errors.length > 0 ? (_jsxs(Alert, { severity: "error", sx: { margin: "1em 0" }, children: [_jsx(AlertTitle, { children: "FMS Insight errors" }), errors.map((error) => (_jsx("p", { children: error }, error)))] })) : undefined, navList] }) }));
|
|
140
152
|
}
|
|
141
153
|
export default ChooseMode;
|
|
@@ -37,6 +37,7 @@ import { Card } from "@mui/material";
|
|
|
37
37
|
import { CardContent } from "@mui/material";
|
|
38
38
|
import { ErrorBoundary } from "react-error-boundary";
|
|
39
39
|
import { ApiException } from "../network/api.js";
|
|
40
|
+
import { apiErrorMessage } from "../network/api-errors.js";
|
|
40
41
|
function displayUnknownError(error) {
|
|
41
42
|
if (typeof error === "string") {
|
|
42
43
|
return error;
|
|
@@ -53,7 +54,7 @@ export function DisplayError({ error }) {
|
|
|
53
54
|
if (error === undefined)
|
|
54
55
|
return _jsx(_Fragment, {});
|
|
55
56
|
if (ApiException.isApiException(error)) {
|
|
56
|
-
return (_jsx(Card, { children: _jsxs(CardContent, { children: [_jsx("h3", { children: "FMS Insight Server Error" }), _jsx("p", { children: error
|
|
57
|
+
return (_jsx(Card, { children: _jsxs(CardContent, { children: [_jsx("h3", { children: "FMS Insight Server Error" }), _jsx("p", { children: apiErrorMessage(error) })] }) }));
|
|
57
58
|
}
|
|
58
59
|
else if (error instanceof Error) {
|
|
59
60
|
return (_jsx(Card, { children: _jsx(CardContent, { children: error.message }) }));
|
|
@@ -38,11 +38,13 @@ import { Tooltip } from "@mui/material";
|
|
|
38
38
|
import { errorLoadingLast30, websocketReconnecting } from "../network/websocket.js";
|
|
39
39
|
import { errorLoadingSpecificMonthData, loadingSpecificMonthData, } from "../network/load-specific-month.js";
|
|
40
40
|
import { useAtomValue } from "jotai";
|
|
41
|
+
import { currentRoute, RouteLocation } from "./routes.js";
|
|
41
42
|
export const LoadingIcon = memo(function LoadingIcon() {
|
|
42
43
|
const websocketLoading = useAtomValue(websocketReconnecting);
|
|
43
44
|
const specificMonthLoading = useAtomValue(loadingSpecificMonthData);
|
|
44
45
|
const last30Error = useAtomValue(errorLoadingLast30);
|
|
45
46
|
const specificMonthError = useAtomValue(errorLoadingSpecificMonthData);
|
|
47
|
+
const errorsInline = useAtomValue(currentRoute).route === RouteLocation.ChooseMode;
|
|
46
48
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
47
|
-
return (_jsxs(_Fragment, { children: [last30Error != null || specificMonthError != null ? (_jsx(Tooltip, { title: "Error", children: _jsx(IconButton, { onClick: () => setDialogOpen(true), size: "large", children: _jsx(ErrorIcon, {}) }) })) : undefined, websocketLoading || specificMonthLoading ? (_jsx(Tooltip, { title: "Loading", children: _jsx(CircularProgress, { "data-testid": "loading-icon", color: "secondary" }) })) : undefined, _jsxs(Dialog, { open: dialogOpen, onClose: () => setDialogOpen(false), children: [_jsx(DialogTitle, { children: "Error" }), _jsxs(DialogContent, { children: [last30Error !== null ? _jsx("p", { children: last30Error }) : undefined, specificMonthError !== null ? _jsx("p", { children: specificMonthError }) : undefined] }), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => setDialogOpen(false), children: "Close" }) })] })] }));
|
|
49
|
+
return (_jsxs(_Fragment, { children: [!errorsInline && (last30Error != null || specificMonthError != null) ? (_jsx(Tooltip, { title: "Error", children: _jsx(IconButton, { "aria-label": "Error", onClick: () => setDialogOpen(true), size: "large", children: _jsx(ErrorIcon, {}) }) })) : undefined, websocketLoading || specificMonthLoading ? (_jsx(Tooltip, { title: "Loading", children: _jsx(CircularProgress, { "data-testid": "loading-icon", color: "secondary" }) })) : undefined, _jsxs(Dialog, { open: dialogOpen && !errorsInline, onClose: () => setDialogOpen(false), children: [_jsx(DialogTitle, { children: "Error" }), _jsxs(DialogContent, { children: [last30Error !== null ? _jsx("p", { children: last30Error }) : undefined, specificMonthError !== null ? _jsx("p", { children: specificMonthError }) : undefined] }), _jsx(DialogActions, { children: _jsx(Button, { onClick: () => setDialogOpen(false), children: "Close" }) })] })] }));
|
|
48
50
|
});
|
|
@@ -37,7 +37,8 @@ import * as matDetails from "../../cell-status/material-details.js";
|
|
|
37
37
|
import { MaterialDetailTitle, MaterialDetailContent, MaterialLoading, } from "../station-monitor/Material.js";
|
|
38
38
|
import { buildPathString, extractPath } from "../../data/results.inspection.js";
|
|
39
39
|
import { startOfToday, addDays, startOfDay, endOfDay } from "date-fns";
|
|
40
|
-
import {
|
|
40
|
+
import { LogType } from "../../network/api.js";
|
|
41
|
+
import { apiErrorMessage } from "../../network/api-errors.js";
|
|
41
42
|
import { InspectionSankey } from "../analysis/InspectionSankey.js";
|
|
42
43
|
import { useIsDemo, useSetTitle } from "../routes.js";
|
|
43
44
|
import { extendRange, inspectionLogEntries, pathLookupRange } from "../../data/path-lookup.js";
|
|
@@ -68,17 +69,7 @@ function SerialLookup() {
|
|
|
68
69
|
setError("No material found with serial " + serial);
|
|
69
70
|
}
|
|
70
71
|
})
|
|
71
|
-
.catch((e) =>
|
|
72
|
-
if (ApiException.isApiException(e)) {
|
|
73
|
-
setError(e.response);
|
|
74
|
-
}
|
|
75
|
-
else if (e instanceof Error) {
|
|
76
|
-
setError(e.message);
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
setError(e);
|
|
80
|
-
}
|
|
81
|
-
})
|
|
72
|
+
.catch((e) => setError(apiErrorMessage(e)))
|
|
82
73
|
.finally(() => setLoading(false));
|
|
83
74
|
}
|
|
84
75
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
1
2
|
import * as api from "../../network/api.js";
|
|
2
3
|
import { MatCardFontSize } from "./Material.js";
|
|
3
4
|
interface BasketLoadStationWorkflowProps {
|
|
4
5
|
readonly basket: Readonly<api.IBasketStatus>;
|
|
5
6
|
readonly material: ReadonlyArray<Readonly<api.IInProcessMaterial>>;
|
|
6
7
|
readonly fsize: MatCardFontSize;
|
|
8
|
+
readonly title: ReactNode;
|
|
9
|
+
readonly elapsed: ReactNode;
|
|
7
10
|
}
|
|
8
|
-
export declare function BasketLoadStationWorkflow({ basket, material, fsize, }: BasketLoadStationWorkflowProps): import("react").JSX.Element;
|
|
11
|
+
export declare function BasketLoadStationWorkflow({ basket, material, fsize, title, elapsed, }: BasketLoadStationWorkflowProps): import("react").JSX.Element;
|
|
9
12
|
export {};
|
|
@@ -113,33 +113,12 @@ function stationWork(material, basket) {
|
|
|
113
113
|
},
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
return { type: "none" };
|
|
118
|
-
const tagged = validActions.filter((action) => isNonBlank(action.workId));
|
|
119
|
-
const workIds = LazySeq.of(tagged).toHashSet(({ workId }) => workId);
|
|
120
|
-
if (tagged.length !== validActions.length || workIds.size !== 1) {
|
|
121
|
-
return { type: "inconsistent" };
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
type: "active",
|
|
125
|
-
work: { workId: tagged[0].workId, ready: true, confirmEmpty: false, awaitingSlots: [] },
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
function loadingInstruction(mat) {
|
|
129
|
-
if (mat.location.type === api.LocType.InBasket &&
|
|
130
|
-
mat.location.basketId === mat.action.loadToBasketId &&
|
|
131
|
-
mat.location.basketSlot === mat.action.loadToBasketSlot) {
|
|
132
|
-
return "Unload, re-plate, and reload this slot";
|
|
133
|
-
}
|
|
134
|
-
if (mat.location.type === api.LocType.InQueue && mat.location.currentQueue) {
|
|
135
|
-
return `Load from ${mat.location.currentQueue}`;
|
|
136
|
-
}
|
|
137
|
-
return "Load from raw material";
|
|
116
|
+
return { type: validActions.length === 0 ? "none" : "inconsistent" };
|
|
138
117
|
}
|
|
139
|
-
function SlotMaterial({ material, fsize, }) {
|
|
140
|
-
return material.map((mat) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: mat }, children: _jsx(InProcMaterial, { mat: mat, fsize: fsize }) }, mat.materialID)));
|
|
118
|
+
function SlotMaterial({ material, basketId, fsize, }) {
|
|
119
|
+
return material.map((mat) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: mat }, children: _jsx(InProcMaterial, { mat: mat, displayActionForSingleBasket: basketId, fsize: fsize }) }, mat.materialID)));
|
|
141
120
|
}
|
|
142
|
-
export function BasketLoadStationWorkflow({ basket, material, fsize, }) {
|
|
121
|
+
export function BasketLoadStationWorkflow({ basket, material, fsize, title, elapsed, }) {
|
|
143
122
|
const [submission, setSubmission] = useState();
|
|
144
123
|
const workState = useMemo(() => stationWork(material, basket), [basket, material]);
|
|
145
124
|
const blockedReason = basket.loadStationWork?.confirmationBlockedReason?.trim();
|
|
@@ -191,23 +170,63 @@ export function BasketLoadStationWorkflow({ basket, material, fsize, }) {
|
|
|
191
170
|
submissionState === "submitting" ||
|
|
192
171
|
submissionState === "accepted" ||
|
|
193
172
|
submissionState === "conflict";
|
|
194
|
-
|
|
173
|
+
// Confirm sits in the header so it is visible without scrolling. Slots are drawn like pallet
|
|
174
|
+
// faces: stacked regions holding their material side by side. All material in a slot moves
|
|
175
|
+
// together.
|
|
176
|
+
return (_jsxs("div", { children: [_jsxs(Box, { sx: {
|
|
195
177
|
display: "grid",
|
|
196
|
-
gridTemplateColumns: "
|
|
197
|
-
|
|
198
|
-
|
|
178
|
+
gridTemplateColumns: "1fr auto auto",
|
|
179
|
+
alignItems: "center",
|
|
180
|
+
columnGap: 4,
|
|
181
|
+
}, children: [title, _jsx(Box, { children: work ? (_jsx(Button, { variant: "contained", color: "secondary", size: "large", disabled: submissionDisabled, onClick: () => void submit(), children: "Confirm" })) : null }), _jsx(Box, { sx: {
|
|
182
|
+
justifySelf: "flex-end",
|
|
183
|
+
minWidth: "8ch",
|
|
184
|
+
textAlign: "right",
|
|
185
|
+
fontVariantNumeric: "tabular-nums",
|
|
186
|
+
}, children: elapsed })] }), _jsxs(Stack, { spacing: 2, sx: { ml: "4em", mr: "4em", mt: 2 }, children: [work?.confirmEmpty && work.ready && (_jsxs(Typography, { children: ["Confirm basket ", basket.basketId, " is empty."] })), instructionWarning && _jsx(Alert, { severity: "warning", children: instructionWarning }), work && !work.ready && (_jsx(Alert, { severity: "info", children: blockedReason ||
|
|
187
|
+
(work.awaitingSlots.length > 0
|
|
188
|
+
? `Waiting for material for slots ${work.awaitingSlots.map(basketSlotLabel).join(", ")}.`
|
|
189
|
+
: "Basket work is not ready for confirmation.") })), !work && workState.type === "inconsistent" ? (_jsx(Alert, { severity: "warning", children: "Basket work is inconsistent. Wait for refreshed material actions before confirming." })) : null, submissionState === "accepted" ? (_jsx(Alert, { severity: "success", children: "Confirmation accepted. Waiting for refreshed work." })) : submissionState === "conflict" ? (_jsx(Alert, { severity: "warning", children: "Basket work changed before confirmation. Review the refreshed slots and try again." })) : submissionState === "error" ? (_jsx(Alert, { severity: "error", children: "Unable to confirm basket work. No work was assumed complete." })) : null] }), _jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.BasketZone, basketId: basket.basketId }, children: slots.map((slot, idx) => {
|
|
199
190
|
const slotMaterial = materialBySlot.get(slot) ?? [];
|
|
200
|
-
const loads = loadsBySlot.get(slot) ?? [];
|
|
201
191
|
const isUnknown = basket.unknownSlots?.includes(slot) === true;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
192
|
+
const targetContents = LazySeq.of(slotMaterial)
|
|
193
|
+
.filter((mat) => mat.action.type !== api.ActionType.UnloadToInProcess &&
|
|
194
|
+
mat.action.type !== api.ActionType.UnloadToCompletedMaterial)
|
|
195
|
+
.concat(loadsBySlot.get(slot) ?? [])
|
|
196
|
+
.map((mat) => {
|
|
197
|
+
const process = mat.action.type === api.ActionType.LoadingToBasket
|
|
198
|
+
? mat.action.processAfterLoad
|
|
199
|
+
: mat.process;
|
|
200
|
+
return `${mat.partName}${process !== undefined ? ` proc ${process}` : ""}`;
|
|
201
|
+
})
|
|
202
|
+
.distinctBy((label) => label)
|
|
203
|
+
.toRArray();
|
|
204
|
+
const targetEmpty = work?.confirmEmpty ||
|
|
205
|
+
(!isUnknown && (slotMaterial.length > 0 || basket.emptySlots?.includes(slot) === true));
|
|
206
|
+
const target = work && !work.awaitingSlots.includes(slot)
|
|
207
|
+
? targetContents.length > 0
|
|
208
|
+
? `Fill with ${targetContents.join(", ")}`
|
|
209
|
+
: targetEmpty
|
|
210
|
+
? "Leave empty"
|
|
211
|
+
: undefined
|
|
212
|
+
: undefined;
|
|
213
|
+
return (_jsxs(Box, { component: "section", "data-testid": `basket-load-station-slot-${slot}`, sx: { borderTop: idx !== 0 ? "1px solid black" : undefined, py: 3 }, children: [_jsxs(Box, { sx: {
|
|
214
|
+
display: "flex",
|
|
215
|
+
justifyContent: "center",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
flexWrap: "wrap",
|
|
218
|
+
columnGap: 1,
|
|
219
|
+
color: "text.secondary",
|
|
220
|
+
mb: 2,
|
|
221
|
+
}, children: [_jsxs(Typography, { variant: "h6", sx: { color: "text.primary" }, children: ["Slot ", basketSlotLabel(slot)] }), target && (_jsxs(Box, { component: "span", sx: { display: "inline-flex", alignItems: "center", gap: 1 }, children: [_jsx(Typography, { component: "span", variant: "body2", color: "inherit", "aria-hidden": true, children: "\u00B7" }), _jsx(Typography, { component: "span", variant: "body2", color: "inherit", children: target })] }))] }), _jsx(Box, { sx: { ml: "4em", mr: "4em" }, children: _jsx(MoveMaterialArrowNode, { kind: {
|
|
222
|
+
type: MoveMaterialNodeKindType.BasketSlotZone,
|
|
223
|
+
basketId: basket.basketId,
|
|
224
|
+
slot,
|
|
225
|
+
}, children: _jsx(Box, { sx: {
|
|
226
|
+
display: "flex",
|
|
227
|
+
flexWrap: "wrap",
|
|
228
|
+
justifyContent: "space-around",
|
|
229
|
+
minHeight: "4em",
|
|
230
|
+
}, children: slotMaterial.length > 0 ? (_jsx(SlotMaterial, { material: slotMaterial, basketId: basket.basketId, fsize: fsize })) : isUnknown ? (_jsx(Typography, { color: "warning.main", children: "Unknown" })) : null }) }) })] }, slot));
|
|
231
|
+
}) })] }));
|
|
213
232
|
}
|
|
@@ -7,7 +7,8 @@ import { currentStatus } from "../../cell-status/current-status.js";
|
|
|
7
7
|
import { inProcessMaterialInDialog, materialDialogOpen, } from "../../cell-status/material-details.js";
|
|
8
8
|
import { currentOperator } from "../../data/operators.js";
|
|
9
9
|
import { JobsBackend } from "../../network/backend.js";
|
|
10
|
-
import {
|
|
10
|
+
import { CancelLoadRequest } from "../../network/api.js";
|
|
11
|
+
import { apiErrorMessage } from "../../network/api-errors.js";
|
|
11
12
|
import { canCancelLoad } from "../../data/material-operation-policy.js";
|
|
12
13
|
export function CancelLoadButton({ onClose, ignoreOperator = false, }) {
|
|
13
14
|
const material = useAtomValue(inProcessMaterialInDialog);
|
|
@@ -47,7 +48,7 @@ export function CancelLoadButton({ onClose, ignoreOperator = false, }) {
|
|
|
47
48
|
onClose?.();
|
|
48
49
|
}
|
|
49
50
|
catch (e) {
|
|
50
|
-
setError(
|
|
51
|
+
setError(apiErrorMessage(e));
|
|
51
52
|
}
|
|
52
53
|
finally {
|
|
53
54
|
setUpdating(false);
|
|
@@ -46,7 +46,7 @@ import { useEffect, useRef } from "react";
|
|
|
46
46
|
import { last30Jobs } from "../../cell-status/scheduled-jobs.js";
|
|
47
47
|
import { PartIdenticon } from "./Material.js";
|
|
48
48
|
import { isLogEntryInvalidated } from "../LogEntry.js";
|
|
49
|
-
import {
|
|
49
|
+
import { apiErrorMessage } from "../../network/api-errors.js";
|
|
50
50
|
import { canInvalidateMaterial } from "../../data/material-operation-policy.js";
|
|
51
51
|
const invalidatableEventTypes = LazySeq.of([
|
|
52
52
|
LogType.AddToQueue,
|
|
@@ -221,11 +221,7 @@ export function InvalidateCycleDialogButton(props) {
|
|
|
221
221
|
props.setState({
|
|
222
222
|
...props.st,
|
|
223
223
|
updating: false,
|
|
224
|
-
error:
|
|
225
|
-
? e.response
|
|
226
|
-
: e instanceof Error
|
|
227
|
-
? e.message
|
|
228
|
-
: String(e),
|
|
224
|
+
error: apiErrorMessage(e),
|
|
229
225
|
});
|
|
230
226
|
});
|
|
231
227
|
}
|
|
@@ -38,6 +38,7 @@ import { FolderOpen as FolderOpenIcon } from "@mui/icons-material";
|
|
|
38
38
|
import { MaterialDialog, InProcMaterial, SortableInProcMaterial, DragOverlayInProcMaterial, MatSummary, } from "./Material.js";
|
|
39
39
|
import { SortableRegion } from "./Whiteboard.js";
|
|
40
40
|
import * as api from "../../network/api.js";
|
|
41
|
+
import { apiErrorMessage } from "../../network/api-errors.js";
|
|
41
42
|
import * as matDetails from "../../cell-status/material-details.js";
|
|
42
43
|
import { SelectWorkorderDialog, selectWorkorderDialogOpen } from "./SelectWorkorder.js";
|
|
43
44
|
import { SelectInspTypeDialog, SignalInspectionButton } from "./SelectInspType.js";
|
|
@@ -60,7 +61,7 @@ import { addHours } from "date-fns";
|
|
|
60
61
|
import { PromptForQueue } from "./QueuesAddMaterial.js";
|
|
61
62
|
import { useAtomValue, useSetAtom } from "jotai";
|
|
62
63
|
import { PrintLabelButton } from "./PrintedLabel.js";
|
|
63
|
-
import { hideNonLoadingMaterialOnLoadStation } from "../../data/queue-material.js";
|
|
64
|
+
import { groupInterchangeableMaterial, hideNonLoadingMaterialOnLoadStation, } from "../../data/queue-material.js";
|
|
64
65
|
import { basketDisplayName, loadStationDisplayName } from "../../cell-status/station-cycles.js";
|
|
65
66
|
import { canAddOrMoveMaterialToQueue } from "../../data/material-operation-policy.js";
|
|
66
67
|
import { BasketLoadStationWorkflow } from "./BasketLoadStationWork.js";
|
|
@@ -316,6 +317,15 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
316
317
|
.toRArray().length
|
|
317
318
|
: 0;
|
|
318
319
|
const layoutCount = Math.max(matCount, activeBasketSlotCount);
|
|
320
|
+
// Basket slots are rows of material side by side, so the widest slot must fit across the screen
|
|
321
|
+
const widestBasketSlot = activeBasket
|
|
322
|
+
? (LazySeq.of(curSt.material)
|
|
323
|
+
.filter((mat) => mat.location.type === api.LocType.InBasket &&
|
|
324
|
+
mat.location.basketId === activeBasket.basketId)
|
|
325
|
+
.groupBy((mat) => mat.location.basketSlot ?? 0)
|
|
326
|
+
.map(([, mats]) => mats.length)
|
|
327
|
+
.maxBy((n) => n) ?? 0)
|
|
328
|
+
: 0;
|
|
319
329
|
return {
|
|
320
330
|
pallet: pal,
|
|
321
331
|
activeBasket,
|
|
@@ -325,7 +335,7 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
|
|
|
325
335
|
queues: sortedQueueMat,
|
|
326
336
|
baskets: sortedBasketMat,
|
|
327
337
|
elapsedLoadingTime,
|
|
328
|
-
fsize: layoutCount
|
|
338
|
+
fsize: layoutCount > 6 || widestBasketSlot >= 3 ? "normal" : layoutCount <= 2 ? "x-large" : "large",
|
|
329
339
|
};
|
|
330
340
|
}
|
|
331
341
|
function MultiInstructionButton({ loadData }) {
|
|
@@ -385,8 +395,8 @@ function ElapsedLoadTime({ elapsedLoadTime }) {
|
|
|
385
395
|
const secondsSinceEpoch = useAtomValue(secondsSinceEpochAtom);
|
|
386
396
|
if (elapsedLoadTime) {
|
|
387
397
|
const elapsedSecsInCurSt = durationToSeconds(elapsedLoadTime);
|
|
388
|
-
const elapsedSecs = elapsedSecsInCurSt + (secondsSinceEpoch -
|
|
389
|
-
return _jsx("span", { children: formatSeconds(elapsedSecs) });
|
|
398
|
+
const elapsedSecs = elapsedSecsInCurSt + (secondsSinceEpoch - currentStTime.getTime() / 1000);
|
|
399
|
+
return _jsx("span", { children: formatSeconds(Math.max(0, elapsedSecs)) });
|
|
390
400
|
}
|
|
391
401
|
else {
|
|
392
402
|
return null;
|
|
@@ -399,15 +409,7 @@ function PalletFace({ data, faceNum }) {
|
|
|
399
409
|
if (!face)
|
|
400
410
|
return null;
|
|
401
411
|
if (data.activeBasket && !data.pallet) {
|
|
402
|
-
return (
|
|
403
|
-
display: "grid",
|
|
404
|
-
gridTemplateColumns: "1fr auto",
|
|
405
|
-
}, children: [_jsxs(Typography, { variant: "h4", children: [basketName, " ", data.activeBasket.basketId] }), _jsx(Box, { sx: {
|
|
406
|
-
justifySelf: "flex-end",
|
|
407
|
-
}, children: _jsx(ElapsedLoadTime, { elapsedLoadTime: data.elapsedLoadingTime }) })] })) : null, _jsx(Box, { sx: { ml: "4em", mr: "4em" }, children: _jsx(MoveMaterialArrowNode, { kind: {
|
|
408
|
-
type: MoveMaterialNodeKindType.BasketZone,
|
|
409
|
-
basketId: data.activeBasket.basketId,
|
|
410
|
-
}, children: _jsx(BasketLoadStationWorkflow, { basket: data.activeBasket, material: data.allMaterial, fsize: data.fsize }) }) })] }));
|
|
412
|
+
return (_jsx("div", { "data-testid": "load-station-active-basket", children: _jsx(BasketLoadStationWorkflow, { basket: data.activeBasket, material: data.allMaterial, fsize: data.fsize, title: _jsxs(Typography, { variant: "h4", children: [basketName, " ", data.activeBasket.basketId] }), elapsed: _jsx(ElapsedLoadTime, { elapsedLoadTime: data.elapsedLoadingTime }) }) }));
|
|
411
413
|
}
|
|
412
414
|
if (!data.pallet)
|
|
413
415
|
return null;
|
|
@@ -424,24 +426,31 @@ function PalletFace({ data, faceNum }) {
|
|
|
424
426
|
}, children: _jsx(Typography, { variant: "h6", children: data.pallet.faceNames?.[faceNum - 1] ?? `Face ${faceNum}` }) })) : undefined, _jsx(Box, { sx: {
|
|
425
427
|
ml: "4em",
|
|
426
428
|
mr: "4em",
|
|
427
|
-
}, children: _jsx(MoveMaterialArrowNode, { kind: {
|
|
429
|
+
}, children: _jsx(MoveMaterialArrowNode, { kind: {
|
|
430
|
+
type: MoveMaterialNodeKindType.PalletFaceZone,
|
|
431
|
+
palletNum: data.pallet.palletNum,
|
|
432
|
+
face: faceNum,
|
|
433
|
+
}, children: _jsx(Box, { sx: {
|
|
428
434
|
display: "flex",
|
|
429
435
|
flexWrap: "wrap",
|
|
430
436
|
justifyContent: "space-around",
|
|
431
437
|
}, children: face.map((m, idx) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: m }, children: _jsx(InProcMaterial, { mat: m, fsize: data.fsize }) }, idx))) }) }) })] }));
|
|
432
438
|
}
|
|
433
439
|
function MaterialRegion({ data, mat, }) {
|
|
434
|
-
return (_jsxs("div", { children: [mat.label !== "" ? _jsx(Typography, { variant: "h4", children: mat.label }) : null, mat.
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
:
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
440
|
+
return (_jsxs("div", { children: [mat.label !== "" ? _jsx(Typography, { variant: "h4", children: mat.label }) : null, (mat.isFree
|
|
441
|
+
? groupInterchangeableMaterial(mat.material.mats, (m) => m.process === 0)
|
|
442
|
+
: mat.material.mats.map((m) => [m])).map((group, matIdx) => {
|
|
443
|
+
const m = group[0];
|
|
444
|
+
return (_jsx(MoveMaterialArrowNode, { kind: {
|
|
445
|
+
type: MoveMaterialNodeKindType.Material,
|
|
446
|
+
material: m,
|
|
447
|
+
identifier: m.materialID < 0
|
|
448
|
+
? `raw-${mat.isFree ? "free" : "queue"}-${mat.label}-${matIdx}`
|
|
449
|
+
: undefined,
|
|
450
|
+
}, children: mat.isFree || mat.sortable === false ? (_jsx(InProcMaterial, { mat: m, materialCount: group.length, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, displayActionForSingleBasket: data.activeBasket?.basketId, fsize: data.fsize, showRawMaterial: true, showJobComment: true })) : (_jsx(SortableInProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, displayActionForSingleBasket: data.activeBasket?.basketId, shake: isLoadingToDisplayedTarget(m, data.pallet, data.activeBasket), fsize: isLoadingToDisplayedTarget(m, data.pallet, data.activeBasket)
|
|
451
|
+
? data.fsize
|
|
452
|
+
: undefined, showRawMaterial: true, showJobComment: true })) }, matIdx));
|
|
453
|
+
}), mat.material.hiddenCnt > 0 ? (_jsxs(Typography, { variant: "body2", color: "textSecondary", sx: {
|
|
445
454
|
textAlign: "center",
|
|
446
455
|
mt: "0.5em",
|
|
447
456
|
}, children: ["+", mat.material.hiddenCnt, " hidden"] })) : null] }));
|
|
@@ -452,15 +461,15 @@ function BasketRegion({ data, label, baskets, }) {
|
|
|
452
461
|
pt: idx === 0 ? undefined : "1em",
|
|
453
462
|
}, children: [_jsx(Typography, { variant: "h6", sx: {
|
|
454
463
|
mb: "0.5em",
|
|
455
|
-
}, children: basket.label }),
|
|
464
|
+
}, children: basket.label }), _jsxs(MoveMaterialArrowNode, { kind: {
|
|
456
465
|
type: MoveMaterialNodeKindType.BasketZone,
|
|
457
466
|
basketId: basket.basketId,
|
|
458
|
-
}, children: _jsx(MaterialRegion, { data: data, mat: {
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
}, children: [basket.empty && _jsx(Typography, { color: "textSecondary", children: "Empty" }), _jsx(MaterialRegion, { data: data, mat: {
|
|
468
|
+
label: "",
|
|
469
|
+
material: basket.material,
|
|
470
|
+
isFree: false,
|
|
471
|
+
sortable: false,
|
|
472
|
+
} })] })] }, basket.basketId)))] }));
|
|
464
473
|
}
|
|
465
474
|
function MaterialColumn({ data, region, }) {
|
|
466
475
|
switch (region.kind) {
|
|
@@ -472,8 +481,7 @@ function MaterialColumn({ data, region, }) {
|
|
|
472
481
|
sortable: false,
|
|
473
482
|
} }) }));
|
|
474
483
|
case "queue":
|
|
475
|
-
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.
|
|
476
|
-
mat.action.loadOntoPalletNum === data.pallet?.palletNum
|
|
484
|
+
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, displayActionForSingleBasket: data.activeBasket?.basketId, fsize: isLoadingToDisplayedTarget(mat, data.pallet, data.activeBasket)
|
|
477
485
|
? data.fsize
|
|
478
486
|
: undefined })), children: _jsx(MaterialRegion, { data: data, mat: {
|
|
479
487
|
label: region.label,
|
|
@@ -603,11 +611,7 @@ function AddMatButton({ queues, onClose, toQueue, showAddToQueue, setShowAddToQu
|
|
|
603
611
|
onClose();
|
|
604
612
|
}
|
|
605
613
|
catch (e) {
|
|
606
|
-
setAddError(
|
|
607
|
-
? e.response
|
|
608
|
-
: e instanceof Error
|
|
609
|
-
? e.message
|
|
610
|
-
: String(e));
|
|
614
|
+
setAddError(apiErrorMessage(e));
|
|
611
615
|
}
|
|
612
616
|
}, children: ["Add To ", toQueue ?? "Queue", " ", lastProcMat ? ` To Run Process ${lastProcMat.process + 1}` : ""] }), addError ? _jsx(Typography, { role: "alert", children: addError }) : null] }));
|
|
613
617
|
}
|
|
@@ -692,11 +696,19 @@ export function LoadStation(props) {
|
|
|
692
696
|
const baskets = LazySeq.of(data.baskets)
|
|
693
697
|
.filter(([b]) => b !== data.activeBasket?.basketId)
|
|
694
698
|
.sortBy(([b]) => b)
|
|
695
|
-
.map(([b, mats]) =>
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
699
|
+
.map(([b, mats]) => {
|
|
700
|
+
const basket = currentSt.baskets?.[b];
|
|
701
|
+
return {
|
|
702
|
+
basketId: b,
|
|
703
|
+
label: `${basketName} ${b}`,
|
|
704
|
+
material: mats,
|
|
705
|
+
empty: mats.mats.length === 0 &&
|
|
706
|
+
mats.hiddenCnt === 0 &&
|
|
707
|
+
(basket?.slotCount ?? 0) > 0 &&
|
|
708
|
+
basket?.emptySlots?.length === basket?.slotCount &&
|
|
709
|
+
(basket?.unknownSlots?.length ?? 0) === 0,
|
|
710
|
+
};
|
|
711
|
+
})
|
|
700
712
|
.toRArray();
|
|
701
713
|
if (baskets.length > 0) {
|
|
702
714
|
matCols.push({
|
|
@@ -8,17 +8,20 @@ export declare class PartIdenticon extends PureComponent<{
|
|
|
8
8
|
render(): import("react").JSX.Element;
|
|
9
9
|
}
|
|
10
10
|
export type MatCardFontSize = "normal" | "large" | "x-large";
|
|
11
|
-
export declare function MaterialAction({ mat, displayActionForSinglePallet, fsize, }: {
|
|
11
|
+
export declare function MaterialAction({ mat, displayActionForSinglePallet, displayActionForSingleBasket, fsize, }: {
|
|
12
12
|
mat: Readonly<api.IInProcessMaterial>;
|
|
13
13
|
displayActionForSinglePallet?: number;
|
|
14
|
+
displayActionForSingleBasket?: number;
|
|
14
15
|
fsize?: MatCardFontSize;
|
|
15
16
|
}): ReactNode | null;
|
|
16
17
|
export declare function WorkorderFromBarcode(): import("react").JSX.Element | null;
|
|
17
18
|
export interface MaterialSummaryProps {
|
|
18
19
|
readonly mat: Readonly<MaterialSummaryAndCompletedData>;
|
|
20
|
+
readonly materialCount?: number;
|
|
19
21
|
readonly inProcMat?: Readonly<api.IInProcessMaterial>;
|
|
20
22
|
readonly fsize?: MatCardFontSize;
|
|
21
23
|
readonly displayActionForSinglePallet?: number;
|
|
24
|
+
readonly displayActionForSingleBasket?: number;
|
|
22
25
|
readonly focusInspectionType?: string | null;
|
|
23
26
|
readonly hideWarningIcon?: boolean;
|
|
24
27
|
readonly displayJob?: boolean;
|
|
@@ -30,8 +33,10 @@ export interface MaterialSummaryProps {
|
|
|
30
33
|
export declare const MatSummary: ComponentType<MaterialSummaryProps>;
|
|
31
34
|
export type InProcMaterialProps = {
|
|
32
35
|
readonly mat: Readonly<api.IInProcessMaterial>;
|
|
36
|
+
readonly materialCount?: number;
|
|
33
37
|
readonly fsize?: MatCardFontSize;
|
|
34
38
|
readonly displayActionForSinglePallet?: number;
|
|
39
|
+
readonly displayActionForSingleBasket?: number;
|
|
35
40
|
readonly displayJob?: boolean;
|
|
36
41
|
readonly hideAvatar?: boolean;
|
|
37
42
|
readonly hideEmptySerial?: boolean;
|
|
@@ -169,7 +169,7 @@ const MatCardDetail = styled("div", { shouldForwardProp: (prop) => prop !== "fsi
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
});
|
|
172
|
-
export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
172
|
+
export function MaterialAction({ mat, displayActionForSinglePallet, displayActionForSingleBasket, fsize, }) {
|
|
173
173
|
const curSt = useAtomValue(currentStatus);
|
|
174
174
|
const fmsInfo = useAtomValue(fmsInformation);
|
|
175
175
|
const basketName = basketDisplayName(fmsInfo.basketName);
|
|
@@ -236,8 +236,18 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
case api.ActionType.LoadingToBasket:
|
|
239
|
+
// The load station displays a single basket, so its slot alone identifies the destination.
|
|
240
|
+
if (displayActionForSingleBasket !== undefined &&
|
|
241
|
+
displayActionForSingleBasket === mat.action.loadToBasketId &&
|
|
242
|
+
mat.action.loadToBasketSlot !== undefined) {
|
|
243
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load into slot ", basketSlotLabel(mat.action.loadToBasketSlot), mat.action.processAfterLoad !== undefined
|
|
244
|
+
? ` for process ${mat.action.processAfterLoad}`
|
|
245
|
+
: ""] }));
|
|
246
|
+
}
|
|
239
247
|
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Load into ", basketName, " ", mat.action.loadToBasketId ?? "", mat.action.loadToBasketSlot !== undefined
|
|
240
248
|
? ` slot ${basketSlotLabel(mat.action.loadToBasketSlot)}`
|
|
249
|
+
: "", mat.action.processAfterLoad !== undefined
|
|
250
|
+
? ` for process ${mat.action.processAfterLoad}`
|
|
241
251
|
: ""] }));
|
|
242
252
|
case api.ActionType.UnloadToInProcess:
|
|
243
253
|
case api.ActionType.UnloadToCompletedMaterial:
|
|
@@ -251,7 +261,7 @@ export function MaterialAction({ mat, displayActionForSinglePallet, fsize, }) {
|
|
|
251
261
|
}
|
|
252
262
|
else if (mat.action.type === api.ActionType.UnloadToCompletedMaterial &&
|
|
253
263
|
mat.location.type === api.LocType.InBasket) {
|
|
254
|
-
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload from ", basketName, " ", mat.location.basketId
|
|
264
|
+
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload completed from ", basketName, " ", mat.location.basketId] }));
|
|
255
265
|
}
|
|
256
266
|
else if (mat.location.type === api.LocType.InBasket) {
|
|
257
267
|
return (_jsxs(MatCardDetail, { fsize: fsize, children: ["Unload from ", basketName, " ", mat.location.basketId] }));
|
|
@@ -340,7 +350,7 @@ export function WorkorderFromBarcode() {
|
|
|
340
350
|
const comments = currentSt.workorders?.find((w) => w.workorderId === workorderId)?.comments ?? [];
|
|
341
351
|
return (_jsxs("div", { style: { marginTop: "1em", marginLeft: "1em" }, children: [_jsxs("p", { children: ["Workorder: ", workorderId] }), _jsx("ul", { children: comments.map((c, idx) => (_jsx("li", { children: c.comment }, idx))) })] }));
|
|
342
352
|
}
|
|
343
|
-
const MatCard = function MatCard({ mat, inProcMat, fsize, focusInspectionType, isDragOverlay, isActiveDrag, shake, dragRootProps, showDragHandle, setDragHandleRef, dragHandleProps, displayJob, hideEmptySerial, showRawMaterial, showJobComment, displayActionForSinglePallet, hideAvatar, hideWarningIcon, ref, }) {
|
|
353
|
+
const MatCard = function MatCard({ mat, materialCount = 1, inProcMat, fsize, focusInspectionType, isDragOverlay, isActiveDrag, shake, dragRootProps, showDragHandle, setDragHandleRef, dragHandleProps, displayJob, hideEmptySerial, showRawMaterial, showJobComment, displayActionForSinglePallet, displayActionForSingleBasket, hideAvatar, hideWarningIcon, ref, }) {
|
|
344
354
|
const setMatToShow = useSetAtom(matDetails.materialDialogOpen);
|
|
345
355
|
const completed = mat.completedInspections || {};
|
|
346
356
|
let completedMsg;
|
|
@@ -354,6 +364,7 @@ const MatCard = function MatCard({ mat, inProcMat, fsize, focusInspectionType, i
|
|
|
354
364
|
completedMsg = (_jsxs(MatCardDetail, { fsize: fsize, children: [_jsxs("span", { children: [mat.closeout_failed ? "Failed " : "", "Closed Out "] }), _jsx(TimeAgo, { date: mat.closeout_completed })] }));
|
|
355
365
|
}
|
|
356
366
|
return (_jsxs(Paper, { ref: ref, elevation: 4, sx: {
|
|
367
|
+
position: "relative",
|
|
357
368
|
display: "flex",
|
|
358
369
|
minWidth: "10em",
|
|
359
370
|
padding: "8px",
|
|
@@ -363,7 +374,7 @@ const MatCard = function MatCard({ mat, inProcMat, fsize, focusInspectionType, i
|
|
|
363
374
|
"&:hover": {
|
|
364
375
|
animationPlayState: "paused",
|
|
365
376
|
},
|
|
366
|
-
}, onAnimationIteration: shakeAnimationIteration, ...dragRootProps, children: [showDragHandle ? (_jsx("div", { ref: setDragHandleRef, role: "button", tabIndex: 0, style: {
|
|
377
|
+
}, onAnimationIteration: shakeAnimationIteration, ...dragRootProps, children: [materialCount > 1 && (_jsx(Badge, { badgeContent: materialCount, color: "secondary", sx: { position: "absolute", top: 0, right: 0, zIndex: 1 } })), showDragHandle ? (_jsx("div", { ref: setDragHandleRef, role: "button", tabIndex: 0, style: {
|
|
367
378
|
display: "flex",
|
|
368
379
|
flexDirection: "column",
|
|
369
380
|
justifyContent: "center",
|
|
@@ -387,7 +398,7 @@ const MatCard = function MatCard({ mat, inProcMat, fsize, focusInspectionType, i
|
|
|
387
398
|
mat.workorderId === mat.serial ? undefined : (_jsxs(MatCardDetail, { fsize: fsize, children: ["Workorder: ", mat.workorderId] })), mat.jobUnique !== undefined &&
|
|
388
399
|
showRawMaterial &&
|
|
389
400
|
inProcMat &&
|
|
390
|
-
inProcMat.process === 0 ? (_jsx(JobRawMaterial, { fsize: fsize, mat: inProcMat })) : undefined, showJobComment && mat.jobUnique && mat.jobUnique !== "" ? (_jsx(RebookingNoteElipsis, { fsize: fsize, uniq: mat.jobUnique })) : undefined, inProcMat ? (_jsx(MaterialAction, { mat: inProcMat, displayActionForSinglePallet: displayActionForSinglePallet, fsize: fsize })) : undefined, inProcMat?.problem ? (_jsx(MatCardDetail, { fsize: fsize, children: _jsxs(Typography, { variant: "body2", color: "error", sx: { fontWeight: "bold" }, children: ["\u26A0 ", inProcMat.problem] }) })) : undefined, completedMsg] }), _jsxs(Box, { sx: {
|
|
401
|
+
inProcMat.process === 0 ? (_jsx(JobRawMaterial, { fsize: fsize, mat: inProcMat })) : undefined, showJobComment && mat.jobUnique && mat.jobUnique !== "" ? (_jsx(RebookingNoteElipsis, { fsize: fsize, uniq: mat.jobUnique })) : undefined, inProcMat ? (_jsx(MaterialAction, { mat: inProcMat, displayActionForSinglePallet: displayActionForSinglePallet, displayActionForSingleBasket: displayActionForSingleBasket, fsize: fsize })) : undefined, inProcMat?.problem ? (_jsx(MatCardDetail, { fsize: fsize, children: _jsxs(Typography, { variant: "body2", color: "error", sx: { fontWeight: "bold" }, children: ["\u26A0 ", inProcMat.problem] }) })) : undefined, completedMsg] }), _jsxs(Box, { sx: {
|
|
391
402
|
marginLeft: "4px",
|
|
392
403
|
display: "flex",
|
|
393
404
|
flexDirection: "column",
|
|
@@ -399,7 +410,7 @@ const MatCard = function MatCard({ mat, inProcMat, fsize, focusInspectionType, i
|
|
|
399
410
|
};
|
|
400
411
|
export const MatSummary = memo(MatCard);
|
|
401
412
|
export const InProcMaterial = memo(function InProcMaterial(props) {
|
|
402
|
-
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, fsize: props.fsize, hideAvatar: props.hideAvatar, displayJob: props.displayJob, showDragHandle: props.showHandle, hideEmptySerial: props.hideEmptySerial, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment, shake: props.shake }));
|
|
413
|
+
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, fsize: props.fsize, hideAvatar: props.hideAvatar, displayJob: props.displayJob, showDragHandle: props.showHandle, hideEmptySerial: props.hideEmptySerial, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment, shake: props.shake }));
|
|
403
414
|
});
|
|
404
415
|
export const SortableInProcMaterial = memo(function SortableInProcMaterial(props) {
|
|
405
416
|
const canDrag = canReorderQueuedMaterial(props.mat) || canAddOrMoveMaterialToQueue(props.mat);
|
|
@@ -423,10 +434,10 @@ export const SortableInProcMaterial = memo(function SortableInProcMaterial(props
|
|
|
423
434
|
: undefined,
|
|
424
435
|
transition: active !== null ? transition : undefined,
|
|
425
436
|
};
|
|
426
|
-
return (_jsx(MatCard, { ref: setNodeRef, dragRootProps: { style }, showDragHandle: canDrag, dragHandleProps: handleProps, setDragHandleRef: setActivatorNodeRef, isActiveDrag: isDragging, mat: inproc_mat_to_summary(props.mat), inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, hideAvatar: props.hideAvatar, displayJob: props.displayJob, hideEmptySerial: props.hideEmptySerial, fsize: props.fsize, shake: active ? undefined : props.shake, showRawMaterial: props.showRawMaterial }));
|
|
437
|
+
return (_jsx(MatCard, { ref: setNodeRef, dragRootProps: { style }, showDragHandle: canDrag, dragHandleProps: handleProps, setDragHandleRef: setActivatorNodeRef, isActiveDrag: isDragging, mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, hideAvatar: props.hideAvatar, displayJob: props.displayJob, hideEmptySerial: props.hideEmptySerial, fsize: props.fsize, shake: active ? undefined : props.shake, showRawMaterial: props.showRawMaterial, showJobComment: props.showJobComment }));
|
|
427
438
|
});
|
|
428
439
|
export function DragOverlayInProcMaterial(props) {
|
|
429
|
-
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 }));
|
|
440
|
+
return (_jsx(MatCard, { mat: inproc_mat_to_summary(props.mat), materialCount: props.materialCount, inProcMat: props.mat, displayActionForSinglePallet: props.displayActionForSinglePallet, displayActionForSingleBasket: props.displayActionForSingleBasket, showDragHandle: true, hideAvatar: props.hideAvatar, displayJob: props.displayJob, fsize: props.fsize, hideEmptySerial: props.hideEmptySerial, isDragOverlay: true }));
|
|
430
441
|
}
|
|
431
442
|
export const MultiMaterial = memo(function MultiMaterial(props) {
|
|
432
443
|
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: {
|