@evenicanpm/admin-integrate 1.2.0 → 1.3.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 (208) 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 +22 -0
  5. package/documents/Process/fragments.ts +35 -0
  6. package/documents/Process/get-process-details.ts +73 -0
  7. package/documents/Process/list.ts +51 -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/ProcessScheduleGroup/read.ts +43 -0
  15. package/documents/ProcessTask/fragments.ts +285 -0
  16. package/documents/ProcessTask/read.ts +12 -0
  17. package/documents/ProcessTemplate/fragments.ts +69 -0
  18. package/documents/ProcessTemplate/list.ts +67 -0
  19. package/documents/ProcessTemplate/read.ts +12 -0
  20. package/documents/RunProcess/run.ts +11 -0
  21. package/package.json +4 -3
  22. package/src/api/Integrations/queries/get-process.query.ts +48 -0
  23. package/src/api/Integrations/queries/get-process.server.ts +14 -0
  24. package/src/api/Integrations/queries/index.ts +1 -0
  25. package/src/api/dashboard/queries/get-process-executions.query.ts +6 -3
  26. package/src/api/dashboard/queries/get-process-executions.server.ts +1 -1
  27. package/src/api/execution-details/queries/get-process-execution-details.query.ts +46 -0
  28. package/src/api/execution-details/queries/get-process-execution-details.server.ts +11 -0
  29. package/src/api/execution-details/queries/get-process-executions-by-process.query.ts +48 -0
  30. package/src/api/execution-details/queries/get-process-executions-by-process.server.ts +11 -0
  31. package/src/api/execution-details/queries/index.ts +2 -0
  32. package/src/api/process/mutations/copy-process.mutation.ts +48 -0
  33. package/src/api/process/mutations/copy-process.server.ts +14 -0
  34. package/src/api/process/mutations/index.ts +2 -0
  35. package/src/api/process/mutations/run-process.mutation.ts +41 -0
  36. package/src/api/process/mutations/run-process.server.ts +14 -0
  37. package/src/api/process/queries/get-process-by-id.query.ts +85 -0
  38. package/src/api/process/queries/get-process-by-id.server.ts +20 -0
  39. package/src/api/process/queries/index.ts +4 -0
  40. package/src/api/process-config/mutation/index.ts +2 -0
  41. package/src/api/process-config/mutation/process-config-import.mutation.ts +33 -0
  42. package/src/api/process-config/mutation/process-config-import.server.ts +14 -0
  43. package/src/api/process-config/mutation/process-config-merge.mutation.ts +33 -0
  44. package/src/api/process-config/mutation/process-config-merge.server.ts +14 -0
  45. package/src/api/process-task/queries/get-process-task-by-id.query.ts +45 -0
  46. package/src/api/process-task/queries/get-process-task-by-id.server.ts +9 -0
  47. package/src/api/process-task/queries/index.ts +1 -0
  48. package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +47 -0
  49. package/src/api/scheduler/mutation/create-process-schedule-group-details.server.ts +14 -0
  50. package/src/api/scheduler/mutation/index.ts +2 -0
  51. package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +47 -0
  52. package/src/api/scheduler/mutation/update-process-schedule-group-details.server.ts +14 -0
  53. package/src/api/scheduler/queries/get-non-scheduled-processes.query.ts +48 -0
  54. package/src/api/scheduler/queries/get-non-scheduled-processes.server.ts +11 -0
  55. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +6 -3
  56. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +3 -3
  57. package/src/api/scheduler/queries/get-process-schedule.query.ts +6 -3
  58. package/src/api/scheduler/queries/get-process-schedule.server.ts +3 -3
  59. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +6 -3
  60. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +1 -1
  61. package/src/api/scheduler/queries/index.ts +3 -2
  62. package/src/api/templates/queries/get-process-template-groups.query.ts +48 -0
  63. package/src/api/templates/queries/get-process-template-groups.server.ts +11 -0
  64. package/src/api/templates/queries/get-process-template-records.query.ts +48 -0
  65. package/src/api/templates/queries/get-process-template-records.server.ts +11 -0
  66. package/src/api/templates/queries/get-process-template.query.ts +48 -0
  67. package/src/api/templates/queries/get-process-template.server.ts +9 -0
  68. package/src/api/templates/queries/get-process-templates.query.ts +45 -0
  69. package/src/api/templates/queries/get-process-templates.server.ts +9 -0
  70. package/src/api/templates/queries/index.ts +5 -0
  71. package/src/api/templates/queries/template-input-search.query.ts +34 -0
  72. package/src/api/templates/queries/template-input-search.server.ts +35 -0
  73. package/src/api/templates/queries/types.ts +28 -0
  74. package/src/components/breadcrumbs/breadcrumbs.tsx +32 -5
  75. package/src/components/button/outlined-icon-button.tsx +2 -2
  76. package/src/components/core/date-time-popover.tsx +11 -4
  77. package/src/components/core/drawer-buttons.tsx +52 -0
  78. package/src/components/core/edited-typography.tsx +1 -1
  79. package/src/components/core/index.ts +4 -2
  80. package/src/components/core/loading.tsx +1 -1
  81. package/src/components/core/status-tag.tsx +97 -0
  82. package/src/components/core/title-edit.tsx +18 -11
  83. package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
  84. package/src/components/dashboard-list/dashboard-list.tsx +19 -15
  85. package/src/components/data-table/table-header.tsx +5 -7
  86. package/src/components/data-table/table-pagination.tsx +1 -1
  87. package/src/components/data-table/table-row.tsx +1 -1
  88. package/src/components/data-table/table-skeleton.tsx +9 -4
  89. package/src/components/execution/execution-filter.ts +1 -1
  90. package/src/components/execution/execution-status-icon.tsx +7 -7
  91. package/src/components/execution/execution-tag.tsx +12 -77
  92. package/src/components/execution/index.ts +1 -1
  93. package/src/components/execution-history-drawer/execution-history-drawer.tsx +203 -0
  94. package/src/components/execution-history-drawer/executions-card.tsx +85 -0
  95. package/src/components/execution-history-drawer/index.ts +1 -0
  96. package/src/components/footer/footer.tsx +10 -6
  97. package/src/components/header/dashboard-list-header.tsx +12 -7
  98. package/src/components/header/execution-details-header.tsx +35 -26
  99. package/src/components/header/header.tsx +10 -3
  100. package/src/components/header/index.ts +1 -1
  101. package/src/components/header/integration-details-header.tsx +104 -45
  102. package/src/components/integration-list/index.ts +3 -0
  103. package/src/components/integration-list/integration-filter.ts +21 -0
  104. package/src/components/integration-list/integration-status-icon.tsx +32 -0
  105. package/src/components/integration-list/integration-tag.tsx +33 -0
  106. package/src/components/integration-list/list/index.ts +1 -0
  107. package/src/components/integration-list/list/integration-list-row.tsx +161 -0
  108. package/src/components/integration-list/list/integration-list-table.tsx +62 -0
  109. package/src/components/integration-list/list/integration-list.tsx +258 -0
  110. package/src/components/integration-view/animated-svg.tsx +31 -0
  111. package/src/components/integration-view/edges/default-edge.tsx +1 -1
  112. package/src/components/integration-view/elk-layout-options.ts +2 -2
  113. package/src/components/integration-view/elk-types.ts +35 -6
  114. package/src/components/integration-view/flow-types.tsx +10 -0
  115. package/src/components/integration-view/integration-view.tsx +990 -55
  116. package/src/components/integration-view/nodes/empty-node.tsx +65 -0
  117. package/src/components/integration-view/nodes/entry-node.tsx +98 -4
  118. package/src/components/integration-view/nodes/execution-entry-node.tsx +107 -0
  119. package/src/components/integration-view/nodes/execution-task-node.tsx +88 -0
  120. package/src/components/integration-view/nodes/group-node.tsx +19 -13
  121. package/src/components/integration-view/nodes/row-node.tsx +19 -0
  122. package/src/components/integration-view/nodes/task-node.tsx +14 -8
  123. package/src/components/integration-view/task-icon.tsx +193 -0
  124. package/src/components/integration-view/temp-data/initialElements.tsx +36 -32
  125. package/src/components/integration-view/types.ts +2 -2
  126. package/src/components/layouts/main-layout.tsx +2 -3
  127. package/src/components/layouts/root-container.tsx +3 -6
  128. package/src/components/link-cards/link-card.tsx +15 -4
  129. package/src/components/link-cards/styles.ts +1 -1
  130. package/src/components/list-filter/date-filter.tsx +4 -3
  131. package/src/components/list-filter/date-range-filter.tsx +11 -5
  132. package/src/components/list-filter/index.ts +1 -1
  133. package/src/components/list-filter/list-filter.tsx +31 -26
  134. package/src/components/list-filter/multi-select-filter.tsx +11 -10
  135. package/src/components/list-filter/select-filter.tsx +13 -8
  136. package/src/components/scheduler/day-selector.tsx +29 -15
  137. package/src/components/scheduler/day-tag.tsx +14 -51
  138. package/src/components/scheduler/index.ts +2 -1
  139. package/src/components/scheduler/schedule-drawer/details-reducer.ts +217 -0
  140. package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +503 -0
  141. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +136 -99
  142. package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +94 -0
  143. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-skeleton.tsx +1 -2
  144. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details.tsx +9 -13
  145. package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +218 -0
  146. package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +6 -25
  147. package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +116 -0
  148. package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +130 -0
  149. package/src/components/scheduler/schedule-filter.ts +1 -1
  150. package/src/components/scheduler/schedule-icon.tsx +5 -6
  151. package/src/components/scheduler/schedule-integration-icon.tsx +31 -0
  152. package/src/components/templates/index.ts +1 -0
  153. package/src/components/templates/inputs/index.tsx +1351 -0
  154. package/src/components/templates/template-filter.ts +5 -0
  155. package/src/components/templates/templates-list/index.ts +1 -0
  156. package/src/components/templates/templates-list/templates-list-row.tsx +55 -0
  157. package/src/components/templates/templates-list/templates-list-table.tsx +58 -0
  158. package/src/components/templates/templates-list/templates-list.tsx +253 -0
  159. package/src/components/templates/types.tsx +75 -0
  160. package/src/components/templates/wizard.tsx +689 -0
  161. package/src/hooks/use-breadcrumbs.ts +1 -1
  162. package/src/hooks/use-recurrence.tsx +1 -2
  163. package/src/pages/dashboard/dashboard-link-cards.tsx +8 -11
  164. package/src/pages/dashboard/dashboard-list-sections.tsx +7 -9
  165. package/src/pages/dashboard/dashboard.tsx +1 -2
  166. package/src/pages/execution-details/execution-details.tsx +211 -14
  167. package/src/pages/execution-details/task-execution-details.tsx +160 -0
  168. package/src/pages/execution-details/task-execution-drawer.tsx +54 -0
  169. package/src/pages/executions/executions-list/executions-list-row.tsx +21 -27
  170. package/src/pages/executions/executions-list/executions-list-table.tsx +28 -35
  171. package/src/pages/executions/executions-list/executions-list.tsx +24 -18
  172. package/src/pages/executions/executions.tsx +11 -15
  173. package/src/pages/integration-create/index.ts +1 -0
  174. package/src/pages/integration-create/integration-create.tsx +174 -0
  175. package/src/pages/integration-create/pre-creation-step.tsx +12 -0
  176. package/src/pages/integration-create/select-step.tsx +105 -0
  177. package/src/pages/integration-create/template-list-step.tsx +77 -0
  178. package/src/pages/integration-create/wizard-step.tsx +50 -0
  179. package/src/pages/integration-details/import-process/copy-tasks-list.tsx +265 -0
  180. package/src/pages/integration-details/import-process/copy-tasks-row.tsx +77 -0
  181. package/src/pages/integration-details/import-process/import-confirm.tsx +61 -0
  182. package/src/pages/integration-details/import-process/import-drawer.tsx +48 -0
  183. package/src/pages/integration-details/import-process/import-process-reducer.ts +90 -0
  184. package/src/pages/integration-details/import-process/import-process.tsx +149 -0
  185. package/src/pages/integration-details/index.ts +1 -0
  186. package/src/pages/integration-details/integration-details.tsx +221 -0
  187. package/src/pages/integration-details/task-drawer/add-task.tsx +120 -0
  188. package/src/pages/integration-details/task-drawer/edit-task.tsx +175 -0
  189. package/src/pages/integration-details/task-drawer/task-drawer.tsx +139 -0
  190. package/src/pages/integration-details/task-drawer/task-reducer.ts +73 -0
  191. package/src/pages/integrations/integrations.tsx +68 -8
  192. package/src/pages/scheduler/scheduler.tsx +12 -24
  193. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +27 -37
  194. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +27 -42
  195. package/src/pages/scheduler/schedules-list/schedules-list.tsx +48 -21
  196. package/src/utils/date-functions.ts +69 -0
  197. package/src/utils/slugify.ts +3 -0
  198. package/tsconfig.json +12 -4
  199. package/src/hooks/use-timestamp.tsx +0 -25
  200. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +0 -227
  201. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +0 -77
  202. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +0 -72
  203. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +0 -103
  204. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +0 -101
  205. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +0 -93
  206. /package/src/{pages → components}/scheduler/schedule-drawer/edited/edited-types.ts +0 -0
  207. /package/src/{pages → components}/scheduler/schedule-drawer/edited/index.ts +0 -0
  208. /package/src/{pages → components}/scheduler/schedule-drawer/index.ts +0 -0
