@uipath/apollo-react 3.65.3 → 3.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,14 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
2
  import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, closestCenter, useSensor, useSensors } from "@dnd-kit/core";
3
3
  import { SortableContext, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
4
4
  import { FontVariantToken, Icon, Padding, Spacing } from "@uipath/apollo-core";
5
5
  import { Column, Row } from "../../layouts/index.js";
6
6
  import { Position, useStore, useViewport } from "../../xyflow/react.js";
7
- import { ApIcon, ApIconButton, ApLink, ApTooltip, ApTypography } from "../../../material/index.js";
7
+ import { ApCircularProgress, ApIcon, ApIconButton, ApLink, ApTooltip, ApTypography } from "../../../material/index.js";
8
+ import debounce from "debounce";
8
9
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
9
10
  import { createPortal } from "react-dom";
11
+ import { EntryConditionIcon, ExitConditionIcon, PlayIcon, ReturnToOriginIcon } from "../../icons/index.js";
10
12
  import { useConnectedHandles } from "../BaseCanvas/ConnectedHandlesContext.js";
11
13
  import { useButtonHandles } from "../ButtonHandle/useButtonHandles.js";
12
14
  import { ExecutionStatusIcon } from "../ExecutionStatusIcon/index.js";
@@ -14,9 +16,8 @@ import { FloatingCanvasPanel } from "../FloatingCanvasPanel/index.js";
14
16
  import { NodeContextMenu } from "../NodeContextMenu/index.js";
15
17
  import { useNodeSelection } from "../NodePropertiesPanel/hooks/index.js";
16
18
  import { Toolbox } from "../Toolbox/index.js";
17
- import { EntryConditionIcon, ExitConditionIcon, ReturnToOriginIcon } from "../../icons/index.js";
18
19
  import { DraggableTask, TaskContent } from "./DraggableTask.js";
19
- import { INDENTATION_WIDTH, STAGE_CONTENT_INSET, StageChip, StageContainer, StageContent, StageHeader, StageHeaderChipsRow, StageParallelBracket, StageParallelLabel, StageTask, StageTaskGroup, StageTaskList, StageTitleContainer, StageTitleInput } from "./StageNode.styles.js";
20
+ import { INDENTATION_WIDTH, STAGE_CONTENT_INSET, StageAdhocHeaderSection, StageAdhocSection, StageChip, StageContainer, StageContent, StageHeader, StageHeaderChipsRow, StageParallelBracket, StageParallelLabel, StageTask, StageTaskGroup, StageTaskList, StageTitleContainer, StageTitleInput } from "./StageNode.styles.js";
20
21
  import { StageHeaderChipType } from "./StageNode.types.js";
21
22
  import { flattenTasks, getProjection, reorderTasks } from "./StageNode.utils.js";
22
23
  import { getContextMenuItems, getDivider, getMenuItem } from "./StageNodeTaskUtilities.js";
@@ -42,12 +43,65 @@ const CHIP_ICONS = {
42
43
  size: Icon.IconXs
43
44
  })
44
45
  };
