@evenicanpm/admin-integrate 1.3.0 → 1.4.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.
Files changed (79) hide show
  1. package/documents/Endpoint/list.ts +8 -0
  2. package/documents/Process/get-process-details.ts +0 -1
  3. package/documents/ProcessConfig/fragments.ts +1 -1
  4. package/documents/ProcessExport/read.ts +108 -0
  5. package/documents/ProcessTask/fragments.ts +4 -1
  6. package/documents/ProcessTemplate/fragments.ts +6 -1
  7. package/package.json +2 -2
  8. package/src/api/configuration/queries/configuration-export.query.ts +48 -0
  9. package/src/api/configuration/queries/configuration-export.server.ts +9 -0
  10. package/src/api/configuration/queries/index.ts +1 -0
  11. package/src/api/process/mutations/copy-process.mutation.ts +2 -5
  12. package/src/api/process-config/mutation/process-config-import.mutation.ts +9 -0
  13. package/src/api/process-task/queries/get-process-task-by-id.query.ts +1 -0
  14. package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +2 -2
  15. package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +2 -2
  16. package/src/api/templates/queries/template-input-search.query.ts +5 -0
  17. package/src/api/templates/queries/template-input-search.server.ts +8 -1
  18. package/src/api/templates/queries/types.ts +9 -3
  19. package/src/components/breadcrumbs/breadcrumbs.tsx +1 -1
  20. package/src/components/core/date-time-popover.tsx +1 -1
  21. package/src/components/core/drawer-buttons.tsx +1 -1
  22. package/src/components/core/edited-typography.tsx +1 -1
  23. package/src/components/core/title-edit.tsx +13 -11
  24. package/src/components/dashboard-list/dashboard-list.tsx +1 -1
  25. package/src/components/data-table/table-header.tsx +1 -1
  26. package/src/components/data-table/table-skeleton.tsx +1 -1
  27. package/src/components/execution-history-drawer/execution-history-drawer.tsx +1 -2
  28. package/src/components/header/integration-details-header.tsx +4 -0
  29. package/src/components/integration-list/list/integration-list-row.tsx +2 -2
  30. package/src/components/integration-list/list/integration-list-table.tsx +3 -3
  31. package/src/components/integration-list/list/integration-list.tsx +3 -3
  32. package/src/components/integration-view/edges/default-edge.tsx +1 -5
  33. package/src/components/integration-view/flow-types.tsx +2 -0
  34. package/src/components/integration-view/integration-view.tsx +148 -577
  35. package/src/components/integration-view/nodes/add-node.tsx +20 -0
  36. package/src/components/integration-view/nodes/group-node.tsx +15 -1
  37. package/src/components/integration-view/nodes/task-node.tsx +38 -10
  38. package/src/components/integration-view/temp-data/initialElements.tsx +0 -2
  39. package/src/components/integration-view/utils/mapping.ts +404 -0
  40. package/src/components/layouts/main-layout.tsx +1 -1
  41. package/src/components/layouts/root-container.tsx +2 -5
  42. package/src/components/link-cards/link-card.tsx +1 -1
  43. package/src/components/list-filter/date-filter.tsx +3 -1
  44. package/src/components/list-filter/date-range-filter.tsx +4 -2
  45. package/src/components/list-filter/list-filter.tsx +1 -1
  46. package/src/components/list-filter/select-filter.tsx +10 -4
  47. package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +6 -8
  48. package/src/components/scheduler/schedule-drawer/schedule-details-main.tsx +1 -1
  49. package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +1 -1
  50. package/src/components/scheduler/schedule-drawer/schedule-details.tsx +1 -1
  51. package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +4 -8
  52. package/src/components/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +1 -1
  53. package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +2 -2
  54. package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +1 -1
  55. package/src/components/templates/inputs/index.tsx +162 -121
  56. package/src/components/templates/templates-list/templates-list-table.tsx +2 -2
  57. package/src/components/templates/templates-list/templates-list.tsx +1 -1
  58. package/src/components/templates/types.tsx +1 -0
  59. package/src/components/templates/wizard.tsx +98 -50
  60. package/src/pages/dashboard/dashboard-list-sections.tsx +2 -2
  61. package/src/pages/execution-details/execution-details.tsx +4 -3
  62. package/src/pages/execution-details/task-execution-details.tsx +1 -1
  63. package/src/pages/execution-details/task-execution-drawer.tsx +1 -1
  64. package/src/pages/executions/executions-list/executions-list-table.tsx +1 -1
  65. package/src/pages/integration-create/integration-create.tsx +87 -45
  66. package/src/pages/integration-create/pre-creation-step.tsx +77 -5
  67. package/src/pages/integration-create/select-step.tsx +1 -1
  68. package/src/pages/integration-create/wizard-step.tsx +2 -1
  69. package/src/pages/integration-details/import-process/copy-tasks-list.tsx +2 -2
  70. package/src/pages/integration-details/import-process/copy-tasks-row.tsx +1 -1
  71. package/src/pages/integration-details/import-process/import-confirm.tsx +1 -1
  72. package/src/pages/integration-details/import-process/import-drawer.tsx +1 -1
  73. package/src/pages/integration-details/import-process/import-process.tsx +1 -1
  74. package/src/pages/integration-details/integration-details.tsx +290 -43
  75. package/src/pages/integration-details/task-drawer/add-task.tsx +65 -13
  76. package/src/pages/integration-details/task-drawer/edit-task.tsx +69 -83
  77. package/src/pages/integration-details/task-drawer/task-drawer.tsx +22 -4
  78. package/src/pages/integration-details/task-drawer/task-reducer.ts +32 -2
  79. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +1 -1