@@ -0,0 +1,258 @@
1
+ import type {
2
+ GetProcessesQuery,
3
+ ProcessInput,
4
+ } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
5
+ import { FlexBox } from "@evenicanpm/admin-core/components/flex-box";
6
+ import {
7
+ TablePagination,
8
+ TableSkeleton,
9
+ } from "@evenicanpm/admin-integrate/components/data-table";
10
+ import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
11
+ import {
12
+ type IntegrationListFilters,
13
+ integrationListFilters,
14
+ } from "@evenicanpm/admin-integrate/components/integration-list/integration-filter";
15
+ import { ListFilter } from "@evenicanpm/admin-integrate/components/list-filter";
16
+ import type { ListFilterOutput } from "@evenicanpm/admin-integrate/components/list-filter/list-filter-types";
17
+ import {
18
+ Box,
19
+ Card,
20
+ Grid2 as Grid,
21
+ Stack,
22
+ type Theme,
23
+ Typography,
24
+ useTheme,
25
+ } from "@mui/material";
26
+ import { useTranslations } from "next-intl";
27
+ import type React from "react";
28
+ import { useEffect, useState } from "react";
29
+ import IntegrationListTable from "./integration-list-table";
30
+
31
+ // Returned from processExecutions query
32
+ export interface integrationItem {
33
+ isScheduled: 0 | 1;
34
+ isTriggered: 0 | 1;
35
+ id: string;
36
+ name: string;
37
+ modified: string;
38
+ processIcon: string;
39
+ }
40
+
41
+ // Row height in terms of multiples of theme.spacing(1) (e.g. theme.spacing(7.5 & rows per page))
42
+ const rowHeight = 7.5;
43
+
44
+ interface Props {
45
+ heading: Head[];
46
+ data: GetProcessesQuery;
47
+ loading: boolean;
48
+ input: ProcessInput;
49
+ setInput: (newInput: ProcessInput) => void;
50
+ handleRedirect?: (id: string) => void;
51
+ isImportMode?: boolean;
52
+ readOnly?: boolean;
53
+ }
54
+
55
+ const IntegrationList: React.FC<Props> = (props: Props) => {
56
+ const t = useTranslations("Integrate.IntegrationList");
57
+
58
+ const theme = useTheme();
59
+ const styles = getStyles(theme);
60
+
61
+ const [items, setItems] = useState<integrationItem[]>([]);
62
+ const [page, setPage] = useState(
63
+ (props.input.skip ?? 0) / (props.input.top ?? 10) + 1,
64
+ );
65
+ const [perPage, setPerPage] = useState<number>(props.input.top || 10);
66
+
67
+ const handleChangePage = (
68
+ event: React.ChangeEvent<unknown>,
69
+ value: number,
70
+ ) => {
71
+ if (page !== value && event) {
72
+ setPage(value);
73
+ props.setInput({
74
+ ...props.input,
75
+ skip: (props.input.top || 10) * (value - 1),
76
+ });
77
+ }
78
+ };
79
+
80
+ const handleSetFilters = (
81
+ filterUpdate: ListFilterOutput<IntegrationListFilters>,
82
+ ) => {
83
+ const { itemsPerPage, search, filters } = filterUpdate;
84
+
85
+ props.setInput({
86
+ ...props.input,
87
+ top: itemsPerPage,
88
+ skip: 0,
89
+ search: search,
90
+ integrationTags:
91
+ filters?.multiSelectFilter?.map((f) => `${f.id}`) || null,
92
+ });
93
+ setPerPage(itemsPerPage as number);
94
+ setPage(1);
95
+ };
96
+
97
+ const handleClearFilters = () => {
98
+ props.setInput({
99
+ ...props.input,
100
+ skip: 0,
101
+ integrationTags: null,
102
+ });
103
+ };
104
+
105
+ useEffect(() => {
106
+ if (props.data?.processes?.nodes) {
107
+ setItems(props.data.processes.nodes as integrationItem[]);
108
+ }
109
+ }, [props.data]);
110
+
111
+ return (
112
+ <>
113
+ <Box sx={styles.list}>
114
+ <ListFilter<IntegrationListFilters>
115
+ setFilters={handleSetFilters}
116
+ clearFilters={handleClearFilters}
117
+ filters={
118
+ props.heading.find((h) => h.id === "isScheduled")
119
+ ? integrationListFilters
120
+ : ({} as IntegrationListFilters)
121
+ }
122
+ config={{
123
+ pagination: {
124
+ pageDefault: 10,
125
+ pageOptions: [10, 20, 50],
126
+ },
127
+ }}
128
+ />
129
+ </Box>
130
+
131
+ {props.loading && !props.data && (
132
+ <Card>
133
+ <TableSkeleton
134
+ heading={props.heading}
135
+ perPage={perPage}
136
+ rowSx={styles.rowSx}
137
+ />
138
+ </Card>
139
+ )}
140
+
141
+ {!props.loading && props.data.processes && items.length > 0 ? (
142
+ <Box
143
+ sx={{
144
+ minHeight:
145
+ props.data.processes.pageInfo?.resultsReturned &&
146
+ props.data.processes.pageInfo.resultsReturned < perPage &&
147
+ page === 1
148
+ ? theme.spacing(
149
+ rowHeight *
150
+ (props.data.processes.pageInfo.resultsReturned + 1),
151
+ )
152
+ : theme.spacing(rowHeight * (perPage + 1)),
153
+ }}
154
+ >
155
+ <Card>
156
+ <IntegrationListTable
157
+ heading={props.heading}
158
+ items={items}
159
+ input={props.input}
160
+ setInput={props.setInput}
161
+ rowSx={styles.rowSx}
162
+ handleRedirect={props.handleRedirect}
163
+ isImportMode={props.isImportMode}
164
+ readOnly={props.readOnly}
165
+ />
166
+ </Card>
167
+ </Box>
168
+ ) : null}
169
+
170
+ {!props.loading && items.length === 0 ? (
171
+ <Card>
172
+ <FlexBox
173
+ justifyContent="center"
174
+ alignItems="center"
175
+ sx={{
176
+ minHeight: "335px",
177
+ marginBottom: theme.spacing(2),
178
+ }}
179
+ >
180
+ <Stack spacing={1} justifyContent="center" alignItems="center">
181
+ <Typography variant="h6" color="info">
182
+ {t("ListEmpty.title")}
183
+ </Typography>
184
+ <Typography variant="body1">{t("ListEmpty.body")}</Typography>
185
+ </Stack>
186
+ </FlexBox>
187
+ </Card>
188
+ ) : null}
189
+
190
+ {!props.loading && props.data?.processes && items.length > 0 ? (
191
+ <Grid container spacing={1} sx={styles.pagination}>
192
+ <Grid size={{ xs: 10.5 }}>
193
+ <FlexBox
194
+ justifyContent="center"
195
+ alignItems="center"
196
+ sx={styles.paginationBox}
197
+ >
198
+ <TablePagination
199
+ page={page}
200
+ onChange={handleChangePage}
201
+ count={Math.ceil(
202
+ (props.data.processes.recordCount || 10) /
203
+ (props.input.top || 10),
204
+ )}
205
+ />
206
+ </FlexBox>
207
+ </Grid>
208
+ <Grid size={{ xs: 1.5 }}>
209
+ <FlexBox
210
+ justifyContent="flex-end"
211
+ alignItems="center"
212
+ sx={{ height: "100%" }}
213
+ >
214
+ <Typography color="grey">
215
+ {`${props.data.processes.pageInfo?.resultsReturned || 0} ${t("Pagination.of")} ${props.data.processes.recordCount || 0} ${t("Pagination.items")}`}
216
+ </Typography>
217
+ </FlexBox>
218
+ </Grid>
219
+ </Grid>
220
+ ) : null}
221
+ </>
222
+ );
223
+ };
224
+
225
+ const getStyles = (theme: Theme) => {
226
+ return {
227
+ title: {
228
+ display: "flex",
229
+ alignItems: "center",
230
+ height: "100%",
231
+ },
232
+ typography: {
233
+ fontWeight: "medium",
234
+ },
235
+ button: {
236
+ borderWidth: 2,
237
+ borderRadius: 1,
238
+ marginRight: theme.spacing(1),
239
+ },
240
+ iconButton: {
241
+ borderRadius: 1,
242
+ },
243
+ pagination: {
244
+ marginTop: theme.spacing(2),
245
+ },
246
+ list: {
247
+ margin: theme.spacing(2, 0),
248
+ },
249
+ paginationBox: {
250
+ paddingLeft: theme.spacing(15),
251
+ },
252
+ rowSx: {
253
+ height: theme.spacing(rowHeight),
254
+ },
255
+ };
256
+ };
257
+
258
+ export default IntegrationList;
@@ -0,0 +1,31 @@
1
+ import { BaseEdge, type EdgeProps, getSmoothStepPath } from "@xyflow/react";
2
+ import React from "react";
3
+
4
+ export function AnimatedSVGEdge({
5
+ id,
6
+ sourceX,
7
+ sourceY,
8
+ targetX,
9
+ targetY,
10
+ sourcePosition,
11
+ targetPosition,
12
+ markerEnd,
13
+ }: EdgeProps) {
14
+ const [edgePath] = getSmoothStepPath({
15
+ sourceX,
16
+ sourceY,
17
+ sourcePosition,
18
+ targetX,
19
+ targetY,
20
+ targetPosition,
21
+ });
22
+
23
+ return (
24
+ <>
25
+ <BaseEdge id={id} path={edgePath} markerEnd={markerEnd} />
26
+ <circle r="5" fill="#4E97FD">
27
+ <animateMotion dur="2s" repeatCount="indefinite" path={edgePath} />
28
+ </circle>
29
+ </>
30
+ );
31
+ }
@@ -1,4 +1,4 @@
1
- import { BaseEdge, EdgeProps, getSmoothStepPath } from "@xyflow/react";
1
+ import { BaseEdge, type EdgeProps, getSmoothStepPath } from "@xyflow/react";
2
2
 
