@seedtactics/insight-client 16.8.4-beta.10 → 16.8.4-beta.11

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.
@@ -37,7 +37,7 @@ import { LazySeq } from "@seedtactics/immutable-collections";
37
37
  import { currentStatus } from "../../cell-status/current-status.js";
38
38
  import { inProcessMaterialInDialog, materialDialogOpen, useRemoveFromQueue, useSignalForQuarantine, } from "../../cell-status/material-details.js";
39
39
  import { currentOperator } from "../../data/operators.js";
40
- import { ActionType, LocType, PalletLocationEnum, QueueRole } from "../../network/api.js";
40
+ import { ActionType, ApiException, LocType, QueueRole, } from "../../network/api.js";
41
41
  import { fmsInformation } from "../../network/server-settings.js";
42
42
  import { useAtomValue, useSetAtom } from "jotai";
43
43
  function useQuarantineMaterial(ignoreOperator) {
@@ -70,75 +70,48 @@ function useQuarantineMaterial(ignoreOperator) {
70
70
  const quarantineQueues = LazySeq.ofObject(curSt.queues)
71
71
  .filter(([qname, _]) => !activeQueues.has(qname))
72
72
  .toRSet(([qname, _]) => qname);
73
- const palLoc = LazySeq.ofObject(curSt.pallets).toOrderedMap(([_, pal]) => [
74
- pal.palletNum,
75
- pal.currentPalletLocation,
76
- ]);
77
73
  // If in a quarantine queue, allow removal from system
78
74
  if (inProcMat.location.type === LocType.InQueue &&
79
75
  inProcMat.location.currentQueue &&
80
76
  quarantineQueues.has(inProcMat.location.currentQueue)) {
81
77
  return {
82
78
  type: "Remove",
79
+ material: inProcMat,
83
80
  quarantine: () => removeFromQueue(inProcMat.materialID, operator),
84
81
  removing: removingFromQueue,
85
82
  quarantineQueueDestination: null,
83
+ removeFromQueues: null,
84
+ removingFromQueues: removingFromQueue,
86
85
  };
87
86
  }
88
87
  let type = null;
89
88
  switch (inProcMat.location.type) {
90
89
  case LocType.OnPallet:
91
- if (fmsInfo.allowQuarantineToCancelLoad) {
92
- // either cancel load or signal based on material action and pallet location
93
- const palAtLoad = inProcMat.location.palletNum &&
94
- palLoc.get(inProcMat.location.palletNum)?.loc === PalletLocationEnum.LoadUnload;
95
- if (inProcMat.action.type === ActionType.Loading || palAtLoad) {
96
- type = "CancelLoad";
97
- }
98
- else {
99
- type = "SignalForScrap";
100
- }
90
+ if (inProcMat.action.type === ActionType.Loading) {
91
+ return null;
101
92
  }
102
- else {
103
- // must signal since it is currently on a pallet, but only if the material is not loading
104
- if (inProcMat.action.type === ActionType.Loading) {
105
- return null;
106
- }
107
- // Check that the job outputs to a queue, only then can signaling for quarantine work
108
- const job = curSt.jobs[inProcMat.jobUnique];
109
- if (!job)
110
- return null;
111
- const path = job.procsAndPaths?.[inProcMat.process - 1]?.paths?.[inProcMat.path - 1];
112
- if (inProcMat.process != job.procsAndPaths.length && (!path || !path.outputQueue)) {
113
- return null;
114
- }
115
- type = "SignalForScrap";
93
+ // Check that the job outputs to a queue, only then can signaling for quarantine work
94
+ const job = curSt.jobs[inProcMat.jobUnique];
95
+ if (!job)
96
+ return null;
97
+ const path = job.procsAndPaths?.[inProcMat.process - 1]?.paths?.[inProcMat.path - 1];
98
+ if (inProcMat.process != job.procsAndPaths.length && (!path || !path.outputQueue)) {
99
+ return null;
116
100
  }
101
+ type = "SignalForScrap";
117
102
  break;
118
103
  case LocType.InQueue:
119
- if ((inProcMat.action.type === ActionType.Loading ||
120
- inProcMat.action.type === ActionType.LoadingToBasket) &&
121
- !fmsInfo.allowQuarantineToCancelLoad) {
122
- return null;
123
- }
124
- else if (inProcMat.action.type === ActionType.Loading ||
104
+ if (inProcMat.action.type === ActionType.Loading ||
125
105
  inProcMat.action.type === ActionType.LoadingToBasket) {
126
- type = "CancelLoad";
127
- }
128
- else {
129
- type = "Scrap";
106
+ return null;
130
107
  }
108
+ type = "Scrap";
131
109
  break;
132
110
  case LocType.InBasket:
133
- if (inProcMat.action.type === ActionType.Loading && !fmsInfo.allowQuarantineToCancelLoad) {
111
+ if (inProcMat.action.type === ActionType.Loading) {
134
112
  return null;
135
113
  }
136
- else if (inProcMat.action.type === ActionType.Loading) {
137
- type = "CancelLoad";
138
- }
139
- else {
140
- type = "Scrap";
141
- }
114
+ type = "Scrap";
142
115
  break;
143
116
  case LocType.Free:
144
117
  type = "Scrap";
@@ -147,18 +120,51 @@ function useQuarantineMaterial(ignoreOperator) {
147
120
  if (type) {
148
121
  return {
149
122
  type,
150
- quarantine: (reason) => signalQuarantine(inProcMat.materialID, operator, reason),
123
+ material: inProcMat,
124
+ quarantine: async (reason) => signalQuarantine(inProcMat.materialID, operator, reason),
151
125
  removing: signalingQuarantine,
152
126
  quarantineQueueDestination: quarantineQueue,
127
+ removeFromQueues: inProcMat.location.type === LocType.InQueue &&
128
+ inProcMat.location.currentQueue !== undefined &&
129
+ activeQueues.has(inProcMat.location.currentQueue) &&
130
+ inProcMat.action.type === ActionType.Waiting
131
+ ? () => removeFromQueue(inProcMat.materialID, operator)
132
+ : null,
133
+ removingFromQueues: removingFromQueue,
153
134
  };
154
135
  }
155
136
  else {
156
137
  return null;
157
138
  }
158
139
  }
140
+ function RemoveFromQueuesButton({ material, removeFromQueues, removing, }) {
141
+ const [open, setOpen] = useState(false);
142
+ const [error, setError] = useState(null);
143
+ const setMatToShow = useSetAtom(materialDialogOpen);
144
+ async function remove() {
145
+ setError(null);
146
+ try {
147
+ await removeFromQueues();
148
+ setOpen(false);
149
+ setMatToShow({
150
+ type: "MatSummary",
151
+ summary: {
152
+ materialID: material.materialID,
153
+ partName: material.partName,
154
+ serial: material.serial,
155
+ },
156
+ });
157
+ }
158
+ catch (e) {
159
+ setError(ApiException.isApiException(e) ? e.response : e instanceof Error ? e.message : String(e));
160
+ }
161
+ }
162
+ return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: "Remove from all queues", children: _jsx(Button, { color: "primary", disabled: removing, onClick: () => setOpen(true), children: "Remove from Queues" }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), children: [_jsx(DialogTitle, { children: "Remove Material from Queues" }), _jsxs(DialogContent, { children: [_jsx("p", { children: "The material will be removed from all queues." }), error ? _jsx("p", { role: "alert", children: error }) : null] }), _jsxs(DialogActions, { children: [_jsx(Button, { color: "primary", disabled: removing, onClick: remove, children: "Remove from Queues" }), _jsx(Button, { color: "secondary", disabled: removing, onClick: () => setOpen(false), children: "Cancel" })] })] })] }));
163
+ }
159
164
  export function QuarantineMatButton({ onClose, ignoreOperator, }) {
160
165
  const [open, setOpen] = useState(false);
161
166
  const [reason, setReason] = useState("");
167
+ const [error, setError] = useState(null);
162
168
  const q = useQuarantineMaterial(!!ignoreOperator);
163
169
  const setMatToShow = useSetAtom(materialDialogOpen);
164
170
  if (q === null)
@@ -182,19 +188,33 @@ export function QuarantineMatButton({ onClose, ignoreOperator, }) {
182
188
  : "After unload, remove the part as scrap";
183
189
  btnTxt = q.quarantineQueueDestination ? "Quarantine" : "Scrap";
184
190
  break;
185
- case "CancelLoad":
186
- title = q.quarantineQueueDestination
187
- ? `Cancel load and move to ${q.quarantineQueueDestination}`
188
- : "Cancel load";
189
- btnTxt = "Cancel Load";
190
- break;
191
191
  }
192
- function quarantine() {
193
- q?.quarantine(reason);
194
- setMatToShow(null);
195
- setOpen(false);
196
- setReason("");
197
- onClose?.();
192
+ async function quarantine() {
193
+ if (!q)
194
+ return;
195
+ setError(null);
196
+ try {
197
+ await q.quarantine(reason);
198
+ setOpen(false);
199
+ setReason("");
200
+ if (q.type === "Remove") {
201
+ setMatToShow({
202
+ type: "MatSummary",
203
+ summary: {
204
+ materialID: q.material.materialID,
205
+ partName: q.material.partName,
206
+ serial: q.material.serial,
207
+ },
208
+ });
209
+ }
210
+ else {
211
+ setMatToShow(null);
212
+ onClose?.();
213
+ }
214
+ }
215
+ catch (e) {
216
+ setError(ApiException.isApiException(e) ? e.response : e instanceof Error ? e.message : String(e));
217
+ }
198
218
  }
199
- return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: title, children: _jsx(Button, { color: "primary", disabled: q.removing, onClick: () => setOpen(true), children: btnTxt }) }), _jsxs(Dialog, { open: open, onClose: () => setOpen(false), children: [_jsx(DialogTitle, { children: "Quarantine Material" }), _jsxs(DialogContent, { children: [_jsx("p", { children: title }), _jsx(TextField, { label: "Reason", value: reason, onChange: (e) => setReason(e.target.value), fullWidth: true, autoFocus: true, multiline: true })] }), _jsxs(DialogActions, { children: [_jsx(Button, { color: "primary", onClick: quarantine, children: btnTxt }), _jsx(Button, { color: "secondary", onClick: () => setOpen(false), children: "Cancel" })] })] })] }));
219
+ return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: title, children: _jsx(Button, { color: "primary", disabled: q.removing, onClick: () => setOpen(true), children: btnTxt }) }), q.removeFromQueues ? (_jsx(RemoveFromQueuesButton, { material: q.material, removeFromQueues: q.removeFromQueues, removing: q.removingFromQueues })) : null, _jsxs(Dialog, { open: open, onClose: () => setOpen(false), children: [_jsx(DialogTitle, { children: "Quarantine Material" }), _jsxs(DialogContent, { children: [_jsx("p", { children: title }), _jsx(TextField, { label: "Reason", value: reason, onChange: (e) => setReason(e.target.value), fullWidth: true, autoFocus: true, multiline: true }), error ? _jsx("p", { role: "alert", children: error }) : null] }), _jsxs(DialogActions, { children: [_jsx(Button, { color: "primary", disabled: q.removing, onClick: quarantine, children: btnTxt }), _jsx(Button, { color: "secondary", onClick: () => setOpen(false), children: "Cancel" })] })] })] }));
200
220
  }
