@evenicanpm/admin-integrate 1.2.2 → 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 (215) hide show
  1. package/documents/ConfigImport/configuration-import.ts +54 -0
  2. package/documents/CopyProcess/copy.ts +25 -0
  3. package/documents/Endpoint/fragments.ts +9 -0
  4. package/documents/Endpoint/list.ts +30 -0
  5. package/documents/Process/fragments.ts +22 -0
  6. package/documents/Process/get-process-details.ts +72 -0
  7. package/documents/Process/list.ts +24 -0
  8. package/documents/ProcessConfig/fragments.ts +116 -0
  9. package/documents/ProcessConfig/read.ts +35 -0
  10. package/documents/ProcessExecution/fragments.ts +12 -0
  11. package/documents/ProcessExecution/list.ts +30 -1
  12. package/documents/ProcessExecutionDetails/fragments.ts +96 -0
  13. package/documents/ProcessExecutionDetails/read.ts +12 -0
  14. package/documents/ProcessExport/read.ts +108 -0
  15. package/documents/ProcessScheduleGroup/read.ts +43 -0
  16. package/documents/ProcessTask/fragments.ts +288 -0
  17. package/documents/ProcessTask/read.ts +12 -0
  18. package/documents/ProcessTemplate/fragments.ts +74 -0
  19. package/documents/ProcessTemplate/list.ts +67 -0
  20. package/documents/ProcessTemplate/read.ts +12 -0
  21. package/documents/RunProcess/run.ts +11 -0
  22. package/package.json +4 -3
  23. package/src/api/Integrations/queries/get-process.query.ts +12 -12
  24. package/src/api/Integrations/queries/get-process.server.ts +7 -2
  25. package/src/api/configuration/queries/configuration-export.query.ts +48 -0
  26. package/src/api/configuration/queries/configuration-export.server.ts +9 -0
  27. package/src/api/configuration/queries/index.ts +1 -0
  28. package/src/api/dashboard/queries/get-process-executions.query.ts +6 -3
  29. package/src/api/dashboard/queries/get-process-executions.server.ts +1 -1
  30. package/src/api/execution-details/queries/get-process-execution-details.query.ts +46 -0
  31. package/src/api/execution-details/queries/get-process-execution-details.server.ts +11 -0
  32. package/src/api/execution-details/queries/get-process-executions-by-process.query.ts +48 -0
  33. package/src/api/execution-details/queries/get-process-executions-by-process.server.ts +11 -0
  34. package/src/api/execution-details/queries/index.ts +2 -0
  35. package/src/api/process/mutations/copy-process.mutation.ts +45 -0
  36. package/src/api/process/mutations/copy-process.server.ts +14 -0
  37. package/src/api/process/mutations/index.ts +2 -0
  38. package/src/api/process/mutations/run-process.mutation.ts +41 -0
  39. package/src/api/process/mutations/run-process.server.ts +14 -0
  40. package/src/api/process/queries/get-process-by-id.query.ts +85 -0
  41. package/src/api/process/queries/get-process-by-id.server.ts +20 -0
  42. package/src/api/process/queries/index.ts +4 -0
  43. package/src/api/process-config/mutation/index.ts +2 -0
  44. package/src/api/process-config/mutation/process-config-import.mutation.ts +42 -0
  45. package/src/api/process-config/mutation/process-config-import.server.ts +14 -0
  46. package/src/api/process-config/mutation/process-config-merge.mutation.ts +33 -0
  47. package/src/api/process-config/mutation/process-config-merge.server.ts +14 -0
  48. package/src/api/process-task/queries/get-process-task-by-id.query.ts +46 -0
  49. package/src/api/process-task/queries/get-process-task-by-id.server.ts +9 -0
  50. package/src/api/process-task/queries/index.ts +1 -0
  51. package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +47 -0
  52. package/src/api/scheduler/mutation/create-process-schedule-group-details.server.ts +14 -0
  53. package/src/api/scheduler/mutation/index.ts +2 -0
  54. package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +47 -0
  55. package/src/api/scheduler/mutation/update-process-schedule-group-details.server.ts +14 -0
  56. package/src/api/scheduler/queries/get-non-scheduled-processes.query.ts +48 -0
  57. package/src/api/scheduler/queries/get-non-scheduled-processes.server.ts +11 -0
  58. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +6 -3
  59. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +3 -3
  60. package/src/api/scheduler/queries/get-process-schedule.query.ts +6 -3
  61. package/src/api/scheduler/queries/get-process-schedule.server.ts +3 -3
  62. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +6 -3
  63. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +1 -1
  64. package/src/api/scheduler/queries/index.ts +3 -2
  65. package/src/api/templates/queries/get-process-template-groups.query.ts +48 -0
  66. package/src/api/templates/queries/get-process-template-groups.server.ts +11 -0
  67. package/src/api/templates/queries/get-process-template-records.query.ts +48 -0
  68. package/src/api/templates/queries/get-process-template-records.server.ts +11 -0
  69. package/src/api/templates/queries/get-process-template.query.ts +48 -0
  70. package/src/api/templates/queries/get-process-template.server.ts +9 -0
  71. package/src/api/templates/queries/get-process-templates.query.ts +45 -0
  72. package/src/api/templates/queries/get-process-templates.server.ts +9 -0
  73. package/src/api/templates/queries/index.ts +5 -0
  74. package/src/api/templates/queries/template-input-search.query.ts +39 -0
  75. package/src/api/templates/queries/template-input-search.server.ts +42 -0
  76. package/src/api/templates/queries/types.ts +34 -0
  77. package/src/components/breadcrumbs/breadcrumbs.tsx +33 -6
  78. package/src/components/button/outlined-icon-button.tsx +2 -2
  79. package/src/components/core/date-time-popover.tsx +12 -5
  80. package/src/components/core/drawer-buttons.tsx +52 -0
  81. package/src/components/core/edited-typography.tsx +2 -2
  82. package/src/components/core/index.ts +4 -2
  83. package/src/components/core/loading.tsx +1 -1
  84. package/src/components/core/status-tag.tsx +97 -0
  85. package/src/components/core/title-edit.tsx +31 -22
  86. package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
  87. package/src/components/dashboard-list/dashboard-list.tsx +20 -16
  88. package/src/components/data-table/table-header.tsx +6 -8
  89. package/src/components/data-table/table-pagination.tsx +1 -1
  90. package/src/components/data-table/table-row.tsx +1 -1
  91. package/src/components/data-table/table-skeleton.tsx +10 -5
  92. package/src/components/execution/execution-filter.ts +1 -1
  93. package/src/components/execution/execution-status-icon.tsx +7 -7
  94. package/src/components/execution/execution-tag.tsx +12 -77
  95. package/src/components/execution/index.ts +1 -1
  96. package/src/components/execution-history-drawer/execution-history-drawer.tsx +202 -0
  97. package/src/components/execution-history-drawer/executions-card.tsx +85 -0
  98. package/src/components/execution-history-drawer/index.ts +1 -0
  99. package/src/components/footer/footer.tsx +10 -6
  100. package/src/components/header/dashboard-list-header.tsx +12 -7
  101. package/src/components/header/execution-details-header.tsx +35 -26
  102. package/src/components/header/header.tsx +10 -3
  103. package/src/components/header/index.ts +1 -1
  104. package/src/components/header/integration-details-header.tsx +108 -45
  105. package/src/components/integration-list/index.ts +2 -1
  106. package/src/components/integration-list/integration-filter.ts +1 -1
  107. package/src/components/integration-list/integration-status-icon.tsx +7 -8
  108. package/src/components/integration-list/integration-tag.tsx +6 -50
  109. package/src/components/integration-list/list/integration-list-row.tsx +161 -0
  110. package/src/components/integration-list/list/integration-list-table.tsx +62 -0
  111. package/src/{pages/integrations/integration-list → components/integration-list/list}/integration-list.tsx +47 -51
  112. package/src/components/integration-view/animated-svg.tsx +31 -0
  113. package/src/components/integration-view/edges/default-edge.tsx +2 -6
  114. package/src/components/integration-view/elk-layout-options.ts +2 -2
  115. package/src/components/integration-view/elk-types.ts +35 -6
  116. package/src/components/integration-view/flow-types.tsx +12 -0
  117. package/src/components/integration-view/integration-view.tsx +562 -56
  118. package/src/components/integration-view/nodes/add-node.tsx +20 -0
  119. package/src/components/integration-view/nodes/empty-node.tsx +65 -0
  120. package/src/components/integration-view/nodes/entry-node.tsx +98 -4
  121. package/src/components/integration-view/nodes/execution-entry-node.tsx +107 -0
  122. package/src/components/integration-view/nodes/execution-task-node.tsx +88 -0
  123. package/src/components/integration-view/nodes/group-node.tsx +33 -13
  124. package/src/components/integration-view/nodes/row-node.tsx +19 -0
  125. package/src/components/integration-view/nodes/task-node.tsx +50 -16
  126. package/src/components/integration-view/task-icon.tsx +193 -0
  127. package/src/components/integration-view/temp-data/initialElements.tsx +34 -32
  128. package/src/components/integration-view/types.ts +2 -2
  129. package/src/components/integration-view/utils/mapping.ts +404 -0
  130. package/src/components/layouts/main-layout.tsx +3 -4
  131. package/src/components/layouts/root-container.tsx +5 -11
  132. package/src/components/link-cards/link-card.tsx +15 -4
  133. package/src/components/link-cards/styles.ts +1 -1
  134. package/src/components/list-filter/date-filter.tsx +7 -4
  135. package/src/components/list-filter/date-range-filter.tsx +15 -7
  136. package/src/components/list-filter/index.ts +1 -1
  137. package/src/components/list-filter/list-filter.tsx +31 -26
  138. package/src/components/list-filter/multi-select-filter.tsx +11 -10
  139. package/src/components/list-filter/select-filter.tsx +23 -12
  140. package/src/components/scheduler/day-selector.tsx +29 -15
  141. package/src/components/scheduler/day-tag.tsx +14 -51
  142. package/src/components/scheduler/index.ts +2 -1
  143. package/src/components/scheduler/schedule-drawer/details-reducer.ts +217 -0
  144. package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +501 -0
  145. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +137 -100
  146. package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +94 -0
  147. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-skeleton.tsx +1 -2
  148. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details.tsx +10 -14
  149. package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +214 -0
  150. package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +7 -26
  151. package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +116 -0
  152. package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +130 -0
  153. package/src/components/scheduler/schedule-filter.ts +1 -1
  154. package/src/components/scheduler/schedule-icon.tsx +5 -6
  155. package/src/components/scheduler/schedule-integration-icon.tsx +31 -0
  156. package/src/components/templates/index.ts +1 -0
  157. package/src/components/templates/inputs/index.tsx +1392 -0
  158. package/src/components/templates/template-filter.ts +5 -0
  159. package/src/components/templates/templates-list/index.ts +1 -0
  160. package/src/components/templates/templates-list/templates-list-row.tsx +55 -0
  161. package/src/components/templates/templates-list/templates-list-table.tsx +58 -0
  162. package/src/components/templates/templates-list/templates-list.tsx +253 -0
  163. package/src/components/templates/types.tsx +76 -0
  164. package/src/components/templates/wizard.tsx +737 -0
  165. package/src/hooks/use-breadcrumbs.ts +1 -1
  166. package/src/hooks/use-recurrence.tsx +1 -2
  167. package/src/pages/dashboard/dashboard-link-cards.tsx +8 -11
  168. package/src/pages/dashboard/dashboard-list-sections.tsx +8 -10
  169. package/src/pages/dashboard/dashboard.tsx +1 -2
  170. package/src/pages/execution-details/execution-details.tsx +212 -14
  171. package/src/pages/execution-details/task-execution-details.tsx +160 -0
  172. package/src/pages/execution-details/task-execution-drawer.tsx +54 -0
  173. package/src/pages/executions/executions-list/executions-list-row.tsx +21 -27
  174. package/src/pages/executions/executions-list/executions-list-table.tsx +29 -36
  175. package/src/pages/executions/executions-list/executions-list.tsx +24 -18
  176. package/src/pages/executions/executions.tsx +11 -15
  177. package/src/pages/integration-create/index.ts +1 -0
  178. package/src/pages/integration-create/integration-create.tsx +216 -0
  179. package/src/pages/integration-create/pre-creation-step.tsx +84 -0
  180. package/src/pages/integration-create/select-step.tsx +105 -0
  181. package/src/pages/integration-create/template-list-step.tsx +77 -0
  182. package/src/pages/integration-create/wizard-step.tsx +51 -0
  183. package/src/pages/integration-details/import-process/copy-tasks-list.tsx +265 -0
  184. package/src/pages/integration-details/import-process/copy-tasks-row.tsx +77 -0
  185. package/src/pages/integration-details/import-process/import-confirm.tsx +61 -0
  186. package/src/pages/integration-details/import-process/import-drawer.tsx +48 -0
  187. package/src/pages/integration-details/import-process/import-process-reducer.ts +90 -0
  188. package/src/pages/integration-details/import-process/import-process.tsx +149 -0
  189. package/src/pages/integration-details/index.ts +1 -0
  190. package/src/pages/integration-details/integration-details.tsx +468 -0
  191. package/src/pages/integration-details/task-drawer/add-task.tsx +172 -0
  192. package/src/pages/integration-details/task-drawer/edit-task.tsx +161 -0
  193. package/src/pages/integration-details/task-drawer/task-drawer.tsx +157 -0
  194. package/src/pages/integration-details/task-drawer/task-reducer.ts +103 -0
  195. package/src/pages/integrations/integrations.tsx +11 -14
  196. package/src/pages/scheduler/scheduler.tsx +12 -24
  197. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +27 -37
  198. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +28 -43
  199. package/src/pages/scheduler/schedules-list/schedules-list.tsx +48 -21
  200. package/src/utils/date-functions.ts +69 -0
  201. package/src/utils/slugify.ts +3 -0
  202. package/tsconfig.json +12 -4
  203. package/src/hooks/use-timestamp.tsx +0 -25
  204. package/src/pages/integrations/integration-list/integration-list-row.tsx +0 -147
  205. package/src/pages/integrations/integration-list/integration-list-table.tsx +0 -78
  206. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +0 -227
  207. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +0 -77
  208. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +0 -72
  209. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +0 -103
  210. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +0 -101
  211. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +0 -93
  212. /package/src/{pages/integrations/integration-list → components/integration-list/list}/index.ts +0 -0
  213. /package/src/{pages → components}/scheduler/schedule-drawer/edited/edited-types.ts +0 -0
  214. /package/src/{pages → components}/scheduler/schedule-drawer/edited/index.ts +0 -0
  215. /package/src/{pages → components}/scheduler/schedule-drawer/index.ts +0 -0