3
3
  export function DefaultEdge({
4
4
  id,
@@ -1,4 +1,4 @@
1
- import { LayoutOptions } from "elkjs";
1
+ import type { LayoutOptions } from "elkjs";
2
2
 
3
3
  export const layoutOptions: LayoutOptions = {
4
4
  "elk.algorithm": "layered",
@@ -8,7 +8,7 @@ export const layoutOptions: LayoutOptions = {
8
8
  "org.eclipse.elk.hierarchyHandling": "INCLUDE_CHILDREN",
9
9
 
10
10
  // Center parent nodes among their children, children immediately below
11
- "org.eclipse.elk.layered.contentAlignment": "H_CENTER,V_TOP",
11
+ //"org.eclipse.elk.layered.contentAlignment": "H_CENTER,V_TOP",
12
12
 
13
13
  // Reduce edge crossings
14
14
  "org.eclipse.elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
@@ -1,18 +1,47 @@
1
- import { ElkExtendedEdge, ElkNode } from "elkjs";
1
+ import type { ElkExtendedEdge, ElkNode } from "elkjs";
2
+ import type {
3
+ ProcessTask,
4
+ ProcessTaskExecution,
5
+ } from "../../../../admin-core/src/api/e4/graphqlRequestSdk";
2
6
 
3
7
  export interface ElkNodeWithFlow extends ElkNode {
4
8
  type?: string;
5
- data?: {
6
- label: string;
7
- icon?: any;
8
- isLast?: boolean;
9
- };
9
+ data?: any;
10
10
  position?: {
11
11
  x: number;
12
12
  y: number;
13
13
  };
14
14
  children?: ElkNodeWithFlow[];
15
15
  extent?: string;
16
+ parentId?: string;
17
+ sort?: number;
18
+ }
19
+
20
+ export interface GroupNode extends ElkNodeWithFlow {
21
+ data: {
22
+ label: string;
23
+ parallelProcessesingGroup?: number;
24
+ isLast?: boolean;
25
+ disabled?: boolean;
26
+ selected?: boolean;
27
+ };
28
+ }
29
+
30
+ export interface ProcessTaskNode extends ElkNodeWithFlow {
31
+ data: {
32
+ processTask: ProcessTask;
33
+ isLast?: boolean;
34
+ disabled?: boolean;
35
+ selected?: boolean;
36
+ };
37
+ }
38
+
39
+ export interface ProcessTaskExecutionNode extends ElkNodeWithFlow {
40
+ data: {
41
+ processTaskExecution: ProcessTaskExecution;
42
+ isLast?: boolean;
43
+ disabled?: boolean;
44
+ };
16
45
  }
17
46
 
18
47
  export interface ElkExtendedEdgeWithFlow extends ElkExtendedEdge {
@@ -1,16 +1,26 @@
1
+ import { AnimatedSVGEdge } from "./animated-svg";
1
2
  import { DefaultEdge } from "./edges/default-edge";
2
3
  import { ConnectionNode } from "./nodes/connection-node";
4
+ import { EmptyNode } from "./nodes/empty-node";
3
5
  import { EntryNode } from "./nodes/entry-node";
6
+ import { ExecutionEntryNode } from "./nodes/execution-entry-node";
7
+ import { ExecutionTaskNode } from "./nodes/execution-task-node";
4
8
  import { GroupNode } from "./nodes/group-node";
9
+ import { RowNode } from "./nodes/row-node";
5
10
  import { TaskNode } from "./nodes/task-node";
6
11
 
7
12
  export const edgeTypes = {
8
13
  "default-edge": DefaultEdge,
14
+ "animated-edge": AnimatedSVGEdge,
9
15
  };
10
16
 
11
17
  export const nodeTypes = {
12
18
  "connection-node": ConnectionNode,
13
19
  "entry-node": EntryNode,
20
+ "execution-entry-node": ExecutionEntryNode,
14
21
  "group-node": GroupNode,
15
22
  "task-node": TaskNode, // Assuming you have a custom connection node
23
+ "execution-task-node": ExecutionTaskNode, // Assuming you have a custom connection node,
24
+ "row-node": RowNode,
25
+ "empty-node": EmptyNode,
16
26
  };