@seedtactics/insight-client 17.0.1-beta.9 → 17.0.1

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.
Files changed (60) hide show
  1. package/README.md +16 -4
  2. package/dist/assets/ProgramHighlight-mKbZxoXO.js +3 -0
  3. package/dist/assets/index-CfHZxY5F.js +367 -0
  4. package/dist/cell-status/current-status.d.ts +1 -0
  5. package/dist/cell-status/current-status.js +2 -0
  6. package/dist/cell-status/loading.d.ts +13 -0
  7. package/dist/cell-status/loading.js +36 -3
  8. package/dist/cell-status/material-details.d.ts +2 -2
  9. package/dist/cell-status/material-details.js +33 -14
  10. package/dist/components/App.d.ts +0 -5
  11. package/dist/components/App.js +1 -1
  12. package/dist/components/ChooseMode.js +15 -3
  13. package/dist/components/ErrorsAndLoading.js +2 -1
  14. package/dist/components/LoadingIcon.js +3 -1
  15. package/dist/components/analysis/BufferChart.js +3 -2
  16. package/dist/components/operations/AllMaterial.js +9 -12
  17. package/dist/components/operations/RecentCycleChart.js +16 -21
  18. package/dist/components/quality/QualityMaterial.js +3 -12
  19. package/dist/components/station-monitor/BasketLoadStationWork.d.ts +4 -7
  20. package/dist/components/station-monitor/BasketLoadStationWork.js +79 -44
  21. package/dist/components/station-monitor/CancelLoadButton.js +8 -3
  22. package/dist/components/station-monitor/InvalidateCycle.js +26 -25
  23. package/dist/components/station-monitor/LoadStation.d.ts +0 -5
  24. package/dist/components/station-monitor/LoadStation.js +88 -115
  25. package/dist/components/station-monitor/Material.d.ts +6 -1
  26. package/dist/components/station-monitor/Material.js +22 -9
  27. package/dist/components/station-monitor/MoveMaterialArrows.js +9 -0
  28. package/dist/components/station-monitor/PrintedLabel.js +15 -19
  29. package/dist/components/station-monitor/QuarantineButton.js +21 -29
  30. package/dist/components/station-monitor/QueuesAddMaterial.js +2 -5
  31. package/dist/components/station-monitor/SystemOverview.js +59 -19
  32. package/dist/components/station-monitor/Whiteboard.js +14 -15
  33. package/dist/data/material-operation-policy.d.ts +6 -0
  34. package/dist/data/material-operation-policy.js +26 -2
  35. package/dist/data/move-arrows.d.ts +7 -0
  36. package/dist/data/move-arrows.js +107 -24
  37. package/dist/data/queue-material.d.ts +1 -0
  38. package/dist/data/queue-material.js +55 -48
  39. package/dist/extension.d.ts +1 -1
  40. package/dist/extension.js +1 -0
  41. package/dist/index.html +2 -39
  42. package/dist/index.js +1 -6
  43. package/dist/network/api-errors.d.ts +8 -0
  44. package/dist/network/api-errors.js +77 -0
  45. package/dist/network/api.d.ts +18 -34
  46. package/dist/network/api.js +66 -64
  47. package/dist/network/backend-mock.js +3 -0
  48. package/dist/network/backend.d.ts +1 -0
  49. package/dist/network/websocket.d.ts +1 -0
  50. package/dist/network/websocket.js +124 -36
  51. package/dist/util/parseISODuration.js +10 -9
  52. package/docs/material-quarantine.md +5 -4
  53. package/docs/mazak.md +11 -14
  54. package/docs/operator-procedures.md +14 -0
  55. package/docs/server-config.md +20 -12
  56. package/package.json +25 -20
  57. package/dist/assets/ProgramHighlight-C6zSEXCX.js +0 -3
  58. package/dist/assets/index-MFZreX-b.js +0 -388
  59. package/dist/components/station-monitor/BasketMovementArrival.d.ts +0 -40
  60. package/dist/components/station-monitor/BasketMovementArrival.js +0 -165