@@ -0,0 +1,20 @@
1
+ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
+ import { IconButton, useTheme } from "@mui/material";
3
+
4
+ export function AddNode(): JSX.Element {
5
+ const theme = useTheme();
6
+
7
+ return (
8
+ <IconButton>
9
+ <AddCircleOutlineIcon
10
+ sx={{
11
+ color: "grey.600",
12
+ marginLeft: theme.spacing(1),
13
+ "&:hover": {
14
+ color: "#4E97FD", //Blue not implemented in the theme
15
+ },
16
+ }}
17
+ />
18
+ </IconButton>
19
+ );
20
+ }
@@ -38,7 +38,7 @@ export function GroupNode(props: NodeProps): JSX.Element {
38
38
  paddingRight: "48px",
39
39
  }}
40
40
  >
41
- {props.data.variant === "process" ? (
41
+ {props.data.variant === "process" && !!props?.data?.canEdit ? (
42
42
  <AddCircleOutlineIcon
43
43
  sx={{
44
44
  color: "grey.600",
@@ -47,6 +47,20 @@ export function GroupNode(props: NodeProps): JSX.Element {
47
47
  },
48
48
  marginLeft: "-16px",
49
49
  }}
50
+ onClick={(e) => {
51
+ e.stopPropagation();
52
+ e.preventDefault();
53
+
54
+ document.dispatchEvent(
55
+ new CustomEvent("addItem", {
56
+ detail: {
57
+ sort: (props?.data?.maxSort as number) + 1,
58
+ paralellelProcessingGroup:
59
+ props?.data?.parallelProcessingGroup,
60
+ },
61
+ }),
62
+ );
63
+ }}
50
64
  />
51
65
  ) : null}
52
66
  </CardContent>
@@ -1,5 +1,12 @@
1
1
  import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
- import { Box, Card, CardContent, Typography, useTheme } from "@mui/material";
2
+ import {
3
+ Box,
4
+ Card,
5
+ CardContent,
6
+ Typography,
7
+ IconButton,
8
+ useTheme,
9
+ } from "@mui/material";
3
10
  import { Handle, type NodeProps, Position } from "@xyflow/react";
4
11
  import type { ProcessTask } from "../../../../../admin-core/src/api/e4/graphqlRequestSdk";
5
12
  import { mapIconByOrchestrationType } from "../task-icon";
@@ -26,6 +33,9 @@ export function TaskNode(props: NodeProps): JSX.Element {
26
33
  borderColor: props?.data?.disabled ? "grey.700" : "#4E97FD", //Blue not implemented in the theme
27
34
  backgroundColor: props?.data?.disabled ? "#fff" : "#DBF0FE",
28
35
  },
36
+ display: "flex",
37
+ alignItems: "center",
38
+ justifyContent: "center",
29
39
  }}