@@ -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
+ };
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import { styled } from "@mui/material";
3
2
 
4
3
  import BodyWrapper from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-body-wrapper";
5
- import DashboardSidebar from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-sidebar/dashboard-sidebar";
6
-
7
4
  import { LayoutProvider } from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-layout-context";
5
+ import DashboardSidebar from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-sidebar/dashboard-sidebar";
6
+ import { styled } from "@mui/material";
8
7
 
9
8
  // STYLED COMPONENT
10
9
  const StyledContainer = styled("div")(() => ({
@@ -15,7 +14,7 @@ const StyledContainer = styled("div")(() => ({
15
14
  export default function MainLayout({
16
15
  children,
17
16
  }: {
18
- children: React.ReactNode;
17
+ readonly children: React.ReactNode;
19
18
  }) {
20
19
  return (
21
20
  <LayoutProvider>
@@ -1,10 +1,7 @@
1
- import React from "react";
2
-
3
- import { Theme, useTheme } from "@mui/material";
4
- import { Container, Box, Stack } from "@mui/material";
5
- import { SxProps, Breakpoint } from "@mui/system";
6
-
7
1
  import { IntegrateFooter } from "@evenicanpm/admin-integrate/components/footer";
2
+ import { Box, Container, Stack, type Theme, useTheme } from "@mui/material";
3
+ import type { Breakpoint, SxProps } from "@mui/system";
4
+ import type React from "react";
8
5
 
9
6
  interface Props {
10
7
  maxWidth?: false | Breakpoint;
@@ -12,17 +9,14 @@ interface Props {
12
9
  sx?: SxProps;
13
10
  }
14
11
 
15
- export default function RootContainer(props: Props) {
12
+ export default function RootContainer(props: Readonly<Props>) {
16
13
  const theme = useTheme();
17
14
  const styles = getStyles(theme);
18
15
 
19
16
  const defaultMaxWidth = "xl";
20
17
 
21
18
  return (
22
- <Container
23
- maxWidth={props.maxWidth !== undefined ? props.maxWidth : defaultMaxWidth}
24
- sx={props.sx}
25
- >
19
+ <Container maxWidth={props.maxWidth ?? defaultMaxWidth} sx={props.sx}>
26
20
  <Box sx={styles.root}>
27
21
  <Stack spacing={2}>{props.children}</Stack>
28
22
  <IntegrateFooter />
@@ -1,19 +1,30 @@
1
1
  // STYLED COMPONENTS
2
- import { BodyText, TitleText, Wrapper } from "./styles";
3
- import React from "react";
4
- import { redirect, RedirectType } from "next/navigation";
2
+
5
3
  import { Box, CardActionArea } from "@mui/material";
4
+ import { RedirectType, redirect } from "next/navigation";
5
+ import type React from "react";
6
+ import { BodyText, TitleText, Wrapper } from "./styles";
6
7
 
7
8
  // ============================================================
8
9
  type Props = {
9
10
  title: string;
10
11
  description?: string;
11
12
  url?: string;
13
+ onClick?: () => void;
12
14
  children?: React.ReactNode;
13
15
  };
14
16
  // ============================================================
15
- export default function LinkCard({ title, description, url, children }: Props) {
17
+ export default function LinkCard({
18
+ title,
19
+ description,
20
+ url,
21
+ onClick,
22
+ children,
23
+ }: Readonly<Props>) {
16
24
  const handleRedirect = () => {
25
+ if (onClick) {
26
+ onClick();
27
+ }
17
28
  if (url) {
18
29
  redirect(url, RedirectType.push);
19
30
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- import styled from "@mui/material/styles/styled";
4
3
  import { Card, Typography } from "@mui/material";
4
+ import styled from "@mui/material/styles/styled";
5
5
 
6
6
  // STYLED COMPONENTS
7
7
  export const Wrapper = styled(Card)(({ theme }) => ({
@@ -1,8 +1,9 @@
1
- import { Typography, FormControl } from "@mui/material";
1
+ import { FormControl, Typography } from "@mui/material";
2
2
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
3
- import React, { useState } from "react";
4
- import { DateFilter, FilterProps } from "./list-filter-types";
5
3
  import { useTranslations } from "next-intl";
4
+ import type React from "react";
5
+ import { useState } from "react";
6
+ import type { DateFilter, FilterProps } from "./list-filter-types";
6
7
 
7
8
  const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
8
9
  filter,
@@ -17,7 +18,9 @@ const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
17
18
 
18
19
  const updateValue = (date: null | Date | string) => {
19
20
  const newValue: string | null =
20
- date !== null && typeof date !== "string" && !isNaN(date?.getTime())
21
+ date !== null &&
22
+ typeof date !== "string" &&
23
+ !Number.isNaN(date?.getTime())
21
24
  ? date.toISOString()
22
25
  : null;
23
26
 
@@ -1,9 +1,15 @@
1
- import { Box, Typography, Theme, useTheme, FormControl } from "@mui/material";
2
- import { useTranslations } from "next-intl";
3
-
1
+ import {
2
+ Box,
3
+ FormControl,
4
+ type Theme,
5
+ Typography,
6
+ useTheme,
7
+ } from "@mui/material";
4
8
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
5
- import React, { useState } from "react";
6
- import { DateRangeFilter, FilterProps } from "./list-filter-types";
9
+ import { useTranslations } from "next-intl";
10
+ import type React from "react";
11
+ import { useState } from "react";
12
+ import type { DateRangeFilter, FilterProps } from "./list-filter-types";
7
13
 
8
14
  const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
9
15
  filter,
@@ -23,7 +29,9 @@ const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
23
29
 
24
30
  const updateValue = (part: "start" | "end", date: null | Date | string) => {
25
31
  const dateValue: string | null =
26
- date !== null && typeof date !== "string" && !isNaN(date?.getTime())
32
+ date !== null &&
33
+ typeof date !== "string" &&
34
+ !Number.isNaN(date?.getTime())
27
35
  ? date.toISOString()
28
36
  : null;
29
37
 
@@ -44,7 +52,7 @@ const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
44
52
  let errorValue: typeof error = {
45
53
  start: null,
46
54
  end: null,
47
- ...(error ? error : {}),
55
+ ...error,
48
56
  [part]: newError ? t("Filter.invalidDate") : null,
49
57
  };
50
58
 
@@ -1,6 +1,6 @@
1
1
  export { default as DateFilter } from "./date-filter";
2
2
  export { default as DateRangeFilter } from "./date-range-filter";
3
3
  export { default as ListFilter } from "./list-filter";
4
+ export * from "./list-filter-types";
4
5
  export { default as MultiSelectFilterComponent } from "./multi-select-filter";
5
6
  export { default as SelectFilterComponent } from "./select-filter";
6
- export * from "./list-filter-types";
@@ -1,42 +1,42 @@
1
1
  "use client";
2
- import { debounce } from "lodash";
3
- import { useTranslations } from "next-intl";
4
- import React, { useEffect, useState } from "react";
5
2
 
6
3
  import {
7
- Search,
8
- FilterAltOutlined,
9
- CloseOutlined,
10
4
  ArrowForwardIos,
5
+ CloseOutlined,
11
6
  Delete,
7
+ FilterAltOutlined,
8
+ Search,
12
9
  } from "@mui/icons-material";
13
10
  import {
11
+ Badge,
14
12
  Box,
15
13
  Button,
14
+ ClickAwayListener,
16
15
  IconButton,
17
- TextField,
18
16
  InputAdornment,
19
- Select,
20
17
  MenuItem,
21
- Theme,
22
- useTheme,
23
18
  Paper,
24
19
  Popper,
25
- Badge,
26
- ClickAwayListener,
20
+ Select,
21
+ TextField,
22
+ type Theme,
23
+ useTheme,
27
24
  } from "@mui/material";
28
- import {
29
- Filters,
25
+ import { debounce } from "lodash";
26
+ import { useTranslations } from "next-intl";
27
+ import type React from "react";
28
+ import { useEffect, useState } from "react";
29
+ import { OutlinedIconButton } from "../button";
30
+ import DateFilterComponent from "./date-filter";
31
+ import DateRangeFilterComponent from "./date-range-filter";
32
+ import type {
33
+ FilterConfig,
30
34
  FilterResult,
35
+ Filters,
31
36
  ListFilterOutput,
32
- FilterConfig,
33
37
  } from "./list-filter-types";
34
-
35
- import { OutlinedIconButton } from "../button";
36
- import SelectFilterComponent from "./select-filter";
37
38
  import MultiSelectFilterComponent from "./multi-select-filter";
38
- import DateFilterComponent from "./date-filter";
39
- import DateRangeFilterComponent from "./date-range-filter";
39
+ import SelectFilterComponent from "./select-filter";
40
40
 
41
41
  interface FilterProps<FilterShape extends Filters> {
42
42
  setFilters: (filterUpdate: ListFilterOutput<FilterShape>) => void;
@@ -74,14 +74,14 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
74
74
  if (filter.type === "select" && filter.value)
75
75
  return {
76
76
  ...values,
77
- // @ts-ignore
77
+ // @ts-expect-error
78
78
  [key]: filter.options.find((o) => o.id === filter.value[0].id),
79
79
  };
80
80
  if (filter.type === "multiSelect" && filter.value)
81
81
  return {
82
82
  ...values,
83
83
  [key]: filter.options.filter((o) =>
84
- // @ts-ignore
84
+ // @ts-expect-error
85
85
  filter.value.find((v) => v.id === o.id),
86
86
  ),
87
87
  };
@@ -217,7 +217,12 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
217
217
  <FilterAltOutlined />
218
218
  </OutlinedIconButton>
219
219
  </Badge>
220
- <Popper open={open} anchorEl={anchorEl} placement="bottom-start">
220
+ <Popper
221
+ sx={{ zIndex: theme.zIndex.drawer + 1 }}
222
+ open={open}
223
+ anchorEl={anchorEl}
224
+ placement="bottom-start"
225
+ >
221
226
  <Paper sx={styles.popOut} elevation={3}>
222
227
  <Box sx={styles.closeRow}>
223
228
  {manualClose ? (
@@ -298,7 +303,7 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
298
303
  startIcon={<Delete />}
299
304
  onClick={handleFilterClear}
300
305
  >
301
- Clear
306
+ {t("clear")}
302
307
  </Button>
303
308
  ) : (
304
309
  ""
@@ -308,10 +313,10 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
308
313
  variant="contained"
309
314
  color="info"
310
315
  startIcon={<ArrowForwardIos />}
311
- disabled={Object.values(filterErrors).some((v) => v)}
316
+ disabled={Object.values(filterErrors).some(Boolean)}
312
317
  onClick={handleFilterSet}
313
318
  >
314
- Filter
319
+ {t("filter")}
315
320
  </Button>
316
321
  </Box>
317
322
  </Box>