@@ -69,6 +69,7 @@ import { materialDialogOpen } from "../../cell-status/material-details.js";
69
69
  import { PrintLabelButton } from "./PrintedLabel.js";
70
70
  import { AddToQueueButton, AddToQueueMaterialDialogCt, } from "./QueuesAddMaterial.js";
71
71
  import { QuarantineMatButton } from "./QuarantineButton.js";
72
+ import { CancelLoadButton } from "./CancelLoadButton.js";
72
73
  import { AddByBarcodeDialog, scanBarcodeToAddToQueueDialog } from "../BarcodeScanning.js";
73
74
  import { InvalidateCycleDialogButton, InvalidateCycleDialogContent, } from "./InvalidateCycle.js";
74
75
  const JobTableRow = styled(TableRow, { shouldForwardProp: (prop) => prop.toString()[0] !== "$" })(({ $noBorderBottom, $highlightedRow, $noncompletedRow }) => ({
@@ -287,7 +288,7 @@ const QueuedMaterialDialog = memo(function QueuedMaterialDialog({ queueNames, })
287
288
  setInvalidateSt(null);
288
289
  }, []);
289
290
  queueNames = usePossibleQueuesForAdd(queueNames);
290
- return (_jsx(MaterialDialog, { allowNote: true, onClose: onClose, highlightProcsGreaterOrEqualTo: invalidateSt?.process ?? undefined, extraDialogElements: _jsxs(_Fragment, { children: [_jsx(InvalidateCycleDialogContent, { st: invalidateSt, setState: setInvalidateSt }), _jsx(AddToQueueMaterialDialogCt, { queueNames: queueNames, st: addMatSt, setState: setAddMatSt })] }), buttons: _jsxs(_Fragment, { children: [_jsx(PrintLabelButton, {}), _jsx(QuarantineMatButton, { onClose: onClose }), _jsx(InvalidateCycleDialogButton, { onClose: onClose, st: invalidateSt, setState: setInvalidateSt }), _jsx(AddToQueueButton, { st: addMatSt, queueNames: queueNames, onClose: onClose })] }) }));
291
+ return (_jsx(MaterialDialog, { allowNote: true, onClose: onClose, highlightProcsGreaterOrEqualTo: invalidateSt?.process ?? undefined, extraDialogElements: _jsxs(_Fragment, { children: [_jsx(InvalidateCycleDialogContent, { st: invalidateSt, setState: setInvalidateSt }), _jsx(AddToQueueMaterialDialogCt, { queueNames: queueNames, st: addMatSt, setState: setAddMatSt })] }), buttons: _jsxs(_Fragment, { children: [_jsx(PrintLabelButton, {}), _jsx(QuarantineMatButton, { onClose: onClose }), _jsx(CancelLoadButton, { onClose: onClose }), _jsx(InvalidateCycleDialogButton, { onClose: onClose, st: invalidateSt, setState: setInvalidateSt }), _jsx(AddToQueueButton, { st: addMatSt, queueNames: queueNames, onClose: onClose })] }) }));
291
292
  });