@@ -31,13 +31,14 @@ 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 { useMemo, memo, useState, useCallback, useEffect } from "react";
34
+ import { useMemo, memo, useState, useCallback } from "react";
35
35
  import { Box, useMediaQuery, Button, Typography } from "@mui/material";
36
36
  import { LazySeq, OrderedMap } from "@seedtactics/immutable-collections";
37
37
  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";
@@ -48,7 +49,7 @@ import { instructionUrl } from "../../network/backend.js";
48
49
  import { Tooltip } from "@mui/material";
49
50
  import { Fab } from "@mui/material";
50
51
  import { fmsInformation } from "../../network/server-settings.js";
51
- import { currentStatus, secondsSinceEpochAtom } from "../../cell-status/current-status.js";
52
+ import { currentStatus, secondsSinceEpochAtom, minutesSinceEpochAtom, } from "../../cell-status/current-status.js";
52
53
  import { useIsDemo, useSetTitle } from "../routes.js";
53
54
  import { QuarantineMatButton } from "./QuarantineButton.js";
54
55
  import { CancelLoadButton } from "./CancelLoadButton.js";
@@ -60,11 +61,10 @@ 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
- import { BasketLoadStationWorkflow, } from "./BasketLoadStationWork.js";
67
- import { BasketMovementArrival, loadStationArrivalInstruction, } from "./BasketMovementArrival.js";
67
+ import { BasketLoadStationWorkflow } from "./BasketLoadStationWork.js";
68
68
  function encodeLoadStationRegionIdPart(value) {
69
69
  return encodeURIComponent(value.toString());
70
70
  }
@@ -317,6 +317,15 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
317
317
  .toRArray().length
318
318
  : 0;
319
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;
320
329
  return {
321
330
  pallet: pal,
322
331
  activeBasket,
@@ -326,7 +335,7 @@ function selectLoadStationAndQueueProps(loadNum, queues, curSt, hideNonLoading)
326
335
  queues: sortedQueueMat,
327
336
  baskets: sortedBasketMat,
328
337
  elapsedLoadingTime,
329
- fsize: layoutCount <= 2 ? "x-large" : layoutCount <= 6 ? "large" : "normal",
338
+ fsize: layoutCount > 6 || widestBasketSlot >= 3 ? "normal" : layoutCount <= 2 ? "x-large" : "large",
330
339
  };
331
340
  }
332
341
  function MultiInstructionButton({ loadData }) {
@@ -386,29 +395,21 @@ function ElapsedLoadTime({ elapsedLoadTime }) {
386
395
  const secondsSinceEpoch = useAtomValue(secondsSinceEpochAtom);
387
396
  if (elapsedLoadTime) {
388
397
  const elapsedSecsInCurSt = durationToSeconds(elapsedLoadTime);
389
- const elapsedSecs = elapsedSecsInCurSt + (secondsSinceEpoch - Math.floor(currentStTime.getTime() / 1000));
390
- return _jsx("span", { children: formatSeconds(elapsedSecs) });
398
+ const elapsedSecs = elapsedSecsInCurSt + (secondsSinceEpoch - currentStTime.getTime() / 1000);
399
+ return _jsx("span", { children: formatSeconds(Math.max(0, elapsedSecs)) });
391
400
  }
392
401
  else {
393
402
  return null;
394
403
  }
395
404
  }
396
- function PalletFace({ data, faceNum, loadNum, submitBasketLoadStationCommand, }) {
405
+ function PalletFace({ data, faceNum }) {
397
406
  const face = data.face.get(faceNum);
398
407
  const fmsInfo = useAtomValue(fmsInformation);
399
408
  const basketName = basketDisplayName(fmsInfo.basketName);
400
409
  if (!face)
401
410
  return null;
402
411
  if (data.activeBasket && !data.pallet) {
403
- return (_jsxs("div", { "data-testid": "load-station-active-basket", children: [faceNum === 1 ? (_jsxs(Box, { sx: {
404
- display: "grid",
405
- gridTemplateColumns: "1fr auto",
406
- }, children: [_jsxs(Typography, { variant: "h4", children: [basketName, " ", data.activeBasket.basketId] }), _jsx(Box, { sx: {
407
- justifySelf: "flex-end",
408
- }, children: _jsx(ElapsedLoadTime, { elapsedLoadTime: data.elapsedLoadingTime }) })] })) : null, _jsx(Box, { sx: { ml: "4em", mr: "4em" }, children: _jsx(MoveMaterialArrowNode, { kind: {
409
- type: MoveMaterialNodeKindType.BasketZone,
410
- basketId: data.activeBasket.basketId,
411
- }, children: _jsx(BasketLoadStationWorkflow, { stationNumber: loadNum, basket: data.activeBasket, material: data.allMaterial, fsize: data.fsize, submitCommand: submitBasketLoadStationCommand }) }) })] }));
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 }) }) }));
412
413
  }