46
+ const AdhocTaskPlayButton = /*#__PURE__*/ memo(({ taskId, onTaskPlay })=>{
47
+ const [playLoading, setPlayLoading] = useState(false);
48
+ const debouncedTaskPlay = useMemo(()=>debounce(async (id)=>{
49
+ setPlayLoading(true);
50
+ try {
51
+ await onTaskPlay(id);
52
+ } catch {} finally{
53
+ setPlayLoading(false);
54
+ }
55
+ }, 500, {
56
+ immediate: true
57
+ }), [
58
+ onTaskPlay
59
+ ]);
60
+ const handlePlayClick = useCallback((e)=>{
61
+ e.stopPropagation();
62
+ e.preventDefault();
63
+ debouncedTaskPlay(taskId);
64
+ }, [
65
+ debouncedTaskPlay,
66
+ taskId
67
+ ]);
68
+ return /*#__PURE__*/ jsx(ApTooltip, {
69
+ content: "Trigger task",
70
+ placement: "top",
71
+ children: /*#__PURE__*/ jsx(ApIconButton, {
72
+ "data-testid": `stage-task-play-${taskId}`,
73
+ onClick: handlePlayClick,
74
+ onMouseDown: (e)=>e.stopPropagation(),
75
+ onKeyDown: (e)=>e.stopPropagation(),
76
+ className: "task-menu-icon-button",
77
+ sx: {
78
+ color: 'var(--uix-canvas-primary) !important',
79
+ minWidth: 'unset !important',
80
+ width: `${Spacing.SpacingL} !important`,
81
+ height: `${Spacing.SpacingL} !important`,
82
+ padding: '0 !important'
83
+ },
84
+ children: playLoading ? /*#__PURE__*/ jsx(ApCircularProgress, {
85
+ size: 20
86
+ }) : /*#__PURE__*/ jsx(PlayIcon, {
87
+ w: 20,
88
+ h: 20
89
+ })
90
+ })
91
+ });
92
+ });
45
93
  const StageNodeComponent = (props)=>{
46
94
  const { dragging, selected, id, width, execution, stageDetails, addTaskLabel = 'Add task', addTaskLoading = false, replaceTaskLabel = 'Replace task', taskOptions = [], menuItems, pendingReplaceTask, onStageClick, onTaskAdd, onAddTaskFromToolbox, onTaskToolboxSearch, onTaskClick, onTaskGroupModification, onStageTitleChange, onTaskReorder, onReplaceTaskFromToolbox, onTaskPlay, hideParallelOptions } = props;
47
95
  const taskWidth = width ? width - STAGE_CONTENT_INSET : void 0;
48
- const tasks = useMemo(()=>stageDetails?.tasks || [], [
96
+ const allTasks = useMemo(()=>stageDetails?.tasks || [], [
49
97
  stageDetails?.tasks
50
98
  ]);
99
+ const tasks = useMemo(()=>allTasks.filter((group)=>group.some((t)=>!t.isAdhoc)), [
100
+ allTasks
101
+ ]);
102
+ const adhocTasks = useMemo(()=>allTasks.flat().filter((t)=>t.isAdhoc), [
103
+ allTasks
104
+ ]);
51
105
  const flatTasks = useMemo(()=>tasks.flat(), [
52
106
  tasks
53
107
  ]);
@@ -86,14 +140,14 @@ const StageNodeComponent = (props)=>{
86
140
  const [isReplacingTask, setIsReplacingTask] = useState(false);
87
141
  useEffect(()=>{
88
142
  if (pendingReplaceTask) {
89
- const match = tasks.flatMap((group, gi)=>group.map((task, ti)=>({
143
+ const match = allTasks.flatMap((group, gi)=>group.map((task, ti)=>({
90
144
  task,
91
145
  groupIndex: gi,
92
146
  taskIndex: ti
93
147
  }))).find(({ task })=>task.id === selectedTaskId);
94
148
  if (match) {
95
149
  taskStateReference.current = {
96
- isParallel: (tasks[match.groupIndex]?.length ?? 0) > 1,
150
+ isParallel: (allTasks[match.groupIndex]?.length ?? 0) > 1,
97
151
  groupIndex: match.groupIndex,
98
152
  taskIndex: match.taskIndex
99
153
  };
@@ -103,7 +157,7 @@ const StageNodeComponent = (props)=>{
103
157
  }, [
104
158
  pendingReplaceTask,
105
159
  selectedTaskId,
106
- tasks
160
+ allTasks
107
161
  ]);
108
162
  const [activeDragId, setActiveDragId] = useState(null);
109
163
  const [offsetLeft, setOffsetLeft] = useState(0);
@@ -488,7 +542,7 @@ const StageNodeComponent = (props)=>{
488
542
  }),
489
543
  /*#__PURE__*/ jsxs(Row, {
490
544
  gap: Spacing.SpacingMicro,
491
- align: isReadOnly ? 'start' : 'center',
545
+ align: "start",
492
546
  py: Padding.PadS,
493
547
  children: [
494
548
  status && /*#__PURE__*/ jsx(ApTooltip, {
@@ -524,85 +578,7 @@ const StageNodeComponent = (props)=>{
524
578
  ]
525
579
  }),
526
580
  /*#__PURE__*/ jsx(StageContent, {
527
- children: tasks && 0 !== tasks.length ? /*#__PURE__*/ jsxs(DndContext, {
528
- collisionDetection: closestCenter,
529
- sensors: sensors,
530
- onDragStart: handleDragStart,
531
- onDragMove: handleDragMove,
532
- onDragOver: handleDragOver,
533
- onDragEnd: handleDragEnd,
534
- onDragCancel: handleDragCancel,
535
- children: [
536
- /*#__PURE__*/ jsx(SortableContext, {
537
- items: taskIds,
538
- strategy: verticalListSortingStrategy,
539
- children: /*#__PURE__*/ jsx(StageTaskList, {
540
- className: "nodrag nopan",
541
- children: tasks.map((taskGroup, groupIndex)=>{
542
- const isParallel = taskGroup.length > 1;
543
- return /*#__PURE__*/ jsxs(Row, {
544
- gap: Spacing.SpacingS,
545
- children: [
546
- isParallel && /*#__PURE__*/ jsx(StageParallelBracket, {}),
547
- /*#__PURE__*/ jsxs(StageTaskGroup, {
548
- isParallel: isParallel,
549
- children: [
550
- isParallel && /*#__PURE__*/ jsx(StageParallelLabel, {
551
- children: /*#__PURE__*/ jsx(ApTypography, {
552
- variant: FontVariantToken.fontSizeS,
553
- children: "Parallel"
554
- })
555
- }),
556
- taskGroup.map((task, taskIndex)=>{
557
- const taskExecution = execution?.taskStatus?.[task.id];
558
- return /*#__PURE__*/ jsx(DraggableTask, {
559
- task: task,
560
- taskExecution: taskExecution,
561
- isSelected: selectedTaskId === task.id,
562
- isParallel: isParallel,
563
- contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
564
- onTaskClick: handleTaskClick,
565
- projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
566
- onTaskPlay: onTaskPlay,
567
- isDragDisabled: !onTaskReorder,
568
- zoom: zoom,
569
- ...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
570
- onMenuOpen: ()=>{
571
- taskStateReference.current = {
572
- isParallel,
573
- groupIndex,
574
- taskIndex
575
- };
576
- }
577
- }
578
- }, task.id);
579
- })
580
- ]
581
- })
582
- ]
583
- }, `group-${groupIndex}`);
584
- })
585
- })
586
- }),
587
- /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx(DragOverlay, {
588
- children: activeTask ? /*#__PURE__*/ jsx("div", {
589
- style: dragOverlayStyle,
590
- children: /*#__PURE__*/ jsx(StageTask, {
591
- selected: true,
592
- isParallel: isActiveTaskParallel,
593
- style: {
594
- cursor: 'grabbing',
595
- ...taskWidthStyle
596
- },
597
- children: /*#__PURE__*/ jsx(TaskContent, {
598
- task: activeTask,
599
- isDragging: true
600
- })
601
- })
602
- }) : null
603
- }), document.body)
604
- ]
605
- }) : /*#__PURE__*/ jsx(Column, {
581
+ children: 0 === tasks.length && 0 === adhocTasks.length ? /*#__PURE__*/ jsx(Column, {
606
582
  py: 2,
607
583
  children: (onTaskAdd || onAddTaskFromToolbox) && !isReadOnly ? /*#__PURE__*/ jsx(ApLink, {
608
584
  onClick: addTaskLoading ? void 0 : handleTaskAddClick,
@@ -617,6 +593,119 @@ const StageNodeComponent = (props)=>{
617
593
  color: "var(--uix-canvas-foreground-de-emp)",
618
594
  children: defaultContent
619
595
  })
596
+ }) : /*#__PURE__*/ jsxs(Fragment, {
597
+ children: [
598
+ tasks.length > 0 && /*#__PURE__*/ jsxs(DndContext, {
599
+ collisionDetection: closestCenter,
600
+ sensors: sensors,
601
+ onDragStart: handleDragStart,
602
+ onDragMove: handleDragMove,
603
+ onDragOver: handleDragOver,
604
+ onDragEnd: handleDragEnd,
605
+ onDragCancel: handleDragCancel,
606
+ children: [
607
+ /*#__PURE__*/ jsx(SortableContext, {
608
+ items: taskIds,
609
+ strategy: verticalListSortingStrategy,
610
+ children: /*#__PURE__*/ jsx(StageTaskList, {
611
+ className: "nodrag nopan",
612
+ children: tasks.map((taskGroup, groupIndex)=>{
613
+ const isParallel = taskGroup.length > 1;
614
+ return /*#__PURE__*/ jsxs(Row, {
615
+ gap: Spacing.SpacingS,
616
+ children: [
617
+ isParallel && /*#__PURE__*/ jsx(StageParallelBracket, {}),
618
+ /*#__PURE__*/ jsxs(StageTaskGroup, {
619
+ isParallel: isParallel,
620
+ children: [
621
+ isParallel && /*#__PURE__*/ jsx(StageParallelLabel, {
622
+ children: /*#__PURE__*/ jsx(ApTypography, {
623
+ variant: FontVariantToken.fontSizeS,
624
+ children: "Parallel"
625
+ })
626
+ }),
627
+ taskGroup.map((task, taskIndex)=>{
628
+ const taskExecution = execution?.taskStatus?.[task.id];
629
+ return /*#__PURE__*/ jsx(DraggableTask, {
630
+ task: task,
631
+ taskExecution: taskExecution,
632
+ isSelected: selectedTaskId === task.id,
633
+ isParallel: isParallel,
634
+ contextMenuItems: contextMenuItems(isParallel, groupIndex, taskIndex, tasks.length, taskGroup.length, (tasks[groupIndex - 1]?.length ?? 0) > 1, (tasks[groupIndex + 1]?.length ?? 0) > 1),
635
+ onTaskClick: handleTaskClick,
636
+ projectedDepth: task.id === activeDragId && projected ? projected.depth : void 0,
637
+ isDragDisabled: !onTaskReorder,
638
+ zoom: zoom,
639
+ ...(onTaskGroupModification || onReplaceTaskFromToolbox) && {
640
+ onMenuOpen: ()=>{
641
+ taskStateReference.current = {
642
+ isParallel,
643
+ groupIndex,
644
+ taskIndex
645
+ };
646
+ }
647
+ }
648
+ }, task.id);
649
+ })
650
+ ]
651
+ })
652
+ ]
653
+ }, `group-${groupIndex}`);
654
+ })
655
+ })
656
+ }),
657
+ /*#__PURE__*/ createPortal(/*#__PURE__*/ jsx(DragOverlay, {
658
+ children: activeTask ? /*#__PURE__*/ jsx("div", {
659
+ style: dragOverlayStyle,
660
+ children: /*#__PURE__*/ jsx(StageTask, {
661
+ selected: true,
662
+ isParallel: isActiveTaskParallel,
663
+ style: {
664
+ cursor: 'grabbing',
665
+ ...taskWidthStyle
666
+ },
667
+ children: /*#__PURE__*/ jsx(TaskContent, {
668
+ task: activeTask,
669
+ isDragging: true
670
+ })
671
+ })
672
+ }) : null
673
+ }), document.body)
674
+ ]
675
+ }),
676
+ adhocTasks.length > 0 && /*#__PURE__*/ jsxs(StageAdhocSection, {
677
+ children: [
678
+ /*#__PURE__*/ jsx(StageAdhocHeaderSection, {
679
+ children: /*#__PURE__*/ jsx(ApTypography, {
680
+ variant: FontVariantToken.fontSizeSBold,
681
+ color: "var(--uix-canvas-foreground-de-emp)",
682
+ children: "Adhoc tasks"
683
+ })
684
+ }),
685
+ /*#__PURE__*/ jsx(StageTaskList, {
686
+ children: adhocTasks.map((task)=>{
687
+ const taskExecution = execution?.taskStatus?.[task.id];
688
+ return /*#__PURE__*/ jsxs(StageTask, {
689
+ "data-testid": `stage-task-${task.id}`,
690
+ selected: selectedTaskId === task.id,
691
+ status: taskExecution?.status,
692
+ onClick: (e)=>handleTaskClick(e, task.id),
693
+ children: [
694
+ /*#__PURE__*/ jsx(TaskContent, {
695
+ task: task,
696
+ taskExecution: taskExecution
697
+ }),
698
+ onTaskPlay && /*#__PURE__*/ jsx(AdhocTaskPlayButton, {
699
+ taskId: task.id,
700
+ onTaskPlay: onTaskPlay
701
+ })
702
+ ]
703
+ }, task.id);
704
+ })
705
+ })
706
+ ]
707
+ })
708
+ ]
620
709
  })
621
710
  })
622
711
  ]
@@ -2184,7 +2184,8 @@ const AdhocTasks = {
2184
2184
  {
2185
2185
  id: '3',
2186
2186
  label: 'Regular Task',
2187
- icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ProcessIcon, {})
2187
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ProcessIcon, {}),
2188
+ hasEntryCondition: true
2188
2189
  }
2189
2190
  ]
2190
2191
  ]
@@ -2434,6 +2435,142 @@ const WithRulesTags = {
2434
2435
  onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2435
2436
  onTaskAdd: ()=>window.alert('Add task')
2436
2437
  }
2438
+ },
2439
+ {
2440
+ id: '5',
2441
+ type: 'stage',
2442
+ position: {
2443
+ x: 48,
2444
+ y: 400
2445
+ },
2446
+ width: 304,
2447
+ data: {
2448
+ stageDetails: {
2449
+ label: 'No chips (comparison)',
2450
+ tasks: [
2451
+ [
2452
+ {
2453
+ id: 't8',
2454
+ label: 'Verify applicant identity',
2455
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
2456
+ }
2457
+ ],
2458
+ [
2459
+ {
2460
+ id: 't9',
2461
+ label: 'Pull credit report',
2462
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {})
2463
+ }
2464
+ ]
2465
+ ]
2466
+ },
2467
+ onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2468
+ onTaskAdd: ()=>window.alert('Add task')
2469
+ }
2470
+ },
2471
+ {
2472
+ id: '6',
2473
+ type: 'stage',
2474
+ position: {
2475
+ x: 400,
2476
+ y: 400
2477
+ },
2478
+ width: 304,
2479
+ data: {
2480
+ stageDetails: {
2481
+ label: 'ReadOnly + completed + chips',
2482
+ isReadOnly: true,
2483
+ tasks: [
2484
+ [
2485
+ {
2486
+ id: 't10',
2487
+ label: 'Verify applicant identity',
2488
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
2489
+ }
2490
+ ],
2491
+ [
2492
+ {
2493
+ id: 't11',
2494
+ label: 'Pull credit report',
2495
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {})
2496
+ }
2497
+ ]
2498
+ ],
2499
+ headerChips: [
2500
+ {
2501
+ type: external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Entry,
2502
+ count: 1,
2503
+ tooltip: 'Entry rules',
2504
+ onClick: ()=>window.alert('Open entry rules panel')
2505
+ },
2506
+ {
2507
+ type: external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Exit,
2508
+ count: 3,
2509
+ tooltip: 'Exit rules',
2510
+ onClick: ()=>window.alert('Open exit rules panel')
2511
+ }
2512
+ ]
2513
+ },
2514
+ execution: {
2515
+ stageStatus: {
2516
+ status: 'Completed',
2517
+ label: 'Completed',
2518
+ duration: 'SLA: 4h'
2519
+ }
2520
+ }
2521
+ }
2522
+ },
2523
+ {
2524
+ id: '7',
2525
+ type: 'stage',
2526
+ position: {
2527
+ x: 752,
2528
+ y: 400
2529
+ },
2530
+ width: 304,
2531
+ data: {
2532
+ stageDetails: {
2533
+ label: 'ReadOnly + in progress + chips',
2534
+ isReadOnly: true,
2535
+ tasks: [
2536
+ [
2537
+ {
2538
+ id: 't12',
2539
+ label: 'Verify applicant identity',
2540
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(VerificationIcon, {})
2541
+ }
2542
+ ],
2543
+ [
2544
+ {
2545
+ id: 't13',
2546
+ label: 'Pull credit report',
2547
+ icon: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DocumentIcon, {})
2548
+ }
2549
+ ]
2550
+ ],
2551
+ headerChips: [
2552
+ {
2553
+ type: external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Entry,
2554
+ count: 2,
2555
+ tooltip: 'Entry rules',
2556
+ onClick: ()=>window.alert('Open entry rules panel')
2557
+ },
2558
+ {
2559
+ type: external_StageNode_types_cjs_namespaceObject.StageHeaderChipType.Exit,
2560
+ count: 1,
2561
+ tooltip: 'Exit rules',
2562
+ onClick: ()=>window.alert('Open exit rules panel')
2563
+ }
2564
+ ]
2565
+ },
2566
+ execution: {
2567
+ stageStatus: {
2568
+ status: 'InProgress',
2569
+ label: 'In progress',
2570
+ duration: 'SLA: 2h'
2571
+ }
2572
+ }
2573
+ }
2437
2574
  }
2438
2575
  ]
2439
2576
  },
@@ -1 +1 @@
1
- {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAoHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA2HF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA0KF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAiHxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KA+I3B,CAAC"}
1
+ {"version":3,"file":"StageNode.stories.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNode.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAyBvD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA0FD,CAAC;AAEjC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AA4CnC,eAAO,MAAM,OAAO,EAAE,KAoHrB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAsE3B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8M7B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KA+HvC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KAoKpC,CAAC;AA8GF,eAAO,MAAM,uBAAuB,EAAE,KAOrC,CAAC;AAkVF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA2HF,eAAO,MAAM,kBAAkB,EAAE,KAOhC,CAAC;AA0KF,eAAO,MAAM,cAAc,EAAE,KAO5B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAwHxB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAkO3B,CAAC"}
@@ -2145,7 +2145,8 @@ const AdhocTasks = {
2145
2145
  {
2146
2146
  id: '3',
2147
2147
  label: 'Regular Task',
2148
- icon: /*#__PURE__*/ jsx(ProcessIcon, {})
2148
+ icon: /*#__PURE__*/ jsx(ProcessIcon, {}),
2149
+ hasEntryCondition: true
2149
2150
  }
2150
2151
  ]
2151
2152
  ]
@@ -2395,6 +2396,142 @@ const WithRulesTags = {
2395
2396
  onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2396
2397
  onTaskAdd: ()=>window.alert('Add task')
2397
2398
  }
2399
+ },
2400
+ {
2401
+ id: '5',
2402
+ type: 'stage',
2403
+ position: {
2404
+ x: 48,
2405
+ y: 400
2406
+ },
2407
+ width: 304,
2408
+ data: {
2409
+ stageDetails: {
2410
+ label: 'No chips (comparison)',
2411
+ tasks: [
2412
+ [
2413
+ {
2414
+ id: 't8',
2415
+ label: 'Verify applicant identity',
2416
+ icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2417
+ }
2418
+ ],
2419
+ [
2420
+ {
2421
+ id: 't9',
2422
+ label: 'Pull credit report',
2423
+ icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2424
+ }
2425
+ ]
2426
+ ]
2427
+ },
2428
+ onTaskClick: (taskId)=>window.alert(`Task clicked: ${taskId}`),
2429
+ onTaskAdd: ()=>window.alert('Add task')
2430
+ }
2431
+ },
2432
+ {
2433
+ id: '6',
2434
+ type: 'stage',
2435
+ position: {
2436
+ x: 400,
2437
+ y: 400
2438
+ },
2439
+ width: 304,
2440
+ data: {
2441
+ stageDetails: {
2442
+ label: 'ReadOnly + completed + chips',
2443
+ isReadOnly: true,
2444
+ tasks: [
2445
+ [
2446
+ {
2447
+ id: 't10',
2448
+ label: 'Verify applicant identity',
2449
+ icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2450
+ }
2451
+ ],
2452
+ [
2453
+ {
2454
+ id: 't11',
2455
+ label: 'Pull credit report',
2456
+ icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2457
+ }
2458
+ ]
2459
+ ],
2460
+ headerChips: [
2461
+ {
2462
+ type: StageHeaderChipType.Entry,
2463
+ count: 1,
2464
+ tooltip: 'Entry rules',
2465
+ onClick: ()=>window.alert('Open entry rules panel')
2466
+ },
2467
+ {
2468
+ type: StageHeaderChipType.Exit,
2469
+ count: 3,
2470
+ tooltip: 'Exit rules',
2471
+ onClick: ()=>window.alert('Open exit rules panel')
2472
+ }
2473
+ ]
2474
+ },
2475
+ execution: {
2476
+ stageStatus: {
2477
+ status: 'Completed',
2478
+ label: 'Completed',
2479
+ duration: 'SLA: 4h'
2480
+ }
2481
+ }
2482
+ }
2483
+ },
2484
+ {
2485
+ id: '7',
2486
+ type: 'stage',
2487
+ position: {
2488
+ x: 752,
2489
+ y: 400
2490
+ },
2491
+ width: 304,
2492
+ data: {
2493
+ stageDetails: {
2494
+ label: 'ReadOnly + in progress + chips',
2495
+ isReadOnly: true,
2496
+ tasks: [
2497
+ [
2498
+ {
2499
+ id: 't12',
2500
+ label: 'Verify applicant identity',
2501
+ icon: /*#__PURE__*/ jsx(VerificationIcon, {})
2502
+ }
2503
+ ],
2504
+ [
2505
+ {
2506
+ id: 't13',
2507
+ label: 'Pull credit report',
2508
+ icon: /*#__PURE__*/ jsx(DocumentIcon, {})
2509
+ }
2510
+ ]
2511
+ ],
2512
+ headerChips: [
2513
+ {
2514
+ type: StageHeaderChipType.Entry,
2515
+ count: 2,
2516
+ tooltip: 'Entry rules',
2517
+ onClick: ()=>window.alert('Open entry rules panel')
2518
+ },
2519
+ {
2520
+ type: StageHeaderChipType.Exit,
2521
+ count: 1,
2522
+ tooltip: 'Exit rules',
2523
+ onClick: ()=>window.alert('Open exit rules panel')
2524
+ }
2525
+ ]
2526
+ },
2527
+ execution: {
2528
+ stageStatus: {
2529
+ status: 'InProgress',
2530
+ label: 'In progress',
2531
+ duration: 'SLA: 2h'
2532
+ }
2533
+ }
2534
+ }
2398
2535
  }
2399
2536
  ]
2400
2537
  },