292
293
  export const Queues = (props) => {
293
294
  const operator = useAtomValue(currentOperator);
@@ -183,6 +183,7 @@ export function AddToQueueButton({ st: { enteredOperator, newMaterialTy, toQueue
183
183
  const [addExistingMat, addingExistingMat] = matDetails.useAddExistingMaterialToQueue();
184
184
  const [addNewMat, addingNewMat] = matDetails.useAddNewMaterialToQueue();
185
185
  const [addNewCasting, addingNewCasting] = useAddNewCastingToQueue();
186
+ const [addError, setAddError] = useState(null);
186
187
  const allowAdd = useAllowAddToQueue(queueNames);
187
188
  if (!allowAdd) {
188
189
  return null;
@@ -213,52 +214,62 @@ export function AddToQueueButton({ st: { enteredOperator, newMaterialTy, toQueue
213
214
  withSerialMsg = " With Serial " + newSerial;
214
215
  }
215
216
  const curQueue = inProcMat?.location.currentQueue ?? null;
216
- return (_jsx(_Fragment, { children: _jsx(Tooltip, { title: toQueue === null
217
- ? "Select a queue to add the material to"
218
- : fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
219
- (enteredOperator === null || enteredOperator === "")
220
- ? "Please enter an operator name"
221
- : "", children: _jsx("span", { children: _jsx(Button, { color: "primary", disabled: toQueue === null ||
222
- addingExistingMat ||
223
- addingNewMat ||
224
- addingNewCasting ||
225
- (existingMat === null && newMaterialTy === null) ||
226
- (fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
227
- (enteredOperator === null || enteredOperator === "")), onClick: () => {
228
- if (existingMat) {
229
- addExistingMat({
230
- materialId: existingMat.materialID,
231
- queue: toQueue ?? "",
232
- queuePosition: -1,
233
- operator: enteredOperator ?? operator,
234
- });
235
- }
236
- else if (newMaterialTy &&
237
- newMaterialTy.kind === "JobAndProc" &&
238
- newMaterialTy.jobUnique) {
239
- addNewMat({
240
- jobUnique: newMaterialTy.jobUnique,
241
- lastCompletedProcess: newMaterialTy.last_proc,
242
- serial: newSerial ?? undefined,
243
- workorder: newWorkorder ?? newMaterialTy?.workorder,
244
- queue: toQueue ?? "",
245
- queuePosition: -1,
246
- operator: enteredOperator ?? operator,
247
- });
248
- }
249
- else if (newMaterialTy &&
250
- newMaterialTy.kind === "RawMat" &&
251
- newMaterialTy.rawMatName) {
252
- addNewCasting({
253
- casting: newMaterialTy.rawMatName,
254
- quantity: 1,
255
- queue: toQueue ?? "",
256
- serials: newSerial ? [newSerial] : undefined,
257
- workorder: newWorkorder,
258
- operator: enteredOperator ?? operator,
259
- });
260
- }
261
- setMatToShow(null);
262
- onClose();
263
- }, children: toQueue === null ? ("Add to Queue") : (_jsxs("span", { children: [curQueue !== null ? `Move From ${curQueue} To` : "Add To", " ", toQueue, withSerialMsg, addProcMsg] })) }) }) }) }));
217
+ return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { title: toQueue === null
218
+ ? "Select a queue to add the material to"
219
+ : fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
220
+ (enteredOperator === null || enteredOperator === "")
221
+ ? "Please enter an operator name"
222
+ : "", children: _jsx("span", { children: _jsx(Button, { color: "primary", disabled: toQueue === null ||
223
+ addingExistingMat ||
224
+ addingNewMat ||
225
+ addingNewCasting ||
226
+ (existingMat === null && newMaterialTy === null) ||
227
+ (fmsInfo.requireOperatorNamePromptWhenAddingMaterial &&
228
+ (enteredOperator === null || enteredOperator === "")), onClick: async () => {
229
+ setAddError(null);
230
+ try {
231
+ if (existingMat) {
232
+ await addExistingMat({
233
+ materialId: existingMat.materialID,
234
+ queue: toQueue ?? "",
235
+ queuePosition: -1,
236
+ operator: enteredOperator ?? operator,
237
+ });
238
+ }
239
+ else if (newMaterialTy &&
240
+ newMaterialTy.kind === "JobAndProc" &&
241
+ newMaterialTy.jobUnique) {
242
+ await addNewMat({
243
+ jobUnique: newMaterialTy.jobUnique,
244
+ lastCompletedProcess: newMaterialTy.last_proc,
245
+ serial: newSerial ?? undefined,
246
+ workorder: newWorkorder ?? newMaterialTy?.workorder,
247
+ queue: toQueue ?? "",
248
+ queuePosition: -1,
249
+ operator: enteredOperator ?? operator,
250
+ });
251
+ }
252
+ else if (newMaterialTy &&
253
+ newMaterialTy.kind === "RawMat" &&
254
+ newMaterialTy.rawMatName) {
255
+ await addNewCasting({
256
+ casting: newMaterialTy.rawMatName,
257
+ quantity: 1,
258
+ queue: toQueue ?? "",
259
+ serials: newSerial ? [newSerial] : undefined,
260
+ workorder: newWorkorder,
261
+ operator: enteredOperator ?? operator,
262
+ });
263
+ }
264
+ setMatToShow(null);
265
+ onClose();
266
+ }
267
+ catch (e) {
268
+ setAddError(api.ApiException.isApiException(e)
269
+ ? e.response
270
+ : e instanceof Error
271
+ ? e.message
272
+ : String(e));
273
+ }
274
+ }, children: toQueue === null ? ("Add to Queue") : (_jsxs("span", { children: [curQueue !== null ? `Move From ${curQueue} To` : "Add To", " ", toQueue, withSerialMsg, addProcMsg] })) }) }) }), addError ? _jsx("p", { role: "alert", children: addError }) : null] }));
264
275
  }
@@ -43,6 +43,7 @@ import { last30Jobs } from "../../cell-status/scheduled-jobs.js";
43
43
  import { addDays } from "date-fns";
44
44
  import { durationToSeconds } from "../../util/parseISODuration.js";
45
45
  import { InvalidateCycleDialogButton, InvalidateCycleDialogContent, SwapMaterialButtons, SwapMaterialDialogContent, } from "./InvalidateCycle.js";
46
+ import { CancelLoadButton } from "./CancelLoadButton.js";
46
47
  import { QuarantineMatButton } from "./QuarantineButton.js";
47
48
  import { SelectInspTypeDialog, SignalInspectionButton } from "./SelectInspType.js";
48
49
  import { useSetTitle } from "../routes.js";
@@ -825,7 +826,7 @@ const SystemOverviewMaterialDialog = memo(function SystemOverviewMaterialDialog(
825
826
  setSwapSt(null);
826
827
  setInvalidateSt(null);
827
828
  }
828
- return (_jsx(MaterialDialog, { onClose: onClose, allowNote: true, highlightProcsGreaterOrEqualTo: invalidateSt?.process ?? undefined, extraDialogElements: _jsxs(_Fragment, { children: [_jsx(SwapMaterialDialogContent, { st: swapSt, setState: setSwapSt }), invalidateSt !== null ? (_jsx(InvalidateCycleDialogContent, { st: invalidateSt, setState: setInvalidateSt })) : null] }), buttons: _jsxs(_Fragment, { children: [_jsx(QuarantineMatButton, { ignoreOperator: ignoreOperator }), _jsx(SignalInspectionButton, {}), _jsx(SwapMaterialButtons, { st: swapSt, setState: setSwapSt, onClose: onClose, ignoreOperator: ignoreOperator }), _jsx(InvalidateCycleDialogButton, { st: invalidateSt, setState: setInvalidateSt, onClose: onClose, ignoreOperator: ignoreOperator })] }) }));
829
+ return (_jsx(MaterialDialog, { onClose: onClose, allowNote: true, highlightProcsGreaterOrEqualTo: invalidateSt?.process ?? undefined, extraDialogElements: _jsxs(_Fragment, { children: [_jsx(SwapMaterialDialogContent, { st: swapSt, setState: setSwapSt }), invalidateSt !== null ? (_jsx(InvalidateCycleDialogContent, { st: invalidateSt, setState: setInvalidateSt })) : null] }), buttons: _jsxs(_Fragment, { children: [_jsx(QuarantineMatButton, { ignoreOperator: ignoreOperator }), _jsx(CancelLoadButton, { onClose: onClose, ignoreOperator: ignoreOperator }), _jsx(SignalInspectionButton, {}), _jsx(SwapMaterialButtons, { st: swapSt, setState: setSwapSt, onClose: onClose, ignoreOperator: ignoreOperator }), _jsx(InvalidateCycleDialogButton, { st: invalidateSt, setState: setInvalidateSt, onClose: onClose, ignoreOperator: ignoreOperator })] }) }));
829
830
  });