413
414
  if (!data.pallet)
414
415
  return null;
@@ -425,24 +426,31 @@ function PalletFace({ data, faceNum, loadNum, submitBasketLoadStationCommand, })
425
426
  }, children: _jsx(Typography, { variant: "h6", children: data.pallet.faceNames?.[faceNum - 1] ?? `Face ${faceNum}` }) })) : undefined, _jsx(Box, { sx: {
426
427
  ml: "4em",
427
428
  mr: "4em",
428
- }, children: _jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.PalletFaceZone, face: faceNum }, children: _jsx(Box, { sx: {
429
+ }, children: _jsx(MoveMaterialArrowNode, { kind: {
430
+ type: MoveMaterialNodeKindType.PalletFaceZone,
431
+ palletNum: data.pallet.palletNum,
432
+ face: faceNum,
433
+ }, children: _jsx(Box, { sx: {
429
434
  display: "flex",
430
435
  flexWrap: "wrap",
431
436
  justifyContent: "space-around",
432
437
  }, children: face.map((m, idx) => (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.Material, material: m }, children: _jsx(InProcMaterial, { mat: m, fsize: data.fsize }) }, idx))) }) }) })] }));
433
438
  }
434
439
  function MaterialRegion({ data, mat, }) {
435
- return (_jsxs("div", { children: [mat.label !== "" ? _jsx(Typography, { variant: "h4", children: mat.label }) : null, mat.material.mats.map((m, matIdx) => (_jsx(MoveMaterialArrowNode, { kind: {
436
- type: MoveMaterialNodeKindType.Material,
437
- material: m,
438
- identifier: m.materialID < 0
439
- ? `raw-${mat.isFree ? "free" : "queue"}-${mat.label}-${matIdx}`
440
- : undefined,
441
- }, children: mat.isFree || mat.sortable === false ? (_jsx(InProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, fsize: data.fsize, showRawMaterial: true, showJobComment: true })) : (_jsx(SortableInProcMaterial, { mat: m, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, shake: m.action.type === api.ActionType.Loading &&
442
- m.action.loadOntoPalletNum === data.pallet?.palletNum, fsize: m.action.type === api.ActionType.Loading &&
443
- m.action.loadOntoPalletNum === data.pallet?.palletNum
444
- ? data.fsize
445
- : undefined, showRawMaterial: true, showJobComment: true })) }, matIdx))), mat.material.hiddenCnt > 0 ? (_jsxs(Typography, { variant: "body2", color: "textSecondary", sx: {
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: {
446
454
  textAlign: "center",
447
455
  mt: "0.5em",
448
456
  }, children: ["+", mat.material.hiddenCnt, " hidden"] })) : null] }));
@@ -453,15 +461,15 @@ function BasketRegion({ data, label, baskets, }) {
453
461
  pt: idx === 0 ? undefined : "1em",
454
462
  }, children: [_jsx(Typography, { variant: "h6", sx: {
455
463
  mb: "0.5em",
456
- }, children: basket.label }), _jsx(MoveMaterialArrowNode, { kind: {
464
+ }, children: basket.label }), _jsxs(MoveMaterialArrowNode, { kind: {
457
465
  type: MoveMaterialNodeKindType.BasketZone,
458
466
  basketId: basket.basketId,
459
- }, children: _jsx(MaterialRegion, { data: data, mat: {
460
- label: "",
461
- material: basket.material,
462
- isFree: false,
463
- sortable: false,
464
- } }) })] }, basket.basketId)))] }));
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)))] }));
465
473
  }
