@uipath/apollo-react 4.12.1 → 4.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/StageNode/DraggableTask.cjs +3 -2
- package/dist/canvas/components/StageNode/DraggableTask.js +3 -2
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts +1 -1
- package/dist/canvas/components/StageNode/DraggableTask.types.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.cjs +11 -25
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.d.ts +5 -5
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeAdhocTaskGroups.js +11 -25
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.cjs +50 -7
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeAllTaskGroups.js +50 -7
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.cjs +11 -25
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.d.ts +5 -5
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.js +11 -25
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.cjs +27 -20
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.d.ts +6 -5
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeSequentialTaskGroups.js +28 -21
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.cjs +11 -11
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts +11 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.d.ts.map +1 -1
- package/dist/canvas/components/StageNode/StageNodeTaskUtilities.js +11 -11
- package/package.json +1 -1
|
@@ -50,11 +50,12 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
50
50
|
}, []);
|
|
51
51
|
const handleGetContextMenuItems = (0, external_react_namespaceObject.useCallback)(()=>{
|
|
52
52
|
if (!getContextMenuItems) return [];
|
|
53
|
-
return getContextMenuItems(groupIndex, taskIndex);
|
|
53
|
+
return getContextMenuItems(groupIndex, taskIndex, task.id);
|
|
54
54
|
}, [
|
|
55
55
|
getContextMenuItems,
|
|
56
56
|
groupIndex,
|
|
57
|
-
taskIndex
|
|
57
|
+
taskIndex,
|
|
58
|
+
task.id
|
|
58
59
|
]);
|
|
59
60
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = (0, sortable_namespaceObject.useSortable)({
|
|
60
61
|
id: task.id,
|
|
@@ -22,11 +22,12 @@ const DraggableTaskComponent = ({ task, taskExecution, isSelected, isParallel, g
|
|
|
22
22
|
}, []);
|
|
23
23
|
const handleGetContextMenuItems = useCallback(()=>{
|
|
24
24
|
if (!getContextMenuItems) return [];
|
|
25
|
-
return getContextMenuItems(groupIndex, taskIndex);
|
|
25
|
+
return getContextMenuItems(groupIndex, taskIndex, task.id);
|
|
26
26
|
}, [
|
|
27
27
|
getContextMenuItems,
|
|
28
28
|
groupIndex,
|
|
29
|
-
taskIndex
|
|
29
|
+
taskIndex,
|
|
30
|
+
task.id
|
|
30
31
|
]);
|
|
31
32
|
const { attributes, listeners, setNodeRef, transition, transform, isDragging } = useSortable({
|
|
32
33
|
id: task.id,
|
|
@@ -7,7 +7,7 @@ export interface DraggableTaskProps {
|
|
|
7
7
|
isParallel: boolean;
|
|
8
8
|
groupIndex: number;
|
|
9
9
|
taskIndex: number;
|
|
10
|
-
getContextMenuItems?: (groupIndex: number, taskIndex: number) => NodeMenuItem[];
|
|
10
|
+
getContextMenuItems?: (groupIndex: number, taskIndex: number, taskId: string) => NodeMenuItem[];
|
|
11
11
|
onTaskClick: (e: React.MouseEvent, taskId: string) => void;
|
|
12
12
|
onTaskPlay?: (taskId: string) => Promise<void>;
|
|
13
13
|
isDragDisabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,YAAY,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"DraggableTask.types.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/DraggableTask.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE3E,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,CAAC;IACpB,aAAa,CAAC,EAAE,kBAAkB,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,YAAY,EAAE,CAAC;IAChG,WAAW,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB"}
|
|
@@ -28,34 +28,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
-
const GroupModificationUtils_cjs_namespaceObject = require("../../utils/GroupModificationUtils.cjs");
|
|
32
31
|
const external_AdhocTask_cjs_namespaceObject = require("./AdhocTask.cjs");
|
|
33
32
|
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const getAdhocContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex, taskId)=>{
|
|
33
|
+
const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask })=>{
|
|
34
|
+
const { execution, onTaskGroupModification, onReplaceTaskFromToolbox, onTaskPlay, loadingTaskIds } = props;
|
|
35
|
+
const getAdhocContextMenuItems = (0, external_react_namespaceObject.useCallback)((taskId)=>{
|
|
38
36
|
const items = [];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
taskIndex
|
|
44
|
-
};
|
|
45
|
-
onTaskClick?.(taskId);
|
|
46
|
-
setIsReplacingTask(true);
|
|
47
|
-
}));
|
|
48
|
-
if (onTaskGroupModification) {
|
|
49
|
-
if (items.length > 0) items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
50
|
-
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_TASK, groupIndex, taskIndex)));
|
|
51
|
-
}
|
|
37
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, false);
|
|
38
|
+
if (replaceTaskMenuItem) items.push(replaceTaskMenuItem);
|
|
39
|
+
const deleteTaskMenuItem = generateDeleteTaskMenuItemForTask(taskId);
|
|
40
|
+
if (deleteTaskMenuItem) items.push(deleteTaskMenuItem);
|
|
52
41
|
return items;
|
|
53
42
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
onTaskGroupModification,
|
|
57
|
-
setIsReplacingTask,
|
|
58
|
-
taskStateReference
|
|
43
|
+
generateReplaceTaskMenuItemForTask,
|
|
44
|
+
generateDeleteTaskMenuItemForTask
|
|
59
45
|
]);
|
|
60
46
|
if (0 === adhocTasks.length) return null;
|
|
61
47
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageAdditionalTasksSection, {
|
|
@@ -70,7 +56,7 @@ const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selected
|
|
|
70
56
|
})
|
|
71
57
|
}),
|
|
72
58
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
|
|
73
|
-
children: adhocTasks.map(({ task
|
|
59
|
+
children: adhocTasks.map(({ task })=>{
|
|
74
60
|
const taskExecution = execution?.taskStatus?.[task.id];
|
|
75
61
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AdhocTask_cjs_namespaceObject.AdhocTaskItem, {
|
|
76
62
|
task: task,
|
|
@@ -80,7 +66,7 @@ const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selected
|
|
|
80
66
|
onTaskPlay: onTaskPlay,
|
|
81
67
|
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
82
68
|
...(onTaskGroupModification || onReplaceTaskFromToolbox) && !isReadOnly && {
|
|
83
|
-
getContextMenuItems: ()=>getAdhocContextMenuItems(
|
|
69
|
+
getContextMenuItems: ()=>getAdhocContextMenuItems(task.id)
|
|
84
70
|
}
|
|
85
71
|
}, task.id);
|
|
86
72
|
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { StageNodeProps, StageTaskGroup
|
|
3
|
-
export declare const StageNodeAdhocTaskGroups: import("react").MemoExoticComponent<({ props, adhocTasks, isReadOnly, selectedTaskId,
|
|
1
|
+
import type { NodeMenuItem } from '../NodeContextMenu';
|
|
2
|
+
import type { StageNodeProps, StageTaskGroup } from './StageNode.types';
|
|
3
|
+
export declare const StageNodeAdhocTaskGroups: import("react").MemoExoticComponent<({ props, adhocTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask, }: {
|
|
4
4
|
props: StageNodeProps;
|
|
5
5
|
adhocTasks: StageTaskGroup[];
|
|
6
6
|
isReadOnly: boolean;
|
|
7
7
|
selectedTaskId?: string;
|
|
8
|
-
taskStateReference: RefObject<TaskStateReference>;
|
|
9
8
|
marginTop: string;
|
|
10
9
|
handleTaskClick: (e: React.MouseEvent, taskElementId: string) => void;
|
|
11
|
-
|
|
10
|
+
generateReplaceTaskMenuItemForTask: (taskId: string, isParallel: boolean) => NodeMenuItem | undefined;
|
|
11
|
+
generateDeleteTaskMenuItemForTask: (taskId: string) => NodeMenuItem | undefined;
|
|
12
12
|
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
13
13
|
//# sourceMappingURL=StageNodeAdhocTaskGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNodeAdhocTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeAdhocTaskGroups.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StageNodeAdhocTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeAdhocTaskGroups.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAqFxE,eAAO,MAAM,wBAAwB,8LA1ElC;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,kCAAkC,EAAE,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,KAChB,YAAY,GAAG,SAAS,CAAC;IAC9B,iCAAiC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;CACjF,oDA8D0E,CAAC"}
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from "react";
|
|
3
|
-
import { GroupModificationType } from "../../utils/GroupModificationUtils.js";
|
|
4
3
|
import { AdhocTaskItem } from "./AdhocTask.js";
|
|
5
4
|
import { StageAdditionalTasksHeaderSection, StageAdditionalTasksSection, StageTaskList } from "./StageNode.styles.js";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const getAdhocContextMenuItems = useCallback((groupIndex, taskIndex, taskId)=>{
|
|
5
|
+
const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask })=>{
|
|
6
|
+
const { execution, onTaskGroupModification, onReplaceTaskFromToolbox, onTaskPlay, loadingTaskIds } = props;
|
|
7
|
+
const getAdhocContextMenuItems = useCallback((taskId)=>{
|
|
10
8
|
const items = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
taskIndex
|
|
16
|
-
};
|
|
17
|
-
onTaskClick?.(taskId);
|
|
18
|
-
setIsReplacingTask(true);
|
|
19
|
-
}));
|
|
20
|
-
if (onTaskGroupModification) {
|
|
21
|
-
if (items.length > 0) items.push(getDivider());
|
|
22
|
-
items.push(getMenuItem('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationType.REMOVE_TASK, groupIndex, taskIndex)));
|
|
23
|
-
}
|
|
9
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, false);
|
|
10
|
+
if (replaceTaskMenuItem) items.push(replaceTaskMenuItem);
|
|
11
|
+
const deleteTaskMenuItem = generateDeleteTaskMenuItemForTask(taskId);
|
|
12
|
+
if (deleteTaskMenuItem) items.push(deleteTaskMenuItem);
|
|
24
13
|
return items;
|
|
25
14
|
}, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onTaskGroupModification,
|
|
29
|
-
setIsReplacingTask,
|
|
30
|
-
taskStateReference
|
|
15
|
+
generateReplaceTaskMenuItemForTask,
|
|
16
|
+
generateDeleteTaskMenuItemForTask
|
|
31
17
|
]);
|
|
32
18
|
if (0 === adhocTasks.length) return null;
|
|
33
19
|
return /*#__PURE__*/ jsxs(StageAdditionalTasksSection, {
|
|
@@ -42,7 +28,7 @@ const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selected
|
|
|
42
28
|
})
|
|
43
29
|
}),
|
|
44
30
|
/*#__PURE__*/ jsx(StageTaskList, {
|
|
45
|
-
children: adhocTasks.map(({ task
|
|
31
|
+
children: adhocTasks.map(({ task })=>{
|
|
46
32
|
const taskExecution = execution?.taskStatus?.[task.id];
|
|
47
33
|
return /*#__PURE__*/ jsx(AdhocTaskItem, {
|
|
48
34
|
task: task,
|
|
@@ -52,7 +38,7 @@ const StageNodeAdhocTaskGroupsInner = ({ props, adhocTasks, isReadOnly, selected
|
|
|
52
38
|
onTaskPlay: onTaskPlay,
|
|
53
39
|
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
54
40
|
...(onTaskGroupModification || onReplaceTaskFromToolbox) && !isReadOnly && {
|
|
55
|
-
getContextMenuItems: ()=>getAdhocContextMenuItems(
|
|
41
|
+
getContextMenuItems: ()=>getAdhocContextMenuItems(task.id)
|
|
56
42
|
}
|
|
57
43
|
}, task.id);
|
|
58
44
|
})
|
|
@@ -31,11 +31,13 @@ const apollo_core_namespaceObject = require("@uipath/apollo-core");
|
|
|
31
31
|
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
|
|
32
32
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
33
33
|
const external_react_namespaceObject = require("react");
|
|
34
|
+
const external_utils_index_cjs_namespaceObject = require("../../utils/index.cjs");
|
|
34
35
|
const useStageTasksByGroups_cjs_namespaceObject = require("./hooks/useStageTasksByGroups.cjs");
|
|
35
36
|
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
36
37
|
const external_StageNodeAdhocTaskGroups_cjs_namespaceObject = require("./StageNodeAdhocTaskGroups.cjs");
|
|
37
38
|
const external_StageNodeEventDrivenTaskGroups_cjs_namespaceObject = require("./StageNodeEventDrivenTaskGroups.cjs");
|
|
38
39
|
const external_StageNodeSequentialTaskGroups_cjs_namespaceObject = require("./StageNodeSequentialTaskGroups.cjs");
|
|
40
|
+
const external_StageNodeTaskUtilities_cjs_namespaceObject = require("./StageNodeTaskUtilities.cjs");
|
|
39
41
|
const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskStateReference, setSelectedNodeId, handleTaskAddClick, setIsReplacingTask })=>{
|
|
40
42
|
const { id, stageDetails, onTaskAdd, onAddTaskFromToolbox, onTaskClick, onTaskGroupModification, onTaskReorder, onReplaceTaskFromToolbox } = props;
|
|
41
43
|
const allTasks = (0, external_react_namespaceObject.useMemo)(()=>stageDetails?.tasks || [], [
|
|
@@ -66,6 +68,47 @@ const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskSt
|
|
|
66
68
|
setSelectedNodeId,
|
|
67
69
|
id
|
|
68
70
|
]);
|
|
71
|
+
const generateReplaceTaskMenuItemForTask = (0, external_react_namespaceObject.useCallback)((taskId, isParallel)=>{
|
|
72
|
+
if (!onReplaceTaskFromToolbox) return;
|
|
73
|
+
let groupIndex;
|
|
74
|
+
let taskIndex;
|
|
75
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
76
|
+
groupIndex = allTasksGroupIndex;
|
|
77
|
+
taskIndex = allTasksTaskIndex;
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
if (void 0 === groupIndex || void 0 === taskIndex) return;
|
|
81
|
+
return (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('replace-task', 'Replace task', ()=>{
|
|
82
|
+
taskStateReference.current = {
|
|
83
|
+
isParallel,
|
|
84
|
+
groupIndex,
|
|
85
|
+
taskIndex
|
|
86
|
+
};
|
|
87
|
+
onTaskClick?.(taskId);
|
|
88
|
+
setIsReplacingTask(true);
|
|
89
|
+
});
|
|
90
|
+
}, [
|
|
91
|
+
onReplaceTaskFromToolbox,
|
|
92
|
+
allTasks,
|
|
93
|
+
onTaskClick,
|
|
94
|
+
setIsReplacingTask,
|
|
95
|
+
taskStateReference
|
|
96
|
+
]);
|
|
97
|
+
const generateDeleteTaskMenuItemForTask = (0, external_react_namespaceObject.useCallback)((taskId)=>{
|
|
98
|
+
if (!onTaskGroupModification) return;
|
|
99
|
+
let groupIndex;
|
|
100
|
+
let taskIndex;
|
|
101
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
102
|
+
groupIndex = allTasksGroupIndex;
|
|
103
|
+
taskIndex = allTasksTaskIndex;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
if (void 0 === groupIndex || void 0 === taskIndex) return;
|
|
107
|
+
return (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('remove-task', 'Delete task', ()=>onTaskGroupModification(external_utils_index_cjs_namespaceObject.GroupModificationType.REMOVE_TASK, groupIndex, taskIndex));
|
|
108
|
+
}, [
|
|
109
|
+
allTasks,
|
|
110
|
+
onTaskGroupModification
|
|
111
|
+
]);
|
|
69
112
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageContent, {
|
|
70
113
|
children: 0 === sequentialTaskGroups.length && 0 === adhocTaskGroups.length && 0 === eventDrivenTaskGroups.length ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
|
|
71
114
|
py: 2,
|
|
@@ -89,31 +132,31 @@ const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskSt
|
|
|
89
132
|
isReadOnly: isReadOnly,
|
|
90
133
|
selectedTaskId: selectedTaskId,
|
|
91
134
|
taskWidthStyle: taskWidthStyle,
|
|
92
|
-
taskStateReference: taskStateReference,
|
|
93
135
|
hasContextMenu: hasContextMenu,
|
|
94
136
|
handleTaskClick: handleTaskClick,
|
|
95
|
-
|
|
96
|
-
|
|
137
|
+
handleReorderSequentialTasks: handleReorderSequentialTasks,
|
|
138
|
+
allTasks: allTasks,
|
|
139
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask
|
|
97
140
|
}),
|
|
98
141
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNodeEventDrivenTaskGroups_cjs_namespaceObject.StageNodeEventDrivenTaskGroups, {
|
|
99
142
|
props: props,
|
|
100
143
|
eventDrivenTasks: eventDrivenTasks,
|
|
101
144
|
isReadOnly: isReadOnly,
|
|
102
145
|
selectedTaskId: selectedTaskId,
|
|
103
|
-
taskStateReference: taskStateReference,
|
|
104
146
|
marginTop: sequentialTaskGroups.length > 0 ? apollo_core_namespaceObject.Spacing.SpacingS : '0px',
|
|
105
147
|
handleTaskClick: handleTaskClick,
|
|
106
|
-
|
|
148
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask,
|
|
149
|
+
generateDeleteTaskMenuItemForTask: generateDeleteTaskMenuItemForTask
|
|
107
150
|
}),
|
|
108
151
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNodeAdhocTaskGroups_cjs_namespaceObject.StageNodeAdhocTaskGroups, {
|
|
109
152
|
props: props,
|
|
110
153
|
adhocTasks: adhocTasks,
|
|
111
154
|
isReadOnly: isReadOnly,
|
|
112
155
|
selectedTaskId: selectedTaskId,
|
|
113
|
-
taskStateReference: taskStateReference,
|
|
114
156
|
marginTop: sequentialTaskGroups.length > 0 || eventDrivenTaskGroups.length > 0 ? apollo_core_namespaceObject.Spacing.SpacingS : '0px',
|
|
115
157
|
handleTaskClick: handleTaskClick,
|
|
116
|
-
|
|
158
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask,
|
|
159
|
+
generateDeleteTaskMenuItemForTask: generateDeleteTaskMenuItemForTask
|
|
117
160
|
})
|
|
118
161
|
]
|
|
119
162
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNodeAllTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeAllTaskGroups.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAQ,SAAS,EAAwB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"StageNodeAllTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeAllTaskGroups.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAQ,SAAS,EAAwB,MAAM,OAAO,CAAC;AAI7E,OAAO,KAAK,EAAE,cAAc,EAAiB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAgM3F,eAAO,MAAM,sBAAsB,8JAlLhC;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,kBAAkB,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAC;IAClD,iBAAiB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,kBAAkB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACtD,kBAAkB,EAAE,CAAC,eAAe,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,6CA0KsE,CAAC"}
|
|
@@ -3,11 +3,13 @@ import { Spacing } from "@uipath/apollo-core";
|
|
|
3
3
|
import { Column } from "../../layouts/index.js";
|
|
4
4
|
import { Button } from "@uipath/apollo-wind";
|
|
5
5
|
import { memo, useCallback, useMemo } from "react";
|
|
6
|
+
import { GroupModificationType } from "../../utils/index.js";
|
|
6
7
|
import { useStageTasksByGroups } from "./hooks/useStageTasksByGroups.js";
|
|
7
8
|
import { StageContent } from "./StageNode.styles.js";
|
|
8
9
|
import { StageNodeAdhocTaskGroups } from "./StageNodeAdhocTaskGroups.js";
|
|
9
10
|
import { StageNodeEventDrivenTaskGroups } from "./StageNodeEventDrivenTaskGroups.js";
|
|
10
11
|
import { StageNodeSequentialTaskGroups } from "./StageNodeSequentialTaskGroups.js";
|
|
12
|
+
import { getMenuItem } from "./StageNodeTaskUtilities.js";
|
|
11
13
|
const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskStateReference, setSelectedNodeId, handleTaskAddClick, setIsReplacingTask })=>{
|
|
12
14
|
const { id, stageDetails, onTaskAdd, onAddTaskFromToolbox, onTaskClick, onTaskGroupModification, onTaskReorder, onReplaceTaskFromToolbox } = props;
|
|
13
15
|
const allTasks = useMemo(()=>stageDetails?.tasks || [], [
|
|
@@ -38,6 +40,47 @@ const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskSt
|
|
|
38
40
|
setSelectedNodeId,
|
|
39
41
|
id
|
|
40
42
|
]);
|
|
43
|
+
const generateReplaceTaskMenuItemForTask = useCallback((taskId, isParallel)=>{
|
|
44
|
+
if (!onReplaceTaskFromToolbox) return;
|
|
45
|
+
let groupIndex;
|
|
46
|
+
let taskIndex;
|
|
47
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
48
|
+
groupIndex = allTasksGroupIndex;
|
|
49
|
+
taskIndex = allTasksTaskIndex;
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
if (void 0 === groupIndex || void 0 === taskIndex) return;
|
|
53
|
+
return getMenuItem('replace-task', 'Replace task', ()=>{
|
|
54
|
+
taskStateReference.current = {
|
|
55
|
+
isParallel,
|
|
56
|
+
groupIndex,
|
|
57
|
+
taskIndex
|
|
58
|
+
};
|
|
59
|
+
onTaskClick?.(taskId);
|
|
60
|
+
setIsReplacingTask(true);
|
|
61
|
+
});
|
|
62
|
+
}, [
|
|
63
|
+
onReplaceTaskFromToolbox,
|
|
64
|
+
allTasks,
|
|
65
|
+
onTaskClick,
|
|
66
|
+
setIsReplacingTask,
|
|
67
|
+
taskStateReference
|
|
68
|
+
]);
|
|
69
|
+
const generateDeleteTaskMenuItemForTask = useCallback((taskId)=>{
|
|
70
|
+
if (!onTaskGroupModification) return;
|
|
71
|
+
let groupIndex;
|
|
72
|
+
let taskIndex;
|
|
73
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
74
|
+
groupIndex = allTasksGroupIndex;
|
|
75
|
+
taskIndex = allTasksTaskIndex;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
if (void 0 === groupIndex || void 0 === taskIndex) return;
|
|
79
|
+
return getMenuItem('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationType.REMOVE_TASK, groupIndex, taskIndex));
|
|
80
|
+
}, [
|
|
81
|
+
allTasks,
|
|
82
|
+
onTaskGroupModification
|
|
83
|
+
]);
|
|
41
84
|
return /*#__PURE__*/ jsx(StageContent, {
|
|
42
85
|
children: 0 === sequentialTaskGroups.length && 0 === adhocTaskGroups.length && 0 === eventDrivenTaskGroups.length ? /*#__PURE__*/ jsx(Column, {
|
|
43
86
|
py: 2,
|
|
@@ -61,31 +104,31 @@ const StageNodeAllTaskGroupsInner = ({ props, isReadOnly, taskWidthStyle, taskSt
|
|
|
61
104
|
isReadOnly: isReadOnly,
|
|
62
105
|
selectedTaskId: selectedTaskId,
|
|
63
106
|
taskWidthStyle: taskWidthStyle,
|
|
64
|
-
taskStateReference: taskStateReference,
|
|
65
107
|
hasContextMenu: hasContextMenu,
|
|
66
108
|
handleTaskClick: handleTaskClick,
|
|
67
|
-
|
|
68
|
-
|
|
109
|
+
handleReorderSequentialTasks: handleReorderSequentialTasks,
|
|
110
|
+
allTasks: allTasks,
|
|
111
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask
|
|
69
112
|
}),
|
|
70
113
|
/*#__PURE__*/ jsx(StageNodeEventDrivenTaskGroups, {
|
|
71
114
|
props: props,
|
|
72
115
|
eventDrivenTasks: eventDrivenTasks,
|
|
73
116
|
isReadOnly: isReadOnly,
|
|
74
117
|
selectedTaskId: selectedTaskId,
|
|
75
|
-
taskStateReference: taskStateReference,
|
|
76
118
|
marginTop: sequentialTaskGroups.length > 0 ? Spacing.SpacingS : '0px',
|
|
77
119
|
handleTaskClick: handleTaskClick,
|
|
78
|
-
|
|
120
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask,
|
|
121
|
+
generateDeleteTaskMenuItemForTask: generateDeleteTaskMenuItemForTask
|
|
79
122
|
}),
|
|
80
123
|
/*#__PURE__*/ jsx(StageNodeAdhocTaskGroups, {
|
|
81
124
|
props: props,
|
|
82
125
|
adhocTasks: adhocTasks,
|
|
83
126
|
isReadOnly: isReadOnly,
|
|
84
127
|
selectedTaskId: selectedTaskId,
|
|
85
|
-
taskStateReference: taskStateReference,
|
|
86
128
|
marginTop: sequentialTaskGroups.length > 0 || eventDrivenTaskGroups.length > 0 ? Spacing.SpacingS : '0px',
|
|
87
129
|
handleTaskClick: handleTaskClick,
|
|
88
|
-
|
|
130
|
+
generateReplaceTaskMenuItemForTask: generateReplaceTaskMenuItemForTask,
|
|
131
|
+
generateDeleteTaskMenuItemForTask: generateDeleteTaskMenuItemForTask
|
|
89
132
|
})
|
|
90
133
|
]
|
|
91
134
|
})
|
|
@@ -28,34 +28,20 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
30
|
const external_react_namespaceObject = require("react");
|
|
31
|
-
const GroupModificationUtils_cjs_namespaceObject = require("../../utils/GroupModificationUtils.cjs");
|
|
32
31
|
const external_EventDrivenTask_cjs_namespaceObject = require("./EventDrivenTask.cjs");
|
|
33
32
|
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const getEventDrivenContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, taskIndex, taskId)=>{
|
|
33
|
+
const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask })=>{
|
|
34
|
+
const { execution, onTaskGroupModification, onReplaceTaskFromToolbox, loadingTaskIds } = props;
|
|
35
|
+
const getEventDrivenContextMenuItems = (0, external_react_namespaceObject.useCallback)((taskId)=>{
|
|
38
36
|
const items = [];
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
taskIndex
|
|
44
|
-
};
|
|
45
|
-
onTaskClick?.(taskId);
|
|
46
|
-
setIsReplacingTask(true);
|
|
47
|
-
}));
|
|
48
|
-
if (onTaskGroupModification) {
|
|
49
|
-
if (items.length > 0) items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
50
|
-
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getMenuItem)('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_TASK, groupIndex, taskIndex)));
|
|
51
|
-
}
|
|
37
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, false);
|
|
38
|
+
if (replaceTaskMenuItem) items.push(replaceTaskMenuItem);
|
|
39
|
+
const deleteTaskMenuItem = generateDeleteTaskMenuItemForTask(taskId);
|
|
40
|
+
if (deleteTaskMenuItem) items.push(deleteTaskMenuItem);
|
|
52
41
|
return items;
|
|
53
42
|
}, [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
onTaskGroupModification,
|
|
57
|
-
setIsReplacingTask,
|
|
58
|
-
taskStateReference
|
|
43
|
+
generateReplaceTaskMenuItemForTask,
|
|
44
|
+
generateDeleteTaskMenuItemForTask
|
|
59
45
|
]);
|
|
60
46
|
if (0 === eventDrivenTasks.length) return null;
|
|
61
47
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_StageNode_styles_cjs_namespaceObject.StageAdditionalTasksSection, {
|
|
@@ -70,7 +56,7 @@ const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOn
|
|
|
70
56
|
})
|
|
71
57
|
}),
|
|
72
58
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StageNode_styles_cjs_namespaceObject.StageTaskList, {
|
|
73
|
-
children: eventDrivenTasks.map(({ task
|
|
59
|
+
children: eventDrivenTasks.map(({ task })=>{
|
|
74
60
|
const taskExecution = execution?.taskStatus?.[task.id];
|
|
75
61
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_EventDrivenTask_cjs_namespaceObject.EventDrivenTaskItem, {
|
|
76
62
|
task: task,
|
|
@@ -79,7 +65,7 @@ const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOn
|
|
|
79
65
|
onTaskClick: handleTaskClick,
|
|
80
66
|
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
81
67
|
...(onTaskGroupModification || onReplaceTaskFromToolbox) && !isReadOnly && {
|
|
82
|
-
getContextMenuItems: ()=>getEventDrivenContextMenuItems(
|
|
68
|
+
getContextMenuItems: ()=>getEventDrivenContextMenuItems(task.id)
|
|
83
69
|
}
|
|
84
70
|
}, task.id);
|
|
85
71
|
})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { StageNodeProps, StageTaskGroup
|
|
3
|
-
export declare const StageNodeEventDrivenTaskGroups: import("react").MemoExoticComponent<({ props, eventDrivenTasks, isReadOnly, selectedTaskId,
|
|
1
|
+
import type { NodeMenuItem } from '../NodeContextMenu';
|
|
2
|
+
import type { StageNodeProps, StageTaskGroup } from './StageNode.types';
|
|
3
|
+
export declare const StageNodeEventDrivenTaskGroups: import("react").MemoExoticComponent<({ props, eventDrivenTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask, }: {
|
|
4
4
|
props: StageNodeProps;
|
|
5
5
|
eventDrivenTasks: StageTaskGroup[];
|
|
6
6
|
isReadOnly: boolean;
|
|
7
7
|
selectedTaskId?: string;
|
|
8
|
-
taskStateReference: RefObject<TaskStateReference>;
|
|
9
8
|
marginTop: string;
|
|
10
9
|
handleTaskClick: (e: React.MouseEvent, taskElementId: string) => void;
|
|
11
|
-
|
|
10
|
+
generateReplaceTaskMenuItemForTask: (taskId: string, isParallel: boolean) => NodeMenuItem | undefined;
|
|
11
|
+
generateDeleteTaskMenuItemForTask: (taskId: string) => NodeMenuItem | undefined;
|
|
12
12
|
}) => import("react/jsx-runtime").JSX.Element | null>;
|
|
13
13
|
//# sourceMappingURL=StageNodeEventDrivenTaskGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNodeEventDrivenTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StageNodeEventDrivenTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeEventDrivenTaskGroups.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAOvD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA8ExE,eAAO,MAAM,8BAA8B,oMAnExC;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,gBAAgB,EAAE,cAAc,EAAE,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,kCAAkC,EAAE,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,KAChB,YAAY,GAAG,SAAS,CAAC;IAC9B,iCAAiC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,YAAY,GAAG,SAAS,CAAC;CACjF,oDAuDsF,CAAC"}
|
|
@@ -1,33 +1,19 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from "react";
|
|
3
|
-
import { GroupModificationType } from "../../utils/GroupModificationUtils.js";
|
|
4
3
|
import { EventDrivenTaskItem } from "./EventDrivenTask.js";
|
|
5
4
|
import { StageAdditionalTasksHeaderSection, StageAdditionalTasksSection, StageTaskList } from "./StageNode.styles.js";
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const getEventDrivenContextMenuItems = useCallback((groupIndex, taskIndex, taskId)=>{
|
|
5
|
+
const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOnly, selectedTaskId, marginTop, handleTaskClick, generateReplaceTaskMenuItemForTask, generateDeleteTaskMenuItemForTask })=>{
|
|
6
|
+
const { execution, onTaskGroupModification, onReplaceTaskFromToolbox, loadingTaskIds } = props;
|
|
7
|
+
const getEventDrivenContextMenuItems = useCallback((taskId)=>{
|
|
10
8
|
const items = [];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
taskIndex
|
|
16
|
-
};
|
|
17
|
-
onTaskClick?.(taskId);
|
|
18
|
-
setIsReplacingTask(true);
|
|
19
|
-
}));
|
|
20
|
-
if (onTaskGroupModification) {
|
|
21
|
-
if (items.length > 0) items.push(getDivider());
|
|
22
|
-
items.push(getMenuItem('remove-task', 'Delete task', ()=>onTaskGroupModification(GroupModificationType.REMOVE_TASK, groupIndex, taskIndex)));
|
|
23
|
-
}
|
|
9
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, false);
|
|
10
|
+
if (replaceTaskMenuItem) items.push(replaceTaskMenuItem);
|
|
11
|
+
const deleteTaskMenuItem = generateDeleteTaskMenuItemForTask(taskId);
|
|
12
|
+
if (deleteTaskMenuItem) items.push(deleteTaskMenuItem);
|
|
24
13
|
return items;
|
|
25
14
|
}, [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onTaskGroupModification,
|
|
29
|
-
setIsReplacingTask,
|
|
30
|
-
taskStateReference
|
|
15
|
+
generateReplaceTaskMenuItemForTask,
|
|
16
|
+
generateDeleteTaskMenuItemForTask
|
|
31
17
|
]);
|
|
32
18
|
if (0 === eventDrivenTasks.length) return null;
|
|
33
19
|
return /*#__PURE__*/ jsxs(StageAdditionalTasksSection, {
|
|
@@ -42,7 +28,7 @@ const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOn
|
|
|
42
28
|
})
|
|
43
29
|
}),
|
|
44
30
|
/*#__PURE__*/ jsx(StageTaskList, {
|
|
45
|
-
children: eventDrivenTasks.map(({ task
|
|
31
|
+
children: eventDrivenTasks.map(({ task })=>{
|
|
46
32
|
const taskExecution = execution?.taskStatus?.[task.id];
|
|
47
33
|
return /*#__PURE__*/ jsx(EventDrivenTaskItem, {
|
|
48
34
|
task: task,
|
|
@@ -51,7 +37,7 @@ const StageNodeEventDrivenTaskGroupsInner = ({ props, eventDrivenTasks, isReadOn
|
|
|
51
37
|
onTaskClick: handleTaskClick,
|
|
52
38
|
isTaskLoading: loadingTaskIds?.has(task.id),
|
|
53
39
|
...(onTaskGroupModification || onReplaceTaskFromToolbox) && !isReadOnly && {
|
|
54
|
-
getContextMenuItems: ()=>getEventDrivenContextMenuItems(
|
|
40
|
+
getContextMenuItems: ()=>getEventDrivenContextMenuItems(task.id)
|
|
55
41
|
}
|
|
56
42
|
}, task.id);
|
|
57
43
|
})
|
|
@@ -38,8 +38,8 @@ const useStageTaskDragHandler_cjs_namespaceObject = require("./hooks/useStageTas
|
|
|
38
38
|
const external_StageNode_styles_cjs_namespaceObject = require("./StageNode.styles.cjs");
|
|
39
39
|
const external_StageNodeTaskUtilities_cjs_namespaceObject = require("./StageNodeTaskUtilities.cjs");
|
|
40
40
|
const external_StageTaskDragOverlay_cjs_namespaceObject = require("./StageTaskDragOverlay.cjs");
|
|
41
|
-
const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequentialTasks, isReadOnly, selectedTaskId, taskWidthStyle,
|
|
42
|
-
const { execution,
|
|
41
|
+
const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequentialTasks, allTasks, isReadOnly, selectedTaskId, taskWidthStyle, hasContextMenu, handleTaskClick, handleReorderSequentialTasks, generateReplaceTaskMenuItemForTask })=>{
|
|
42
|
+
const { execution, onTaskGroupModification, onTaskReorder, hideParallelOptions, loadingTaskIds } = props;
|
|
43
43
|
const sequentialTaskIds = (0, external_react_namespaceObject.useMemo)(()=>sequentialTasks.map(({ task })=>task.id), [
|
|
44
44
|
sequentialTasks
|
|
45
45
|
]);
|
|
@@ -62,25 +62,34 @@ const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequential
|
|
|
62
62
|
onTaskGroupModification,
|
|
63
63
|
sequentialTaskGroups
|
|
64
64
|
]);
|
|
65
|
-
const buildContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex,
|
|
65
|
+
const buildContextMenuItems = (0, external_react_namespaceObject.useCallback)((groupIndex, _, taskId)=>{
|
|
66
66
|
const taskGroup = sequentialTaskGroups[groupIndex] ?? [];
|
|
67
67
|
const isParallel = taskGroup.length > 1;
|
|
68
68
|
const items = [];
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
isParallel,
|
|
73
|
-
groupIndex,
|
|
74
|
-
taskIndex
|
|
75
|
-
};
|
|
76
|
-
const taskId = taskGroup[taskIndex]?.id;
|
|
77
|
-
if (taskId) onTaskClick?.(taskId);
|
|
78
|
-
setIsReplacingTask(true);
|
|
79
|
-
}));
|
|
69
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, isParallel);
|
|
70
|
+
if (replaceTaskMenuItem) {
|
|
71
|
+
items.push(replaceTaskMenuItem);
|
|
80
72
|
items.push((0, external_StageNodeTaskUtilities_cjs_namespaceObject.getDivider)());
|
|
81
73
|
}
|
|
82
|
-
|
|
83
|
-
|
|
74
|
+
let groupIndexInAllTasks;
|
|
75
|
+
let taskIndexInAllTasks;
|
|
76
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
77
|
+
groupIndexInAllTasks = allTasksGroupIndex;
|
|
78
|
+
taskIndexInAllTasks = allTasksTaskIndex;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (onTaskGroupModification && void 0 !== groupIndexInAllTasks && void 0 !== taskIndexInAllTasks) {
|
|
82
|
+
const reGroupOptions = (0, external_StageNodeTaskUtilities_cjs_namespaceObject.getContextMenuItems)({
|
|
83
|
+
isParallelGroup: isParallel,
|
|
84
|
+
groupIndex,
|
|
85
|
+
tasksLength: sequentialTaskGroups.length,
|
|
86
|
+
groupIndexInAllTasks,
|
|
87
|
+
taskIndexInAllTasks,
|
|
88
|
+
isAboveParallel: (sequentialTaskGroups[groupIndex - 1]?.length ?? 0) > 1,
|
|
89
|
+
isBelowParallel: (sequentialTaskGroups[groupIndex + 1]?.length ?? 0) > 1,
|
|
90
|
+
reGroupTaskFunction: handleTaskRegroup,
|
|
91
|
+
hideParallelOptions
|
|
92
|
+
});
|
|
84
93
|
return [
|
|
85
94
|
...items,
|
|
86
95
|
...reGroupOptions
|
|
@@ -88,14 +97,12 @@ const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequential
|
|
|
88
97
|
}
|
|
89
98
|
return items;
|
|
90
99
|
}, [
|
|
91
|
-
onReplaceTaskFromToolbox,
|
|
92
|
-
onTaskClick,
|
|
93
100
|
onTaskGroupModification,
|
|
94
101
|
sequentialTaskGroups,
|
|
95
102
|
hideParallelOptions,
|
|
96
103
|
handleTaskRegroup,
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
generateReplaceTaskMenuItemForTask,
|
|
105
|
+
allTasks
|
|
99
106
|
]);
|
|
100
107
|
const sensors = (0, core_namespaceObject.useSensors)((0, core_namespaceObject.useSensor)(core_namespaceObject.PointerSensor, {
|
|
101
108
|
activationConstraint: {
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { CSSProperties
|
|
2
|
-
import type {
|
|
3
|
-
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { NodeMenuItem } from '../NodeContextMenu';
|
|
3
|
+
import type { StageNodeProps, StageTaskGroup, StageTaskItem } from './StageNode.types';
|
|
4
|
+
export declare const StageNodeSequentialTaskGroups: ({ props, sequentialTaskGroups, sequentialTasks, allTasks, isReadOnly, selectedTaskId, taskWidthStyle, hasContextMenu, handleTaskClick, handleReorderSequentialTasks, generateReplaceTaskMenuItemForTask, }: {
|
|
4
5
|
props: StageNodeProps;
|
|
5
6
|
sequentialTaskGroups: StageTaskItem[][];
|
|
6
7
|
sequentialTasks: StageTaskGroup[];
|
|
8
|
+
allTasks: StageTaskItem[][];
|
|
7
9
|
isReadOnly: boolean;
|
|
8
10
|
selectedTaskId?: string;
|
|
9
11
|
taskWidthStyle?: CSSProperties;
|
|
10
|
-
taskStateReference: RefObject<TaskStateReference>;
|
|
11
12
|
hasContextMenu: boolean;
|
|
12
13
|
handleTaskClick: (e: React.MouseEvent, taskElementId: string) => void;
|
|
13
|
-
setIsReplacingTask: (isReplacingTask: boolean) => void;
|
|
14
14
|
handleReorderSequentialTasks: (newTasks: StageTaskItem[][]) => void;
|
|
15
|
+
generateReplaceTaskMenuItemForTask: (taskId: string, isParallel: boolean) => NodeMenuItem | undefined;
|
|
15
16
|
}) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
17
|
//# sourceMappingURL=StageNodeSequentialTaskGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNodeSequentialTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeSequentialTaskGroups.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"StageNodeSequentialTaskGroups.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeSequentialTaskGroups.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAwB,MAAM,OAAO,CAAC;AAM5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASvD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAIvF,eAAO,MAAM,6BAA6B,GAAI,4MAY3C;IACD,KAAK,EAAE,cAAc,CAAC;IACtB,oBAAoB,EAAE,aAAa,EAAE,EAAE,CAAC;IACxC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,QAAQ,EAAE,aAAa,EAAE,EAAE,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,aAAa,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,4BAA4B,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,EAAE,KAAK,IAAI,CAAC;IACpE,kCAAkC,EAAE,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,OAAO,KAChB,YAAY,GAAG,SAAS,CAAC;CAC/B,mDAiLA,CAAC"}
|
|
@@ -8,10 +8,10 @@ import { GroupModificationType, moveGroupDown, moveGroupUp } from "../../utils/G
|
|
|
8
8
|
import { DraggableTask } from "./DraggableTask.js";
|
|
9
9
|
import { useStageTaskDragHandler } from "./hooks/useStageTaskDragHandler.js";
|
|
10
10
|
import { StageParallelBracket, StageParallelLabel, StageTaskGroupContainer, StageTaskList } from "./StageNode.styles.js";
|
|
11
|
-
import { getContextMenuItems, getDivider
|
|
11
|
+
import { getContextMenuItems, getDivider } from "./StageNodeTaskUtilities.js";
|
|
12
12
|
import { StageTaskDragOverlay } from "./StageTaskDragOverlay.js";
|
|
13
|
-
const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequentialTasks, isReadOnly, selectedTaskId, taskWidthStyle,
|
|
14
|
-
const { execution,
|
|
13
|
+
const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequentialTasks, allTasks, isReadOnly, selectedTaskId, taskWidthStyle, hasContextMenu, handleTaskClick, handleReorderSequentialTasks, generateReplaceTaskMenuItemForTask })=>{
|
|
14
|
+
const { execution, onTaskGroupModification, onTaskReorder, hideParallelOptions, loadingTaskIds } = props;
|
|
15
15
|
const sequentialTaskIds = useMemo(()=>sequentialTasks.map(({ task })=>task.id), [
|
|
16
16
|
sequentialTasks
|
|
17
17
|
]);
|
|
@@ -34,25 +34,34 @@ const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequential
|
|
|
34
34
|
onTaskGroupModification,
|
|
35
35
|
sequentialTaskGroups
|
|
36
36
|
]);
|
|
37
|
-
const buildContextMenuItems = useCallback((groupIndex,
|
|
37
|
+
const buildContextMenuItems = useCallback((groupIndex, _, taskId)=>{
|
|
38
38
|
const taskGroup = sequentialTaskGroups[groupIndex] ?? [];
|
|
39
39
|
const isParallel = taskGroup.length > 1;
|
|
40
40
|
const items = [];
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
isParallel,
|
|
45
|
-
groupIndex,
|
|
46
|
-
taskIndex
|
|
47
|
-
};
|
|
48
|
-
const taskId = taskGroup[taskIndex]?.id;
|
|
49
|
-
if (taskId) onTaskClick?.(taskId);
|
|
50
|
-
setIsReplacingTask(true);
|
|
51
|
-
}));
|
|
41
|
+
const replaceTaskMenuItem = generateReplaceTaskMenuItemForTask(taskId, isParallel);
|
|
42
|
+
if (replaceTaskMenuItem) {
|
|
43
|
+
items.push(replaceTaskMenuItem);
|
|
52
44
|
items.push(getDivider());
|
|
53
45
|
}
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
let groupIndexInAllTasks;
|
|
47
|
+
let taskIndexInAllTasks;
|
|
48
|
+
for (const [allTasksGroupIndex, group] of allTasks.entries())for (const [allTasksTaskIndex, task] of group.entries())if (task.id === taskId) {
|
|
49
|
+
groupIndexInAllTasks = allTasksGroupIndex;
|
|
50
|
+
taskIndexInAllTasks = allTasksTaskIndex;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
if (onTaskGroupModification && void 0 !== groupIndexInAllTasks && void 0 !== taskIndexInAllTasks) {
|
|
54
|
+
const reGroupOptions = getContextMenuItems({
|
|
55
|
+
isParallelGroup: isParallel,
|
|
56
|
+
groupIndex,
|
|
57
|
+
tasksLength: sequentialTaskGroups.length,
|
|
58
|
+
groupIndexInAllTasks,
|
|
59
|
+
taskIndexInAllTasks,
|
|
60
|
+
isAboveParallel: (sequentialTaskGroups[groupIndex - 1]?.length ?? 0) > 1,
|
|
61
|
+
isBelowParallel: (sequentialTaskGroups[groupIndex + 1]?.length ?? 0) > 1,
|
|
62
|
+
reGroupTaskFunction: handleTaskRegroup,
|
|
63
|
+
hideParallelOptions
|
|
64
|
+
});
|
|
56
65
|
return [
|
|
57
66
|
...items,
|
|
58
67
|
...reGroupOptions
|
|
@@ -60,14 +69,12 @@ const StageNodeSequentialTaskGroups = ({ props, sequentialTaskGroups, sequential
|
|
|
60
69
|
}
|
|
61
70
|
return items;
|
|
62
71
|
}, [
|
|
63
|
-
onReplaceTaskFromToolbox,
|
|
64
|
-
onTaskClick,
|
|
65
72
|
onTaskGroupModification,
|
|
66
73
|
sequentialTaskGroups,
|
|
67
74
|
hideParallelOptions,
|
|
68
75
|
handleTaskRegroup,
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
generateReplaceTaskMenuItemForTask,
|
|
77
|
+
allTasks
|
|
71
78
|
]);
|
|
72
79
|
const sensors = useSensors(useSensor(PointerSensor, {
|
|
73
80
|
activationConstraint: {
|
|
@@ -30,18 +30,18 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
30
30
|
getContextMenuItems: ()=>getContextMenuItems
|
|
31
31
|
});
|
|
32
32
|
const GroupModificationUtils_cjs_namespaceObject = require("../../utils/GroupModificationUtils.cjs");
|
|
33
|
-
const getContextMenuItems = (isParallelGroup, groupIndex, tasksLength,
|
|
33
|
+
const getContextMenuItems = ({ isParallelGroup, groupIndex, tasksLength, groupIndexInAllTasks, taskIndexInAllTasks, isAboveParallel, isBelowParallel, reGroupTaskFunction, hideParallelOptions = false })=>{
|
|
34
34
|
const CONTEXT_MENU_ITEMS = {
|
|
35
|
-
MOVE_UP: getMenuItem('move-up', 'Move up', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP,
|
|
36
|
-
MOVE_DOWN: getMenuItem('move-down', 'Move down', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_DOWN,
|
|
37
|
-
UNGROUP_ALL: getMenuItem('ungroup', 'Ungroup parallel tasks', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.UNGROUP_ALL_TASKS,
|
|
38
|
-
SPLIT_TASK: getMenuItem('split', 'Remove from parallel group', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.SPLIT_GROUP,
|
|
39
|
-
REMOVE_GROUP: getMenuItem('remove-group', 'Remove group from stage', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_GROUP,
|
|
40
|
-
REMOVE_TASK: getMenuItem('remove-task', 'Delete task', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_TASK,
|
|
41
|
-
CREATE_PARALLEL_GROUP_ABOVE: getMenuItem('group-with-up', 'Create parallel group with task above', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_UP,
|
|
42
|
-
CREATE_PARALLEL_GROUP_BELOW: getMenuItem('group-with-down', 'Create parallel group with task below', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_DOWN,
|
|
43
|
-
ADD_TO_PARALLEL_GROUP_ABOVE: getMenuItem('add-to-group-with-up', 'Add task to parallel group above', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_UP,
|
|
44
|
-
ADD_TO_PARALLEL_GROUP_BELOW: getMenuItem('add-to-group-with-down', 'Add task to parallel group below', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_DOWN,
|
|
35
|
+
MOVE_UP: getMenuItem('move-up', 'Move up', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
36
|
+
MOVE_DOWN: getMenuItem('move-down', 'Move down', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.TASK_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
37
|
+
UNGROUP_ALL: getMenuItem('ungroup', 'Ungroup parallel tasks', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.UNGROUP_ALL_TASKS, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
38
|
+
SPLIT_TASK: getMenuItem('split', 'Remove from parallel group', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.SPLIT_GROUP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
39
|
+
REMOVE_GROUP: getMenuItem('remove-group', 'Remove group from stage', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_GROUP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
40
|
+
REMOVE_TASK: getMenuItem('remove-task', 'Delete task', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.REMOVE_TASK, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
41
|
+
CREATE_PARALLEL_GROUP_ABOVE: getMenuItem('group-with-up', 'Create parallel group with task above', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
42
|
+
CREATE_PARALLEL_GROUP_BELOW: getMenuItem('group-with-down', 'Create parallel group with task below', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
43
|
+
ADD_TO_PARALLEL_GROUP_ABOVE: getMenuItem('add-to-group-with-up', 'Add task to parallel group above', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
44
|
+
ADD_TO_PARALLEL_GROUP_BELOW: getMenuItem('add-to-group-with-down', 'Add task to parallel group below', ()=>reGroupTaskFunction(GroupModificationUtils_cjs_namespaceObject.GroupModificationType.MERGE_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
45
45
|
DIVIDER: getDivider()
|
|
46
46
|
};
|
|
47
47
|
const items = [];
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { GroupModificationType } from '../../utils/GroupModificationUtils';
|
|
3
3
|
import type { NodeMenuAction, NodeMenuItem } from '../NodeContextMenu';
|
|
4
|
-
export declare const getContextMenuItems: (isParallelGroup
|
|
4
|
+
export declare const getContextMenuItems: ({ isParallelGroup, groupIndex, tasksLength, groupIndexInAllTasks, taskIndexInAllTasks, isAboveParallel, isBelowParallel, reGroupTaskFunction, hideParallelOptions, }: {
|
|
5
|
+
isParallelGroup: boolean;
|
|
6
|
+
groupIndex: number;
|
|
7
|
+
tasksLength: number;
|
|
8
|
+
groupIndexInAllTasks: number;
|
|
9
|
+
taskIndexInAllTasks: number;
|
|
10
|
+
isAboveParallel: boolean;
|
|
11
|
+
isBelowParallel: boolean;
|
|
12
|
+
reGroupTaskFunction: (groupModificationType: GroupModificationType, groupIndex: number, taskIndex: number) => void;
|
|
13
|
+
hideParallelOptions?: boolean;
|
|
14
|
+
}) => NodeMenuItem[];
|
|
5
15
|
export declare function getMenuItem(id: string | undefined, label: string | undefined, onClick: () => void, isDisabled?: boolean): NodeMenuItem;
|
|
6
16
|
export declare const getDivider: () => NodeMenuItem;
|
|
7
17
|
export interface TransformedMenuItem {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StageNodeTaskUtilities.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeTaskUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvE,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"StageNodeTaskUtilities.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/StageNode/StageNodeTaskUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIvE,eAAO,MAAM,mBAAmB,GAAI,sKAUjC;IACD,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,CACnB,qBAAqB,EAAE,qBAAqB,EAC5C,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,KACd,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,KAAG,YAAY,EA+Hf,CAAC;AAEF,wBAAgB,WAAW,CACzB,EAAE,EAAE,MAAM,YAAO,EACjB,KAAK,EAAE,MAAM,YAAU,EACvB,OAAO,EAAE,MAAM,IAAI,EACnB,UAAU,UAAQ,GACjB,YAAY,CAEd;AAED,eAAO,MAAM,UAAU,QAAO,YAI7B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,WAAW,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAMD,eAAO,MAAM,kBAAkB,GAC7B,WAAW,YAAY,EAAE,GAAG,SAAS,EACrC,aAAa,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,KAC1C,mBAAmB,EAwBrB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { GroupModificationType } from "../../utils/GroupModificationUtils.js";
|
|
2
|
-
const getContextMenuItems = (isParallelGroup, groupIndex, tasksLength,
|
|
2
|
+
const getContextMenuItems = ({ isParallelGroup, groupIndex, tasksLength, groupIndexInAllTasks, taskIndexInAllTasks, isAboveParallel, isBelowParallel, reGroupTaskFunction, hideParallelOptions = false })=>{
|
|
3
3
|
const CONTEXT_MENU_ITEMS = {
|
|
4
|
-
MOVE_UP: getMenuItem('move-up', 'Move up', ()=>reGroupTaskFunction(GroupModificationType.TASK_GROUP_UP,
|
|
5
|
-
MOVE_DOWN: getMenuItem('move-down', 'Move down', ()=>reGroupTaskFunction(GroupModificationType.TASK_GROUP_DOWN,
|
|
6
|
-
UNGROUP_ALL: getMenuItem('ungroup', 'Ungroup parallel tasks', ()=>reGroupTaskFunction(GroupModificationType.UNGROUP_ALL_TASKS,
|
|
7
|
-
SPLIT_TASK: getMenuItem('split', 'Remove from parallel group', ()=>reGroupTaskFunction(GroupModificationType.SPLIT_GROUP,
|
|
8
|
-
REMOVE_GROUP: getMenuItem('remove-group', 'Remove group from stage', ()=>reGroupTaskFunction(GroupModificationType.REMOVE_GROUP,
|
|
9
|
-
REMOVE_TASK: getMenuItem('remove-task', 'Delete task', ()=>reGroupTaskFunction(GroupModificationType.REMOVE_TASK,
|
|
10
|
-
CREATE_PARALLEL_GROUP_ABOVE: getMenuItem('group-with-up', 'Create parallel group with task above', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_UP,
|
|
11
|
-
CREATE_PARALLEL_GROUP_BELOW: getMenuItem('group-with-down', 'Create parallel group with task below', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_DOWN,
|
|
12
|
-
ADD_TO_PARALLEL_GROUP_ABOVE: getMenuItem('add-to-group-with-up', 'Add task to parallel group above', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_UP,
|
|
13
|
-
ADD_TO_PARALLEL_GROUP_BELOW: getMenuItem('add-to-group-with-down', 'Add task to parallel group below', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_DOWN,
|
|
4
|
+
MOVE_UP: getMenuItem('move-up', 'Move up', ()=>reGroupTaskFunction(GroupModificationType.TASK_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
5
|
+
MOVE_DOWN: getMenuItem('move-down', 'Move down', ()=>reGroupTaskFunction(GroupModificationType.TASK_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
6
|
+
UNGROUP_ALL: getMenuItem('ungroup', 'Ungroup parallel tasks', ()=>reGroupTaskFunction(GroupModificationType.UNGROUP_ALL_TASKS, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
7
|
+
SPLIT_TASK: getMenuItem('split', 'Remove from parallel group', ()=>reGroupTaskFunction(GroupModificationType.SPLIT_GROUP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
8
|
+
REMOVE_GROUP: getMenuItem('remove-group', 'Remove group from stage', ()=>reGroupTaskFunction(GroupModificationType.REMOVE_GROUP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
9
|
+
REMOVE_TASK: getMenuItem('remove-task', 'Delete task', ()=>reGroupTaskFunction(GroupModificationType.REMOVE_TASK, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
10
|
+
CREATE_PARALLEL_GROUP_ABOVE: getMenuItem('group-with-up', 'Create parallel group with task above', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
11
|
+
CREATE_PARALLEL_GROUP_BELOW: getMenuItem('group-with-down', 'Create parallel group with task below', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
12
|
+
ADD_TO_PARALLEL_GROUP_ABOVE: getMenuItem('add-to-group-with-up', 'Add task to parallel group above', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_UP, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
13
|
+
ADD_TO_PARALLEL_GROUP_BELOW: getMenuItem('add-to-group-with-down', 'Add task to parallel group below', ()=>reGroupTaskFunction(GroupModificationType.MERGE_GROUP_DOWN, groupIndexInAllTasks, taskIndexInAllTasks)),
|
|
14
14
|
DIVIDER: getDivider()
|
|
15
15
|
};
|
|
16
16
|
const items = [];
|