30
40
  >
31
41
  <CardContent
@@ -37,7 +47,6 @@ export function TaskNode(props: NodeProps): JSX.Element {
37
47
  alignItems: "center",
38
48
  }}
39
49
  >
40
- {/* {props?.data?.icon as any} */}
41
50
  {mapIconByOrchestrationType(
42
51
  (props?.data?.processTask as ProcessTask)?.orchestrationType
43
52
  ?.code as string,
@@ -53,15 +62,34 @@ export function TaskNode(props: NodeProps): JSX.Element {
53
62
  <Handle type="source" position={Position.Bottom} />
54
63
  </Card>
55
64
  {props?.data.isLast ? (
56
- <AddCircleOutlineIcon
57
- sx={{
58
- color: "grey.600",
59
- marginLeft: theme.spacing(1),
60
- "&:hover": {
61
- color: "#4E97FD", //Blue not implemented in the theme
62
- },
65
+ <IconButton
66
+ onClick={(e) => {
67
+ e.stopPropagation();
68
+ e.preventDefault();
69
+
70
+ document.dispatchEvent(
71
+ new CustomEvent("addItem", {
72
+ detail: {
73
+ sort: (props?.data?.processTask as ProcessTask)
74
+ ?.sort as number,
75
+ paralellelProcessingGroup: (
76
+ props?.data?.processTask as ProcessTask
77
+ )?.parallelProcessingGroup,
78
+ },
79
+ }),
80
+ );
63
81
  }}
64
- />
82
+ >
83
+ <AddCircleOutlineIcon
84
+ sx={{
85
+ color: "grey.600",
86
+ marginLeft: theme.spacing(1),
87
+ "&:hover": {
88
+ color: "#4E97FD", //Blue not implemented in the theme
89
+ },
90
+ }}
91
+ />
92
+ </IconButton>
65
93
  ) : null}
66
94
  </Box>
67
95
  );
@@ -5,8 +5,6 @@ import { Box } from "@mui/material";
5
5
  import { MarkerType } from "@xyflow/react";
6
6
  import type { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "../elk-types";
7
7
 
8
- //import { timerIcon, triggerIcon } from "../icons";
9
-
10
8
  const pullIcon = () => {
11
9
  return (
12
10
  <Box
@@ -0,0 +1,404 @@
1
+ import {
2
+ ProcessExecutionDetails,
3
+ ConfigExport,
4
+ ProcessExport,
5
+ ProcessTask,
6
+ ProcessTaskExport,
7
+ ProcessTaskExecution,
8
+ } from "@evenicanpm/admin-core/src/api/e4/graphqlRequestSdk";
9
+ import { Process } from "../../../../../admin-core/src/api/e4/graphqlRequestSdk";
10
+ import {
11
+ ElkExtendedEdgeWithFlow,
12
+ ElkNodeWithFlow,
13
+ GroupNode,
14
+ // ProcessTaskExecutionNode,
15
+ // ProcessTaskNode,
16
+ } from "../elk-types";
17
+ import { MarkerType } from "@xyflow/react";
18
+ import _ from "lodash";
19
+
20
+ const markerEnd = {
21
+ type: MarkerType.ArrowClosed,
22
+ width: 20,
23
+ height: 20,
24
+ };
25
+
26
+ export function mapToCamelCase(processTask: ProcessTaskExport): ProcessTask {
27
+ let key,
28
+ keys = Object.keys(processTask);
29
+ let n = keys.length;
30
+ let newobj: { [key: string]: any } = {};
31
+ while (n--) {
32
+ key = keys[n];
33
+ newobj[key.substring(0, 1).toLowerCase() + key.substring(1)] =
34
+ processTask[key as keyof typeof processTask];
35
+ }
36
+
37
+ return {
38
+ ...newobj,
39
+ id: newobj.processTaskId,
40
+ name: newobj.name,
41
+ sort: newobj.sort,
42
+ orchestrationType: {
43
+ code: newobj.orchestrationType,
44
+ },
45
+ parallelProcessingGroup: newobj.parallelProcessingGroup,
46
+ } as ProcessTask;
47
+ }
48
+
49
+ export const mapEmptyNodesAndEdges = (
50
+ data: Process | ProcessExecutionDetails,
51
+ nodeWidth: number,
52
+ ) => {
53
+ const nodes: ElkNodeWithFlow[] = [];
54
+ const edges: ElkExtendedEdgeWithFlow[] = [];
55
+
56
+ const entryPoint: ElkNodeWithFlow = {
57
+ id: "entry-point",
58
+ type: "entry-node",
59
+ data: {
60
+ isScheduled: false,
61
+ isTriggered: false,
62
+ },
63
+ width: nodeWidth,
64
+ height:
65
+ (data as Process)?.isScheduled && (data as Process)?.isTriggered
66
+ ? 104
67
+ : 70,
68
+ position: { x: 0, y: 0 },
69
+ layoutOptions: {
70
+ "org.eclipse.elk.priority": "1",
71
+ },
72
+ };
73
+
74
+ nodes.push(entryPoint);
75
+
76
+ const entryPointConnector: ElkNodeWithFlow = {
77
+ id: "entry-point-connector",
78
+ position: { x: 0, y: 0 },
79
+ type: "connection-node",
80
+ width: 1,
81
+ height: 1,
82
+ //extent: "parent",
83
+ };
84
+
85
+ nodes.push(entryPointConnector);
86
+
87
+ const groupId = `group-1`;
88
+
89
+ const emptyNode = {
90
+ id: groupId,
91
+ data: {
92
+ label: `Group 1`,
93
+ },
94
+ position: { x: 0, y: 0 },
95
+ type: "empty-node",
96
+ children: [],
97
+ layoutOptions: {
98
+ "org.eclipse.elk.priority": groupId,
99
+ },
100
+ draggable: false,
101
+ width: nodeWidth,
102
+ height: 100,
103
+ };
104
+
105
+ nodes.push(emptyNode);
106
+
107
+ edges.push(
108
+ {
109
+ id: `entry-point-entry-point-connector`,
110
+ sources: ["entry-point"],
111
+ targets: ["entry-point-connector"],
112
+ type: "default-edge",
113
+ },
114
+ {
115
+ id: `entry-point-connector-${groupId}`,
116
+ sources: ["entry-point-connector"],
117
+ targets: [groupId],
118
+ type: "default-edge",
119
+ markerEnd: markerEnd,
120
+ },
121
+ );
122
+
123
+ return {
124
+ nodes,
125
+ edges,
126
+ };
127
+ };
128
+
129
+ // Helper to build groups, nodes, and edges
130
+ function buildGroupsAndEdges({
131
+ entryPoint,
132
+ entryPointConnector,
133
+ groupLabels,
134
+ getGroupTasks,
135
+ // nodeWidth,
136
+ variant,
137
+ onAdd,
138
+ mapTaskToNode,
139
+ groupSortKey = "Sort",
140
+ taskIdKey = "id",
141
+ taskNameKey = "name",
142
+ connectorIdPrefix = "group-",
143
+ }: {
144
+ entryPoint: ElkNodeWithFlow;
145
+ entryPointConnector: ElkNodeWithFlow;
146
+ groupLabels: number[];
147
+ getGroupTasks: Function;
148
+ // nodeWidth: number,
149
+ variant: "process" | "process-execution";
150
+ onAdd?: Function;
151
+ mapTaskToNode: Function;
152
+ groupSortKey: string;
153
+ taskIdKey: string;
154
+ taskNameKey: string;
155
+ connectorIdPrefix: string;
156
+ }) {
157
+ const groups: GroupNode[] = groupLabels.map((groupLabel: any) => ({
158
+ id: `group-${groupLabel}`,
159
+ data: {
160
+ label: `Group ${groupLabel}`,
161
+ variant: variant,
162
+ parallelProcessingGroup: groupLabel,
163
+ canEdit: !!onAdd,
164
+ },
165
+ position: { x: 0, y: 0 },
166
+ type: "group-node",
167
+ children: [],
168
+ layoutOptions: {
169
+ "org.eclipse.elk.priority": `${groupLabel}`,
170
+ },
171
+ draggable: false,
172
+ }));
173
+ const edges: any[] = [];
174
+ edges.push({
175
+ id: `entry-point-entry-point-connector`,
176
+ sources: ["entry-point"],
177
+ targets: ["entry-point-connector"],
178
+ type: "default-edge",
179
+ });
180
+ groups.forEach((group) => {
181
+ edges.push({
182
+ id: `entry-point-connector-${group.id}`,
183
+ sources: ["entry-point-connector"],
184
+ targets: [group.id],
185
+ type: "default-edge",
186
+ markerEnd: markerEnd,
187
+ });
188
+ const groupTasks = getGroupTasks(group);
189
+ const tasksPartitioned = _.values(_.groupBy(groupTasks, groupSortKey));
190
+ const groupNodes: any[] = [];
191
+ tasksPartitioned.forEach((partition) => {
192
+ partition.forEach((task: any, index: number) => {
193
+ groupNodes.push(mapTaskToNode(task, index, partition.length, group.id));
194
+ });
195
+ });
196
+ let prevConnectorId: string | null = null;
197
+ tasksPartitioned.forEach((partition, tpIndex) => {
198
+ _.sortBy(partition, [(task: any) => task[taskNameKey]]);
199
+ if (prevConnectorId) {
200
+ partition.forEach((task: any) => {
201
+ edges.push({
202
+ id: `${prevConnectorId}-${task[taskIdKey] || task[taskNameKey]}`,
203
+ sources: [prevConnectorId],
204
+ targets: [`task-${task[taskIdKey] || task[taskNameKey]}`],
205
+ type: "default-edge",
206
+ markerEnd: markerEnd,
207
+ });
208
+ });
209
+ }
210
+ const connectorId = `${connectorIdPrefix}${group.id}-connect-${tpIndex}`;
211
+ prevConnectorId = connectorId;
212
+ if (tpIndex !== tasksPartitioned.length - 1) {
213
+ partition.forEach((task: any) => {
214
+ edges.push({
215
+ id: `task-${task[taskIdKey] || task[taskNameKey]}-${connectorId}`,
216
+ sources: [`task-${task[taskIdKey] || task[taskNameKey]}`],
217
+ targets: [connectorId],
218
+ type: "default-edge",
219
+ });
220
+ });
221
+ }
222
+ if (prevConnectorId && tpIndex !== tasksPartitioned.length - 1) {
223
+ groupNodes.push({
224
+ id: prevConnectorId,
225
+ position: { x: 0, y: 0 },
226
+ type: "connection-node",
227
+ width: 1,
228
+ height: 1,
229
+ extent: "parent",
230
+ parentId: group.id,
231
+ });
232
+ }
233
+ });
234
+ group.children = groupNodes;
235
+ });
236
+ return { nodes: [entryPoint, entryPointConnector, ...groups], edges };
237
+ }
238
+
239
+ export const mapProcessConfigToNodesAndEdges = (
240
+ data: ConfigExport,
241
+ nodeWidth: number,
242
+ variant: "process" | "process-execution",
243
+ onAdd?: Function,
244
+ ) => {
245
+ const process = data.Processes?.[0] as ProcessExport;
246
+ const entryPoint: ElkNodeWithFlow = {
247
+ id: "entry-point",
248
+ type: "entry-node",
249
+ data: {
250
+ isScheduled:
251
+ variant === "process" ? !!process?.ProcessScheduleGroup : false,
252
+ isTriggered: variant === "process" ? !!process?.IsTriggered : false,
253
+ },
254
+ width: nodeWidth,
255
+ height: process?.ProcessScheduleGroup && process?.IsTriggered ? 104 : 70,
256
+ position: { x: 0, y: 0 },
257
+ layoutOptions: {
258
+ "org.eclipse.elk.priority": "1",
259
+ },
260
+ };
261
+ const entryPointConnector: ElkNodeWithFlow = {
262
+ id: "entry-point-connector",
263
+ position: { x: 0, y: 0 },
264
+ type: "connection-node",
265
+ width: 1,
266
+ height: 1,
267
+ };
268
+ let groupLabels = _.uniq(
269
+ _.map(process?.ProcessTasks, "ParallelProcessingGroup"),
270
+ );
271
+ groupLabels = _.sortBy(groupLabels);
272
+ return buildGroupsAndEdges({
273
+ entryPoint,
274
+ entryPointConnector,
275
+ groupLabels,
276
+ getGroupTasks: (group: any) =>
277
+ _.sortBy(
278
+ process?.ProcessTasks?.filter(
279
+ (task) =>
280
+ task?.ParallelProcessingGroup?.toString() ===
281
+ group.id.split("-")[1],
282
+ ),
283
+ ["Sort", "Name"],
284
+ ),
285
+ //nodeWidth,
286
+ variant,
287
+ onAdd,
288
+ mapTaskToNode: (
289
+ task: any,
290
+ index: number,
291
+ partitionLen: number,
292
+ parentId: string,
293
+ ) => ({
294
+ id: `task-${task?.ProcessTaskId || task?.Name}`,
295
+ data: {
296
+ processTask: mapToCamelCase(task as ProcessTaskExport) || undefined,
297
+ label: task?.Name as string,
298
+ isLast: onAdd ? index === partitionLen - 1 : false,
299
+ onAdd: index === partitionLen - 1 ? onAdd : undefined,
300
+ },
301
+ position: { x: 0, y: 0 },
302
+ type: variant === "process" ? "task-node" : "execution-task-node",
303
+ width: nodeWidth + (index === partitionLen - 1 ? 64 : 0),
304
+ height: 70,
305
+ parentId,
306
+ }),
307
+ groupSortKey: "Sort",
308
+ taskIdKey: "ProcessTaskId",
309
+ taskNameKey: "Name",
310
+ connectorIdPrefix: "group-",
311
+ });
312
+ };
313
+
314
+ export const mapProcessTasksToNodesAndEdges = (
315
+ data: Process | ProcessExecutionDetails,
316
+ nodeWidth: number,
317
+ variant: "process" | "process-execution",
318
+ ) => {
319
+ const entryPoint: ElkNodeWithFlow = {
320
+ id: "entry-point",
321
+ type: "entry-node",
322
+ data: {
323
+ isScheduled:
324
+ variant === "process" ? !!(data as Process)?.isScheduled : false,
325
+ isTriggered:
326
+ variant === "process" ? !!(data as Process)?.isTriggered : false,
327
+ },
328
+ width: nodeWidth,
329
+ height:
330
+ (data as Process)?.isScheduled && (data as Process)?.isTriggered
331
+ ? 104
332
+ : 70,
333
+ position: { x: 0, y: 0 },
334
+ layoutOptions: {
335
+ "org.eclipse.elk.priority": "1",
336
+ },
337
+ };
338
+ const entryPointConnector: ElkNodeWithFlow = {
339
+ id: "entry-point-connector",
340
+ position: { x: 0, y: 0 },
341
+ type: "connection-node",
342
+ width: 1,
343
+ height: 1,
344
+ };
345
+ let groupLabels: number[];
346
+ if (variant === "process") {
347
+ groupLabels = _.uniq(
348
+ _.map((data as Process)?.processTasks, "parallelProcessingGroup"),
349
+ );
350
+ } else {
351
+ groupLabels = _.uniq(
352
+ _.map(
353
+ (data as ProcessExecutionDetails)?.processTaskExecutions,
354
+ "parallelProcessingGroup",
355
+ ),
356
+ );
357
+ }
358
+ groupLabels = _.sortBy(groupLabels);
359
+ return buildGroupsAndEdges({
360
+ entryPoint,
361
+ entryPointConnector,
362
+ groupLabels,
363
+ getGroupTasks: (group: any) =>
364
+ _.sortBy(
365
+ (variant === "process"
366
+ ? (data as Process)?.processTasks
367
+ : (data as ProcessExecutionDetails)?.processTaskExecutions
368
+ )?.filter(
369
+ (task) =>
370
+ task?.parallelProcessingGroup?.toString() ===
371
+ group.id.split("-")[1],
372
+ ),
373
+ ["sort", "name"],
374
+ ),
375
+ //nodeWidth,
376
+ variant,
377
+ onAdd: undefined,
378
+ mapTaskToNode: (
379
+ task: any,
380
+ index: number,
381
+ partitionLen: number,
382
+ parentId: string,
383
+ ) => ({
384
+ id: `task-${task?.id}`,
385
+ data: {
386
+ processTask: variant === "process" ? (task as ProcessTask) : undefined,
387
+ processTaskExecution:
388
+ variant === "process-execution"
389
+ ? (task as ProcessTaskExecution)
390
+ : undefined,
391
+ isLast: index === partitionLen - 1,
392
+ },
393
+ position: { x: 0, y: 0 },
394
+ type: variant === "process" ? "task-node" : "execution-task-node",
395
+ width: nodeWidth + (index === partitionLen - 1 ? 64 : 0),
396
+ height: 70,
397
+ parentId,
398
+ }),
399
+ groupSortKey: "sort",
400
+ taskIdKey: "id",
401
+ taskNameKey: "name",
402
+ connectorIdPrefix: "group-",
403
+ });
404
+ };
@@ -14,7 +14,7 @@ const StyledContainer = styled("div")(() => ({
14
14
  export default function MainLayout({
15
15
  children,
16
16
  }: {
17
- children: React.ReactNode;
17
+ readonly children: React.ReactNode;
18
18
  }) {
19
19
  return (
20
20
  <LayoutProvider>
@@ -9,17 +9,14 @@ interface Props {
9
9
  sx?: SxProps;
10
10
  }
11
11
 
12
- export default function RootContainer(props: Props) {
12
+ export default function RootContainer(props: Readonly<Props>) {
13
13
  const theme = useTheme();
14
14
  const styles = getStyles(theme);
15
15
 
16
16
  const defaultMaxWidth = "xl";
17
17
 
18
18
  return (
19
- <Container
20
- maxWidth={props.maxWidth !== undefined ? props.maxWidth : defaultMaxWidth}
21
- sx={props.sx}
22
- >
19
+ <Container maxWidth={props.maxWidth ?? defaultMaxWidth} sx={props.sx}>
23
20
  <Box sx={styles.root}>
24
21
  <Stack spacing={2}>{props.children}</Stack>
25
22
  <IntegrateFooter />
@@ -20,7 +20,7 @@ export default function LinkCard({
20
20
  url,
21
21
  onClick,
22
22
  children,
23
- }: Props) {
23
+ }: Readonly<Props>) {
24
24
  const handleRedirect = () => {
25
25
  if (onClick) {
26
26
  onClick();
@@ -18,7 +18,9 @@ const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
18
18
 
19
19
  const updateValue = (date: null | Date | string) => {
20
20
  const newValue: string | null =
21
- date !== null && typeof date !== "string" && !isNaN(date?.getTime())
21
+ date !== null &&
22
+ typeof date !== "string" &&
23
+ !Number.isNaN(date?.getTime())
22
24
  ? date.toISOString()
23
25
  : null;
24
26
 
@@ -29,7 +29,9 @@ const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
29
29
 
30
30
  const updateValue = (part: "start" | "end", date: null | Date | string) => {
31
31
  const dateValue: string | null =
32
- date !== null && typeof date !== "string" && !isNaN(date?.getTime())
32
+ date !== null &&
33
+ typeof date !== "string" &&
34
+ !Number.isNaN(date?.getTime())
33
35
  ? date.toISOString()
34
36
  : null;
35
37
 
@@ -50,7 +52,7 @@ const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
50
52
  let errorValue: typeof error = {
51
53
  start: null,
52
54
  end: null,
53
- ...(error ? error : {}),
55
+ ...error,
54
56
  [part]: newError ? t("Filter.invalidDate") : null,
55
57
  };
56
58
 
@@ -313,7 +313,7 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
313
313
  variant="contained"
314
314
  color="info"
315
315
  startIcon={<ArrowForwardIos />}
316
- disabled={Object.values(filterErrors).some((v) => v)}
316
+ disabled={Object.values(filterErrors).some(Boolean)}
317
317
  onClick={handleFilterSet}
318
318
  >
319
319
  {t("filter")}
@@ -39,10 +39,16 @@ const SelectFilterComponent: React.FC<FilterProps<SelectFilter>> = ({
39
39
  ) as { [id: string | number]: FilterOption };
40
40
 
41
41
  const updateValue = (optionId: string | number | null) => {
42
- const newValue =
43
- optionId !== null ? mappedOptionDictionary[optionId] : null;
44
- setValue(newValue && [newValue]);
45
- onSet(newValue && [newValue]);
42
+ if (optionId == null) {
43
+ setValue(null);
44
+ onSet(null);
45
+ return;
46
+ }
47
+
48
+ const newValue = mappedOptionDictionary[optionId];
49
+
50
+ setValue(newValue ? [newValue] : null);
51
+ onSet(newValue ? [newValue] : null);
46
52
  };
47
53
 
48
54
  return (
@@ -82,7 +82,7 @@ interface Props {
82
82
  defaultScheduledProcess?: DefaultScheduledProcess;
83
83
  }
84
84
 
85
- export default function ScheduleDetailsIntegrations(props: Props) {
85
+ export default function ScheduleDetailsIntegrations(props: Readonly<Props>) {
86
86
  const t = useTranslations("Integrate.Scheduler");
87
87
  const l = useTranslations("Integrate.Filter");
88
88
 
@@ -179,12 +179,12 @@ export default function ScheduleDetailsIntegrations(props: Props) {
179
179
 
180
180
  const debounceFetch = debounce(fetchNonScheduledProcesses, 400);
181
181
  useEffect(() => {
182
- if (searchTerm !== "") {
183
- debounceFetch(searchTerm);
184
- } else {
182
+ if (searchTerm === "") {
185
183
  setItems([]);
186
184
  setNonScheduledProcessesResult(null);
187
185
  setNonScheduledMode(false);
186
+ } else {
187
+ debounceFetch(searchTerm);
188
188
  }
189
189
  return debounceFetch.cancel;
190
190
  }, [searchTerm]);
@@ -255,8 +255,7 @@ export default function ScheduleDetailsIntegrations(props: Props) {
255
255
  if (
256
256
  props.dispatchDetails &&
257
257
  props.defaultScheduledProcess &&
258
- props.details.processes &&
259
- props.details.processes.length === 0
258
+ props?.details?.processes?.length === 0
260
259
  ) {
261
260
  handleClickAddIntegration({
262
261
  ...props.defaultScheduledProcess,
@@ -374,8 +373,7 @@ export default function ScheduleDetailsIntegrations(props: Props) {
374
373
  {
375
374
  // Processes found in details state (using props.details.processes)
376
375
  !nonScheduledMode &&
377
- props.details.processes &&
378
- props.details.processes.map((item) => (
376
+ props?.details?.processes?.map((item) => (
379
377
  <SortableIntegrationRow
380
378
  key={item.id}
381
379
  item={item as Process}
@@ -43,7 +43,7 @@ interface Props {
43
43
  readOnly?: boolean;
44
44
  }
45
45
 
46
- export default function ScheduleDetailsMain(props: Props) {
46
+ export default function ScheduleDetailsMain(props: Readonly<Props>) {
47
47
  const t = useTranslations("Integrate.Scheduler");
48
48
 
49
49
  const theme = useTheme();