466
474
  function MaterialColumn({ data, region, }) {
467
475
  switch (region.kind) {
@@ -473,8 +481,7 @@ function MaterialColumn({ data, region, }) {
473
481
  sortable: false,
474
482
  } }) }));
475
483
  case "queue":
476
- return (_jsx(MoveMaterialArrowNode, { kind: { type: MoveMaterialNodeKindType.QueueZone, queue: region.label }, children: _jsx(SortableRegion, { matIds: region.material.mats.map((m) => m.materialID), direction: "vertical", queueName: region.label, renderDragOverlay: (mat) => (_jsx(DragOverlayInProcMaterial, { mat: mat, displayActionForSinglePallet: data.pallet ? data.pallet.palletNum : 0, fsize: mat.action.type === api.ActionType.Loading &&
477
- 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)
478
485
  ? data.fsize
479
486
  : undefined })), children: _jsx(MaterialRegion, { data: data, mat: {
480
487
  label: region.label,
@@ -487,16 +494,17 @@ function MaterialColumn({ data, region, }) {
487
494
  }
488
495
  }
489
496
  function RecentCompletedMaterial() {
497
+ const minutes = useAtomValue(minutesSinceEpochAtom);
490
498
  const matSummary = useAtomValue(last30MaterialSummary);
491
499
  const recentCompleted = useMemo(() => {
492
- const cutoff = addHours(new Date(), -5);
500
+ const cutoff = addHours(new Date(minutes * 60000), -5);
493
501
  return matSummary.matsById
494
502
  .valuesToLazySeq()
495
503
  .filter((e) => e.completed_last_proc_machining === true &&
496
504
  e.last_unload_time !== undefined &&
497
505
  e.last_unload_time >= cutoff)
498
506
  .toSortedArray({ desc: (e) => e.last_unload_time?.getTime() ?? 0 });
499
- }, [matSummary]);
507
+ }, [matSummary, minutes]);
500
508
  return (_jsx("div", { children: recentCompleted.map((m, idx) => (_jsx(MatSummary, { mat: m }, idx))) }));
501
509
  }
502
510
  const CompletedCol = memo(function CompletedCol({ fillViewPort, showMaterial, }) {
@@ -603,11 +611,7 @@ function AddMatButton({ queues, onClose, toQueue, showAddToQueue, setShowAddToQu
603
611
  onClose();
604
612
  }
605
613
  catch (e) {
606
- setAddError(api.ApiException.isApiException(e)
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
  }
@@ -679,23 +683,6 @@ export function LoadStation(props) {
679
683
  const currentSt = useAtomValue(currentStatus);
680
684
  const hideNonLoading = useAtomValue(hideNonLoadingMaterialOnLoadStation);
681
685
  const data = useMemo(() => selectLoadStationAndQueueProps(props.loadNum, props.queues, currentSt, hideNonLoading), [currentSt, props.loadNum, props.queues, hideNonLoading]);
682
- const arrivalInstruction = loadStationArrivalInstruction(currentSt.basketMoveInstructions ?? [], props.loadNum);
683
- const [recentArrivalReceipt, setRecentArrivalReceipt] = useState();
684
- useEffect(() => {
685
- if (recentArrivalReceipt !== undefined &&
686
- (recentArrivalReceipt.stationNumber !== props.loadNum ||
687
- (arrivalInstruction !== undefined &&
688
- arrivalInstruction.instructionId !== recentArrivalReceipt.instruction.instructionId))) {
689
- // This state is an ephemeral receipt; discard it permanently when a new instruction supersedes it.
690
- // oxlint-disable-next-line react/set-state-in-effect -- intentional invalidation of stale UI state.
691
- setRecentArrivalReceipt(undefined);
692
- }
693
- }, [arrivalInstruction, props.loadNum, recentArrivalReceipt]);
694
- const displayedArrivalInstruction = arrivalInstruction ?? recentArrivalReceipt?.instruction;
695
- const displayedArrivalReceipt = recentArrivalReceipt?.stationNumber === props.loadNum &&
696
- displayedArrivalInstruction?.instructionId === recentArrivalReceipt?.instruction.instructionId
697
- ? recentArrivalReceipt
698
- : undefined;
699
686
  const queueCols = LazySeq.of(data.queues)
700
687
  .sortBy(([q]) => q)
701
688
  .map(([q, mats]) => ({
@@ -709,11 +696,19 @@ export function LoadStation(props) {
709
696
  const baskets = LazySeq.of(data.baskets)
710
697
  .filter(([b]) => b !== data.activeBasket?.basketId)
711
698
  .sortBy(([b]) => b)
712
- .map(([b, mats]) => ({
713
- basketId: b,
714
- label: `${basketName} ${b}`,
715
- material: mats,
716
- }))
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
+ })
717
712
  .toRArray();
718
713
  if (baskets.length > 0) {
719
714
  matCols.push({
@@ -742,53 +737,31 @@ export function LoadStation(props) {
742
737
  horizontal: fillViewPort,
743
738
  showMatInCompleted: props.completed,
744
739
  });
745
- return (_jsxs(_Fragment, { children: [displayedArrivalInstruction === undefined ? null : (_jsx(BasketMovementArrival, { basketName: basketName, instruction: displayedArrivalInstruction, stationNumber: props.loadNum, submitCommand: props.submitBasketMovementCompletion, submitCorrection: props.submitBasketLocationCorrection, receipt: displayedArrivalReceipt, onAccepted: setRecentArrivalReceipt, onCorrected: (command) => setRecentArrivalReceipt((current) => {
746
- if (current === undefined ||
747
- current.stationNumber !== props.loadNum ||
748
- current.receipt.observationId !== command.targetObservationId)
749
- return current;
750
- return command.replacementBasketId === null ||
751
- command.replacementObservationId === null
752
- ? { ...current, status: "retracted" }
753
- : {
754
- ...current,
755
- receipt: {
756
- ...current.receipt,
757
- observationId: command.replacementObservationId,
758
- observedBasketId: command.replacementBasketId,
759
- },
760
- command: {
761
- ...current.command,
762
- commandId: command.replacementObservationId,
763
- observedBasketId: command.replacementBasketId,
764
- },
765
- status: "corrected",
766
- };
767
- }) })), _jsx(MoveMaterialArrowContainer, { hideArrows: !fillViewPort, whiteBackground: props.whiteBackground, children: _jsxs(Box, { component: "main", sx: {
768
- width: "100%",
769
- display: "grid",
770
- gridTemplate: grid,
771
- minHeight: {
772
- xs: "calc(100vh - 64px - 32px)",
773
- sm: "calc(100vh - 64px - 40px)",
774
- md: "calc(100vh - 64px)",
775
- },
776
- padding: fillViewPort ? undefined : "8px",
777
- }, children: [matCols.map((col, idx) => (_jsx(Box, { "data-testid": materialColumnTestId(col), sx: {
778
- gridArea: `mat${idx}`,
779
- padding: "8px",
780
- borderRight: fillViewPort ? "1px solid black" : undefined,
781
- borderBottom: !fillViewPort ? "1px solid black" : undefined,
782
- }, children: _jsx(MaterialColumn, { data: data, region: col }) }, idx))), data.face.keysToAscLazySeq().map((faceNum, idx) => (_jsx(Box, { sx: {
783
- marginLeft: "15px",
784
- gridArea: `palface${idx}`,
785
- padding: "8px",
786
- borderTop: data.pallet && idx !== 0 ? "1px solid black" : undefined,
787
- }, children: _jsx(PalletFace, { data: data, faceNum: faceNum, loadNum: props.loadNum, submitBasketLoadStationCommand: props.submitBasketLoadStationCommand }) }, faceNum))), _jsx(Box, { "data-testid": "load-station-completed", sx: {
788
- borderLeft: fillViewPort ? "1px solid black" : undefined,
789
- borderTop: !fillViewPort ? "1px solid black" : undefined,
790
- gridArea: "completed",
791
- }, children: _jsx(CompletedCol, { fillViewPort: fillViewPort, showMaterial: props.completed }) }), _jsx(MultiInstructionButton, { loadData: data }), _jsx(SelectWorkorderDialog, {}), _jsx(SelectInspTypeDialog, {}), _jsx(LoadMatDialog, { pallet: data.pallet?.palletNum ?? null, queues: props.queues })] }) })] }));
740
+ return (_jsx(_Fragment, { children: _jsx(MoveMaterialArrowContainer, { hideArrows: !fillViewPort, whiteBackground: props.whiteBackground, children: _jsxs(Box, { component: "main", sx: {
741
+ width: "100%",
742
+ display: "grid",
743
+ gridTemplate: grid,
744
+ minHeight: {
745
+ xs: "calc(100vh - 64px - 32px)",
746
+ sm: "calc(100vh - 64px - 40px)",
747
+ md: "calc(100vh - 64px)",
748
+ },
749
+ padding: fillViewPort ? undefined : "8px",
750
+ }, children: [matCols.map((col, idx) => (_jsx(Box, { "data-testid": materialColumnTestId(col), sx: {
751
+ gridArea: `mat${idx}`,
752
+ padding: "8px",
753
+ borderRight: fillViewPort ? "1px solid black" : undefined,
754
+ borderBottom: !fillViewPort ? "1px solid black" : undefined,
755
+ }, children: _jsx(MaterialColumn, { data: data, region: col }) }, idx))), data.face.keysToAscLazySeq().map((faceNum, idx) => (_jsx(Box, { sx: {
756
+ marginLeft: "15px",
757
+ gridArea: `palface${idx}`,
758
+ padding: "8px",
759
+ borderTop: data.pallet && idx !== 0 ? "1px solid black" : undefined,
760
+ }, children: _jsx(PalletFace, { data: data, faceNum: faceNum }) }, faceNum))), _jsx(Box, { "data-testid": "load-station-completed", sx: {
761
+ borderLeft: fillViewPort ? "1px solid black" : undefined,
762
+ borderTop: !fillViewPort ? "1px solid black" : undefined,
763
+ gridArea: "completed",
764
+ }, children: _jsx(CompletedCol, { fillViewPort: fillViewPort, showMaterial: props.completed }) }), _jsx(MultiInstructionButton, { loadData: data }), _jsx(SelectWorkorderDialog, {}), _jsx(SelectInspTypeDialog, {}), _jsx(LoadMatDialog, { pallet: data.pallet?.palletNum ?? null, queues: props.queues })] }) }) }));
792
765
  }
793
766
  function LoadStationCheckWidth(props) {
794
767
  const fmsInfo = useAtomValue(fmsInformation);
@@ -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;
@@ -49,7 +49,7 @@ import { useAtom, useAtomValue, useSetAtom } from "jotai";
49
49
  import { last30Rebookings } from "../../cell-status/rebookings.js";
50
50
  import { fmsInformation } from "../../network/server-settings.js";
51
51
  import { basketDisplayName, basketSlotLabel } from "../../cell-status/station-cycles.js";
52
- import { materialOperationState } from "../../data/material-operation-policy.js";
52
+ import { canAddOrMoveMaterialToQueue, canReorderQueuedMaterial, materialOperationState, } from "../../data/material-operation-policy.js";
53
53
  export class PartIdenticon extends PureComponent {
54
54
  render() {
55
55
  const iconSize = this.props.size || 50;
@@ -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, " to completed material"] }));
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,13 +410,15 @@ 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) {
416
+ const canDrag = canReorderQueuedMaterial(props.mat) || canAddOrMoveMaterialToQueue(props.mat);
405
417
  const d = { mat: props.mat };
406
418
  const { active, isDragging, attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, } = useSortable({
407
419
  id: props.mat.materialID,
408
420
  data: d,
421
+ disabled: { draggable: !canDrag },
409
422
  });
410
423
  const handleProps = {
411
424
  ...listeners,
@@ -421,10 +434,10 @@ export const SortableInProcMaterial = memo(function SortableInProcMaterial(props
421
434
  : undefined,
422
435
  transition: active !== null ? transition : undefined,
423
436
  };
424
- return (_jsx(MatCard, { ref: setNodeRef, dragRootProps: { style }, showDragHandle: true, 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 }));
425
438
  });
426
439
  export function DragOverlayInProcMaterial(props) {
427
- 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 }));
428
441
  }
429
442
  export const MultiMaterial = memo(function MultiMaterial(props) {
430
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: {
@@ -46,6 +46,15 @@ function elementToRect(e) {
46
46
  };
47
47
  }
48
48
  function arrowToPath(arr) {
49
+ if (arr.type === "loop") {
50
+ // almost a full circle, from the lower left over the top to the lower right, so the arrow
51
+ // head points back at the start
52
+ const point = (degrees) => {
53
+ const radians = (degrees * Math.PI) / 180;
54
+ return `${arr.centerX + arr.radius * Math.cos(radians)} ${arr.centerY + arr.radius * Math.sin(radians)}`;
55
+ };
56
+ return `M ${point(120)} A ${arr.radius} ${arr.radius} 0 1 1 ${point(60)}`;
57
+ }
49
58
  // mid point of line
50
59
  const mpx = (arr.fromX + arr.toX) / 2;
51
60
  const mpy = (arr.fromY + arr.toY) / 2;
@@ -34,7 +34,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34
34
  import { useRef, useCallback, useEffect, useMemo, Fragment } from "react";
35
35
  import JsBarcode from "jsbarcode";
36
36
  import { LazySeq } from "@seedtactics/immutable-collections";
37
- import { currentStatus } from "../../cell-status/current-status.js";
37
+ import { currentStatus, secondsSinceEpochAtom } from "../../cell-status/current-status.js";
38
38
  import { useAtomValue } from "jotai";
39
39
  import { useReactToPrint } from "react-to-print";
40
40
  import { Button } from "@mui/material";
@@ -60,16 +60,20 @@ function Barcode(props) {
60
60
  }, [props.text]);
61
61
  return _jsx("svg", { ref: setRef });
62
62
  }
63
+ function LabelDate() {
64
+ const seconds = useAtomValue(secondsSinceEpochAtom);
65
+ return new Date(seconds * 1000).toLocaleString(undefined, {
66
+ weekday: "long",
67
+ month: "long",
68
+ day: "numeric",
69
+ year: "numeric",
70
+ hour: "numeric",
71
+ minute: "2-digit",
72
+ second: "2-digit",
73
+ });
74
+ }
63
75
  function SinglePage(props) {
64
- return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: new Date().toLocaleString(undefined, {
65
- weekday: "long",
66
- month: "long",
67
- day: "numeric",
68
- year: "numeric",
69
- hour: "numeric",
70
- minute: "2-digit",
71
- second: "2-digit",
72
- }) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.partName }), props.count >= 2 ? _jsx(Barcode, { text: props.count.toString() }) : undefined] }), props.serial1 && props.serial1 !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.serial1 }), props.serial2 && props.serial2 !== "" ? (_jsx(Barcode, { text: props.serial2 || "" })) : undefined] })) : undefined, _jsx("div", { style: { marginTop: "2em", marginLeft: "4em", marginRight: "4em", marginBottom: "9em" }, children: props.uniq === null || props.uniq === "" ? (_jsx("p", { style: { fontSize: "x-large" }, children: "Not currently assigned to any jobs" })) : (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), _jsxs("div", { style: { marginTop: "1em", marginLeft: "2em", display: "flex", alignItems: "center" }, children: [_jsx(Barcode, { text: props.partName }), _jsxs("h3", { style: { marginLeft: "4em" }, children: ["assigned to ", props.uniq, props.jobCycles && props.jobCycles > 0
76
+ return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: _jsx(LabelDate, {}) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.partName }), props.count >= 2 ? _jsx(Barcode, { text: props.count.toString() }) : undefined] }), props.serial1 && props.serial1 !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.serial1 }), props.serial2 && props.serial2 !== "" ? (_jsx(Barcode, { text: props.serial2 || "" })) : undefined] })) : undefined, _jsx("div", { style: { marginTop: "2em", marginLeft: "4em", marginRight: "4em", marginBottom: "9em" }, children: props.uniq === null || props.uniq === "" ? (_jsx("p", { style: { fontSize: "x-large" }, children: "Not currently assigned to any jobs" })) : (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), _jsxs("div", { style: { marginTop: "1em", marginLeft: "2em", display: "flex", alignItems: "center" }, children: [_jsx(Barcode, { text: props.partName }), _jsxs("h3", { style: { marginLeft: "4em" }, children: ["assigned to ", props.uniq, props.jobCycles && props.jobCycles > 0
73
77
  ? " (" + props.jobCycles.toString() + " scheduled)"
74
78
  : ""] })] })] })) }), props.note ? (_jsx("div", { style: { marginBottom: "2em" }, children: _jsx("p", { style: { fontSize: "xxx-large", textAlign: "center" }, children: props.note }) })) : undefined, _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: props.operator ? _jsx("p", { style: { fontSize: "x-large" }, children: props.operator }) : undefined })] }));