830
831
  export function SystemOverviewPage({ ignoreOperator, whiteBackground, }) {
831
832
  useSetTitle("System Overview");
@@ -58,12 +58,12 @@ export const SortableRegion = memo(function SortableRegion(props) {
58
58
  const overMatId = over ? numericId(over.id) : null;
59
59
  if (over && active.id !== over.id && activeMatId !== null && overMatId !== null) {
60
60
  const overIdx = props.matIds.indexOf(overMatId);
61
- addExistingMatToQueue({
61
+ void addExistingMatToQueue({
62
62
  materialId: activeMatId,
63
63
  queue: props.queueName,
64
64
  queuePosition: overIdx,
65
65
  operator: operator,
66
- });
66
+ }).catch(console.error);
67
67
  reorderQueuedMat({
68
68
  queue: props.queueName,
69
69
  matId: activeMatId,
package/dist/index.html CHANGED
@@ -43,7 +43,7 @@
43
43
  }
44
44
  }
45
45
  </style>
46
- <script type="module" crossorigin src="/assets/index-BB3Eqktr.js"></script>
46
+ <script type="module" crossorigin src="/assets/index-CQhVwNX7.js"></script>
47
47
  <link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
48
48
  </head>
49
49
  <body>
@@ -53,6 +53,8 @@ export declare class JobsClient {
53
53
  protected processRemoveMaterialFromAllQueues(response: Response): Promise<void>;
54
54
  signalMaterialForQuarantine(materialId: number, operName: string | null | undefined, reason: string | undefined, signal?: AbortSignal): Promise<void>;
55
55
  protected processSignalMaterialForQuarantine(response: Response): Promise<void>;
56
+ cancelLoad(materialId: number, operName: string | null | undefined, request: CancelLoadRequest, signal?: AbortSignal): Promise<void>;
57
+ protected processCancelLoad(response: Response): Promise<void>;
56
58
  invalidatePalletCycle(materialId: number, operName: string | null | undefined, changeCastingTo: string | null | undefined, changeJobUniqueTo: string | null | undefined, process: number, signal?: AbortSignal): Promise<MaterialDetails>;
57
59
  protected processInvalidatePalletCycle(response: Response): Promise<MaterialDetails>;
58
60
  swapMaterialOnPallet(materialId: number, operName: string | null | undefined, mat: MatToPutOnPallet, signal?: AbortSignal): Promise<void>;
@@ -140,7 +142,6 @@ export declare class FMSInfo implements IFMSInfo {
140
142
  openIDConnectClientId?: string | undefined;
141
143
  usingLabelPrinterForSerials?: boolean | undefined;
142
144
  useClientPrinterForLabels?: boolean | undefined;
143
- allowQuarantineToCancelLoad?: boolean | undefined;
144
145
  quarantineQueue?: string | undefined;
145
146
  customStationMonitorDialogUrl?: string | undefined;
146
147
  supportsRebookings?: string | undefined;
@@ -172,7 +173,6 @@ export interface IFMSInfo {
172
173
  openIDConnectClientId?: string | undefined;
173
174
  usingLabelPrinterForSerials?: boolean | undefined;
174
175
  useClientPrinterForLabels?: boolean | undefined;
175
- allowQuarantineToCancelLoad?: boolean | undefined;
176
176
  quarantineQueue?: string | undefined;
177
177
  customStationMonitorDialogUrl?: string | undefined;
178
178
  supportsRebookings?: string | undefined;
@@ -722,7 +722,7 @@ export declare class CurrentStatus implements ICurrentStatus {
722
722
  [key: string]: BasketStatus;
723
723
  } | undefined;
724
724
  basketMoveInstructions?: BasketMoveInstruction[] | undefined;
725
- customState?: unknown | undefined;
725
+ customState?: any | undefined;
726
726
  constructor(data?: ICurrentStatus);
727
727
  init(_data?: any): void;
728
728
  static fromJS(data: any): CurrentStatus;
@@ -747,7 +747,7 @@ export interface ICurrentStatus {
747
747
  [key: string]: BasketStatus;
748
748
  } | undefined;
749
749
  basketMoveInstructions?: BasketMoveInstruction[] | undefined;
750
- customState?: unknown | undefined;
750
+ customState?: any | undefined;
751
751
  }
752
752
  export declare class HistoricJob extends Job implements IHistoricJob {
753
753
  scheduleId?: string | undefined;
@@ -905,6 +905,7 @@ export declare enum LocType {
905
905
  export declare class InProcessMaterialAction implements IInProcessMaterialAction {
906
906
  type: ActionType;
907
907
  workId?: string | undefined;
908
+ loadCancellationId?: string | undefined;
908
909
  loadOntoPalletNum?: number | undefined;
909
910
  loadOntoFace?: number | undefined;
910
911
  processAfterLoad?: number | undefined;
@@ -927,6 +928,7 @@ export declare class InProcessMaterialAction implements IInProcessMaterialAction
927
928
  export interface IInProcessMaterialAction {
928
929
  type: ActionType;
929
930
  workId?: string | undefined;
931
+ loadCancellationId?: string | undefined;
930
932
  loadOntoPalletNum?: number | undefined;
931
933
  loadOntoFace?: number | undefined;
932
934
  processAfterLoad?: number | undefined;
@@ -1369,6 +1371,18 @@ export interface IQueuePosition {
1369
1371
  queue: string;
1370
1372
  position: number;
1371
1373
  }
1374
+ export declare class CancelLoadRequest implements ICancelLoadRequest {
1375
+ expectedLoadCancellationId: string;
1376
+ reason?: string | undefined;
1377
+ constructor(data?: ICancelLoadRequest);
1378
+ init(_data?: any): void;
1379
+ static fromJS(data: any): CancelLoadRequest;
1380
+ toJSON(data?: any): any;
1381
+ }
1382
+ export interface ICancelLoadRequest {
1383
+ expectedLoadCancellationId: string;
1384
+ reason?: string | undefined;
1385
+ }
1372
1386
  export declare class MatToPutOnPallet implements IMatToPutOnPallet {
1373
1387
  pallet: number;
1374
1388
  materialIDToSetOnPallet: number;
@@ -853,6 +853,45 @@ export class JobsClient {
853
853
  }
854
854
  return Promise.resolve(null);
855
855
  }
856
+ cancelLoad(materialId, operName, request, signal) {
857
+ let url_ = this.baseUrl + "/api/v1/jobs/material/{materialId}/cancel-load?";
858
+ if (materialId === undefined || materialId === null)
859
+ throw new globalThis.Error("The parameter 'materialId' must be defined.");
860
+ url_ = url_.replace("{materialId}", encodeURIComponent("" + materialId));
861
+ if (operName !== undefined && operName !== null)
862
+ url_ += "operName=" + encodeURIComponent("" + operName) + "&";
863
+ url_ = url_.replace(/[?&]$/, "");
864
+ const content_ = JSON.stringify(request);
865
+ let options_ = {
866
+ body: content_,
867
+ method: "PUT",
868
+ signal,
869
+ headers: {
870
+ "Content-Type": "application/json",
871
+ },
872
+ };
873
+ return this.http.fetch(url_, options_).then((_response) => {
874
+ return this.processCancelLoad(_response);
875
+ });
876
+ }
877
+ processCancelLoad(response) {
878
+ const status = response.status;
879
+ let _headers = {};
880
+ if (response.headers && response.headers.forEach) {
881
+ response.headers.forEach((v, k) => (_headers[k] = v));
882
+ }
883
+ if (status === 200) {
884
+ return response.text().then((_responseText) => {
885
+ return;
886
+ });
887
+ }
888
+ else if (status !== 200 && status !== 204) {
889
+ return response.text().then((_responseText) => {
890
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
891
+ });
892
+ }
893
+ return Promise.resolve(null);
894
+ }
856
895
  invalidatePalletCycle(materialId, operName, changeCastingTo, changeJobUniqueTo, process, signal) {
857
896
  let url_ = this.baseUrl + "/api/v1/jobs/material/{materialId}/invalidate-process?";
858
897
  if (materialId === undefined || materialId === null)
@@ -2239,7 +2278,6 @@ export class FMSInfo {
2239
2278
  this.openIDConnectClientId = _data["OpenIDConnectClientId"];
2240
2279
  this.usingLabelPrinterForSerials = _data["UsingLabelPrinterForSerials"];
2241
2280
  this.useClientPrinterForLabels = _data["UseClientPrinterForLabels"];
2242
- this.allowQuarantineToCancelLoad = _data["AllowQuarantineToCancelLoad"];
2243
2281
  this.quarantineQueue = _data["QuarantineQueue"];
2244
2282
  this.customStationMonitorDialogUrl = _data["CustomStationMonitorDialogUrl"];
2245
2283
  this.supportsRebookings = _data["SupportsRebookings"];
@@ -2287,7 +2325,6 @@ export class FMSInfo {
2287
2325
  data["OpenIDConnectClientId"] = this.openIDConnectClientId;
2288
2326
  data["UsingLabelPrinterForSerials"] = this.usingLabelPrinterForSerials;
2289
2327
  data["UseClientPrinterForLabels"] = this.useClientPrinterForLabels;
2290
- data["AllowQuarantineToCancelLoad"] = this.allowQuarantineToCancelLoad;
2291
2328
  data["QuarantineQueue"] = this.quarantineQueue;
2292
2329
  data["CustomStationMonitorDialogUrl"] = this.customStationMonitorDialogUrl;
2293
2330
  data["SupportsRebookings"] = this.supportsRebookings;
@@ -3982,6 +4019,7 @@ export class InProcessMaterialAction {
3982
4019
  if (_data) {
3983
4020
  this.type = _data["Type"];
3984
4021
  this.workId = _data["WorkId"];
4022
+ this.loadCancellationId = _data["LoadCancellationId"];
3985
4023
  this.loadOntoPalletNum = _data["LoadOntoPalletNum"];
3986
4024
  this.loadOntoFace = _data["LoadOntoFace"];
3987
4025
  this.processAfterLoad = _data["ProcessAfterLoad"];
@@ -4008,6 +4046,7 @@ export class InProcessMaterialAction {
4008
4046
  data = typeof data === "object" ? data : {};
4009
4047
  data["Type"] = this.type;
4010
4048
  data["WorkId"] = this.workId;
4049
+ data["LoadCancellationId"] = this.loadCancellationId;
4011
4050
  data["LoadOntoPalletNum"] = this.loadOntoPalletNum;
4012
4051
  data["LoadOntoFace"] = this.loadOntoFace;
4013
4052
  data["ProcessAfterLoad"] = this.processAfterLoad;
@@ -5058,6 +5097,34 @@ export class QueuePosition {
5058
5097
  return data;
5059
5098
  }
5060
5099
  }
5100
+ export class CancelLoadRequest {
5101
+ constructor(data) {
5102
+ if (data) {
5103
+ for (var property in data) {
5104
+ if (data.hasOwnProperty(property))
5105
+ this[property] = data[property];
5106
+ }
5107
+ }
5108
+ }
5109
+ init(_data) {
5110
+ if (_data) {
5111
+ this.expectedLoadCancellationId = _data["ExpectedLoadCancellationId"];
5112
+ this.reason = _data["Reason"];
5113
+ }
5114
+ }
5115
+ static fromJS(data) {
5116
+ data = typeof data === "object" ? data : {};
5117
+ let result = new CancelLoadRequest();
5118
+ result.init(data);
5119
+ return result;
5120
+ }
5121
+ toJSON(data) {
5122
+ data = typeof data === "object" ? data : {};
5123
+ data["ExpectedLoadCancellationId"] = this.expectedLoadCancellationId;
5124
+ data["Reason"] = this.reason;
5125
+ return data;
5126
+ }
5127
+ }
5061
5128
  export class MatToPutOnPallet {
5062
5129
  constructor(data) {
5063
5130
  if (data) {
@@ -226,6 +226,9 @@ export function registerMockBackend(offsetSeconds, mockD, mockEvts) {
226
226
  signalMaterialForQuarantine() {
227
227
  return Promise.resolve();
228
228
  },
229
+ cancelLoad() {
230
+ return Promise.resolve();
231
+ },
229
232
  swapMaterialOnPallet() {
230
233
  return Promise.resolve();
231
234
  },
@@ -11,6 +11,7 @@ export interface JobAPI {
11
11
  addUnprocessedMaterialToQueue(jobUnique: string, lastCompletedProcess: number, queue: string, pos: number, operatorName: string | null, workorder: string | null, serial: string): Promise<Readonly<api.IInProcessMaterial> | undefined>;
12
12
  addUnallocatedCastingToQueue(castingName: string, queue: string, qty: number, operatrorName: string | null, workorder: string | null, serials: string[]): Promise<ReadonlyArray<Readonly<api.IInProcessMaterial>>>;
13
13
  signalMaterialForQuarantine(materialId: number, operName: string | null, reason: string | undefined): Promise<void>;
14
+ cancelLoad(materialId: number, operName: string | null, request: Readonly<api.ICancelLoadRequest>): Promise<void>;
14
15
  swapMaterialOnPallet(materialId: number, operName: string | null, mat: Readonly<api.IMatToPutOnPallet>): Promise<void>;
15
16
  invalidatePalletCycle(materialId: number, operName: string | null | undefined, changeCastingTo: string | null | undefined, changeJobUniqueTo: string | null | undefined, process: number): Promise<Readonly<api.IMaterialDetails> | null | undefined>;
16
17
  unscheduledRebookings(signal?: AbortSignal): Promise<ReadonlyArray<Readonly<api.IRebooking>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedtactics/insight-client",
3
- "version": "16.8.4-beta.10",
3
+ "version": "16.8.4-beta.11",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "url": "https://github.com/SeedTactics/fms-insight"