75
79
  }
@@ -114,15 +118,7 @@ function CombinedToOnePage(props) {
114
118
  if (!props.material || props.material.length === 0) {
115
119
  return _jsx("div", {});
116
120
  }
117
- return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: new Date().toLocaleString(undefined, {
118
- weekday: "long",
119
- month: "long",
120
- day: "numeric",
121
- year: "numeric",
122
- hour: "numeric",
123
- minute: "2-digit",
124
- second: "2-digit",
125
- }) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.material[0].partName }), props.material.length >= 2 ? (_jsx(Barcode, { text: props.material.length.toString() })) : undefined] }), props.material[0].serial && props.material[0].serial !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.material[0].serial }), props.material.length >= 2 &&
121
+ return (_jsxs("div", { children: [_jsx("div", { style: { marginTop: "4em", display: "flex", justifyContent: "center" }, children: _jsx("h2", { children: "SeedTactic: FMS Insight" }) }), _jsx("div", { style: { display: "flex", justifyContent: "center" }, children: _jsx("p", { style: { fontSize: "x-large" }, children: _jsx(LabelDate, {}) }) }), _jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.materialName ?? props.material[0].partName }), props.material.length >= 2 ? (_jsx(Barcode, { text: props.material.length.toString() })) : undefined] }), props.material[0].serial && props.material[0].serial !== "" ? (_jsxs("div", { style: { marginTop: "2em", display: "flex", justifyContent: "space-around" }, children: [_jsx(Barcode, { text: props.material[0].serial }), props.material.length >= 2 &&
126
122
  props.material[props.material.length - 1].serial &&
127
123
  props.material[props.material.length - 1].serial !== "" ? (_jsx(Barcode, { text: props.material[props.material.length - 1].serial || "" })) : undefined] })) : undefined, _jsx("div", { style: { marginTop: "2em", marginLeft: "4em", marginRight: "4em", marginBottom: "9em" }, children: assignments.length === 0 ? (_jsx("p", { style: { fontSize: "x-large" }, children: "Not currently assigned to any jobs" })) : props.materialName ? (_jsxs(_Fragment, { children: [_jsx("p", { style: { fontSize: "x-large" }, children: "Assigned To" }), assignments.map(([uniq, part], idx) => (_jsxs("div", { style: {
128
124
  marginTop: "1em",