@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,65 @@
1
+ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
+ import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
3
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
4
+ import { useTranslations } from "next-intl";
5
+
6
+ export function EmptyNode(props: NodeProps): JSX.Element {
7
+ const t = useTranslations("Integrate.IntegrationDetails.View.EmptyNode");
8
+ return (
9
+ <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
10
+ <Card
11
+ sx={{
12
+ borderWidth: 1,
13
+ borderStyle: "dashed",
14
+ borderColor: "grey.700",
15
+ backgroundColor: "transparent",
16
+ width: props.width,
17
+ "&:hover": {
18
+ borderColor: props?.data?.disabled ? "grey.700" : "#4E97FD", //Blue not implemented in the theme
19
+ backgroundColor: props?.data?.disabled ? "#fff" : "#DBF0FE",
20
+ },
21
+ }}
22
+ >
23
+ <CardHeader
24
+ title={
25
+ <Typography
26
+ variant="h5"
27
+ sx={{ textAlign: "center", width: "100%" }}
28
+ >
29
+ {props?.data?.label as string}
30
+ </Typography>
31
+ }
32
+ sx={{
33
+ height: 62,
34
+ display: "flex",
35
+ }}
36
+ />
37
+ <CardContent
38
+ sx={{
39
+ height: props.height,
40
+ // width: (props.width || 0) + 48,
41
+ display: "flex",
42
+ justifyContent: "center",
43
+ alignItems: "center",
44
+ width: "100%",
45
+ flexDirection: "column",
46
+ }}
47
+ >
48
+ <Typography variant="body2" color="grey.600" pb={3}>
49
+ {t("firstIntegration")}
50
+ </Typography>
51
+ <AddCircleOutlineIcon
52
+ sx={{
53
+ color: "grey.600",
54
+ "&:hover": {
55
+ color: "#4E97FD", //Blue not implemented in the theme
56
+ },
57
+ marginLeft: "-16px",
58
+ }}
59
+ />
60
+ </CardContent>
61
+ <Handle type="target" position={Position.Top} />
62
+ </Card>
63
+ </Box>
64
+ );
65
+ }
@@ -1,10 +1,104 @@
1
- import { Handle, Position } from "@xyflow/react";
1
+ import {
2
+ Box,
3
+ Card,
4
+ CardContent,
5
+ Divider,
6
+ type Theme,
7
+ Typography,
8
+ useTheme,
9
+ } from "@mui/material";
10
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
11
+ import { useTranslations } from "next-intl";
12
+ import { inputIcon, timerIcon, triggerIcon } from "../task-icon";
13
+
14
+ export function EntryNode(props: NodeProps): JSX.Element {
15
+ const t = useTranslations("Integrate.IntegrationDetails.View.EntryNode");
16
+
17
+ const theme = useTheme();
18
+ const styles = getStyles(theme, props);
2
19
 
3
- export function EntryNode(): JSX.Element {
4
20
  return (
5
- <div>
21
+ <Box
22
+ sx={{
23
+ display: "flex",
24
+ justifyContent: "center",
25
+ alignItems: "center",
26
+ //width: props.width + 24 + theme.spacing(1),
27
+ }}
28
+ >
29
+ <Card
30
+ sx={{
31
+ borderWidth: 1,
32
+ borderStyle:
33
+ props?.data?.isScheduled || props?.data?.isTriggered
34
+ ? "solid"
35
+ : "dashed",
36
+ backgroundColor:
37
+ props?.data?.isScheduled || props?.data?.isTriggered
38
+ ? theme.palette.background.paper
39
+ : "transparent",
40
+ "&:hover": {
41
+ borderColor: "#4E97FD", //Blue not implemented in the theme
42
+ backgroundColor: "#DBF0FE",
43
+ },
44
+ //height: props.height,
45
+ //width: props.width,
46
+ }}
47
+ >
48
+ {!(props?.data?.isScheduled as boolean) &&
49
+ !(props?.data?.isTriggered as boolean) && (
50
+ <CardContent sx={styles.cardContent}>
51
+ {inputIcon()}
52
+ <Typography variant="h6" sx={styles.label}>
53
+ {t("noEntryPoint")}
54
+ </Typography>
55
+ </CardContent>
56
+ )}
57
+ {(props?.data?.isScheduled as boolean) && (
58
+ <CardContent sx={styles.cardContent}>
59
+ {timerIcon()}
60
+ <Typography variant="h6" sx={styles.label}>
61
+ {t("scheduled")}
62
+ </Typography>
63
+ </CardContent>
64
+ )}
65
+ {(props?.data?.isScheduled as boolean) &&
66
+ (props?.data?.isTriggered as boolean) ? (
67
+ <Divider sx={styles.divider} />
68
+ ) : null}
69
+ {(props?.data?.isTriggered as boolean) && (
70
+ <CardContent sx={styles.cardContent}>
71
+ {triggerIcon()}
72
+ <Typography variant="h6" sx={styles.label}>
73
+ {t("triggered")}
74
+ </Typography>
75
+ </CardContent>
76
+ )}
77
+ </Card>
6
78
  <Handle type="source" position={Position.Bottom} />
7
79
  <Handle type="target" position={Position.Top} />
8
- </div>
80
+ </Box>
9
81
  );
10
82
  }
83
+
84
+ const getStyles = (theme: Theme, props: NodeProps) => {
85
+ return {
86
+ cardContent: {
87
+ height: props.height,
88
+ width: props.width,
89
+ display: "flex",
90
+ justifyContent: "center",
91
+ alignItems: "center",
92
+ },
93
+ label: {
94
+ textAlign: "center",
95
+ paddingLeft: theme.spacing(1),
96
+ fontSize: "18px!important",
97
+ },
98
+ divider: {
99
+ width: "80%",
100
+ margin: `${theme.spacing(1)} auto`,
101
+ borderColor: "grey.800",
102
+ },
103
+ };
104
+ };
@@ -0,0 +1,107 @@
1
+ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
+ import {
3
+ Box,
4
+ Card,
5
+ CardContent,
6
+ Divider,
7
+ type Theme,
8
+ Typography,
9
+ useTheme,
10
+ } from "@mui/material";
11
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
12
+
13
+ export function ExecutionEntryNode(props: NodeProps): JSX.Element {
14
+ const theme = useTheme();
15
+ const styles = getStyles(theme, props);
16
+
17
+ const borderColor = () => {
18
+ switch (props?.data?.executionStatus) {
19
+ case "300":
20
+ return "info.600";
21
+ case "400":
22
+ return "success.600";
23
+ case "450":
24
+ return "warning.600";
25
+ case "500":
26
+ return "error.600";
27
+ default:
28
+ return "grey.600";
29
+ }
30
+ };
31
+
32
+ return (
33
+ <Box
34
+ sx={{
35
+ display: "flex",
36
+ justifyContent: "center",
37
+ alignItems: "center",
38
+ //width: props.width + 24 + theme.spacing(1),
39
+ }}
40
+ >
41
+ <Card
42
+ sx={{
43
+ borderWidth: 1,
44
+ borderStyle: "solid",
45
+ borderColor: borderColor(),
46
+ "&:hover": {
47
+ borderColor: "#4E97FD", //Blue not implemented in the theme
48
+ backgroundColor: "#DBF0FE",
49
+ },
50
+ }}
51
+ >
52
+ <CardContent sx={styles.cardContent}>
53
+ {props?.data?.icon as any}
54
+ <Typography variant="h6" sx={styles.label}>
55
+ {props?.data?.label as string}
56
+ </Typography>
57
+ </CardContent>
58
+ <Handle type="source" position={Position.Bottom} />
59
+ <Handle type="target" position={Position.Top} />
60
+ {props?.data?.icon2 ? (
61
+ <>
62
+ <Divider sx={styles.divider} />
63
+ <CardContent sx={styles.cardContent}>
64
+ {props?.data?.icon2 as any}
65
+ <Typography variant="h6" sx={styles.label}>
66
+ {props?.data?.label2 as string}
67
+ </Typography>
68
+ </CardContent>
69
+ </>
70
+ ) : null}
71
+ </Card>
72
+ {props?.data?.isLast ? (
73
+ <AddCircleOutlineIcon
74
+ sx={{
75
+ color: "grey.600",
76
+ marginLeft: theme.spacing(1),
77
+ "&:hover": {
78
+ color: "#4E97FD", //Blue not implemented in the theme
79
+ },
80
+ }}
81
+ />
82
+ ) : null}
83
+ </Box>
84
+ );
85
+ }
86
+
87
+ const getStyles = (theme: Theme, props: NodeProps) => {
88
+ return {
89
+ cardContent: {
90
+ height: props.height,
91
+ width: props.width,
92
+ display: "flex",
93
+ justifyContent: "center",
94
+ alignItems: "center",
95
+ },
96
+ label: {
97
+ textAlign: "center",
98
+ paddingLeft: theme.spacing(1),
99
+ fontSize: "18px!important",
100
+ },
101
+ divider: {
102
+ width: "80%",
103
+ margin: `${theme.spacing(1)} auto`,
104
+ borderColor: "grey.800",
105
+ },
106
+ };
107
+ };
@@ -0,0 +1,88 @@
1
+ import type { ProcessTaskExecution } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
2
+ import { ExecutionTag } from "@evenicanpm/admin-integrate/components/execution";
3
+ import { Box, Card, CardContent, Typography, useTheme } from "@mui/material";
4
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
5
+ import { mapIconByOrchestrationType } from "../task-icon";
6
+
7
+ export function ExecutionTaskNode(props: NodeProps): JSX.Element {
8
+ const theme = useTheme();
9
+
10
+ const borderColor = () => {
11
+ switch (
12
+ (props?.data?.processTaskExecution as ProcessTaskExecution)
13
+ ?.executionStatus?.id
14
+ ) {
15
+ case "300":
16
+ return "info.600";
17
+ case "400":
18
+ return "success.600";
19
+ case "450":
20
+ return "warning.600";
21
+ case "500":
22
+ return "error.600";
23
+ default:
24
+ return "grey.600";
25
+ }
26
+ };
27
+
28
+ return (
29
+ <Box
30
+ sx={{
31
+ display: "flex",
32
+ justifyContent: "center",
33
+ alignItems: "center",
34
+ opacity: !props?.data?.disabled || props?.data?.selected ? 1 : 0.5,
35
+ }}
36
+ >
37
+ <Card
38
+ sx={{
39
+ borderWidth: 1,
40
+ borderStyle: "solid",
41
+ borderColor: borderColor(),
42
+ "&:hover": {
43
+ borderColor: props?.data?.disabled ? "grey.700" : "#4E97FD", //Blue not implemented in the theme
44
+ backgroundColor: props?.data?.disabled ? "#fff" : "#DBF0FE",
45
+ },
46
+ }}
47
+ >
48
+ <CardContent
49
+ sx={{
50
+ height: props.height,
51
+ width: props.width,
52
+ display: "flex",
53
+ justifyContent: "center",
54
+ alignItems: "center",
55
+ }}
56
+ >
57
+ {mapIconByOrchestrationType(
58
+ (props?.data?.processTask as ProcessTaskExecution)
59
+ ?.orchestrationType?.code as string,
60
+ )}
61
+ <Typography
62
+ variant="h6"
63
+ sx={{
64
+ textAlign: "center",
65
+ fontSize: "18px!important",
66
+ paddingLeft: theme.spacing(0.7),
67
+ marginRight: theme.spacing(1),
68
+ }}
69
+ >
70
+ {
71
+ (props?.data?.processTaskExecution as ProcessTaskExecution)
72
+ ?.name as string
73
+ }
74
+ </Typography>
75
+ <ExecutionTag
76
+ executionStatusId={
77
+ (props?.data?.processTaskExecution as ProcessTaskExecution)
78
+ ?.executionStatus?.id as string
79
+ }
80
+ sx={{ marginRight: props?.data?.isLast ? theme.spacing(4) : 0 }}
81
+ />
82
+ </CardContent>
83
+ <Handle type="target" position={Position.Top} />
84
+ <Handle type="source" position={Position.Bottom} />
85
+ </Card>
86
+ </Box>
87
+ );
88
+ }
@@ -1,10 +1,10 @@
1
- import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
2
- import { Handle, NodeProps, Position } from "@xyflow/react";
3
1
  import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
+ import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
3
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
4
4
 
5
5
  export function GroupNode(props: NodeProps): JSX.Element {
6
6
  return (
7
- <Box>
7
+ <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
8
8
  <Card
9
9
  sx={{
10
10
  borderWidth: 1,
@@ -15,13 +15,17 @@ export function GroupNode(props: NodeProps): JSX.Element {
15
15
  >
16
16
  <CardHeader
17
17
  title={
18
- <Typography variant="h5" sx={{ textAlign: "center" }}>
18
+ <Typography
19
+ variant="h5"
20
+ sx={{ textAlign: "center", width: "100%" }}
21
+ >
19
22
  {props?.data?.label as string}
20
23
  </Typography>
21
24
  }
22
25
  sx={{
23
26
  height: 62,
24
27
  paddingRight: "48px",
28
+ display: "flex",
25
29
  }}
26
30
  />
27
31
  <CardContent
@@ -34,15 +38,31 @@ export function GroupNode(props: NodeProps): JSX.Element {
34
38
  paddingRight: "48px",
35
39
  }}
36
40
  >
37
- <AddCircleOutlineIcon
38
- sx={{
39
- color: "grey.600",
40
- "&:hover": {
41
- color: "#4E97FD", //Blue not implemented in the theme
42
- },
43
- marginLeft: "-16px",
44
- }}
45
- />
41
+ {props.data.variant === "process" && !!props?.data?.canEdit ? (
42
+ <AddCircleOutlineIcon
43
+ sx={{
44
+ color: "grey.600",
45
+ "&:hover": {
46
+ color: "#4E97FD", //Blue not implemented in the theme
47
+ },
48
+ marginLeft: "-16px",
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
+ }}
64
+ />
65
+ ) : null}
46
66
  </CardContent>
47
67
  <Handle type="target" position={Position.Top} />
48
68
  </Card>
@@ -0,0 +1,19 @@
1
+ import { Box } from "@mui/material";
2
+ import type { NodeProps } from "@xyflow/react";
3
+
4
+ export function RowNode(props: NodeProps): JSX.Element {
5
+ return (
6
+ // <Box sx={{ opacity: props.data.disabled ? 0.5 : 1 }}>
7
+ <Box>
8
+ <Box
9
+ sx={{
10
+ borderWidth: 1,
11
+ borderStyle: "solid",
12
+ borderColor: "grey.700",
13
+ width: props.width,
14
+ height: props.height,
15
+ }}
16
+ ></Box>
17
+ </Box>
18
+ );
19
+ }
@@ -1,7 +1,15 @@
1
- import { Box, Card, CardContent, Typography, useTheme } from "@mui/material";
2
- import { Handle, NodeProps, Position } from "@xyflow/react";
3
-
4
1
  import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
+ import {
3
+ Box,
4
+ Card,
5
+ CardContent,
6
+ Typography,
7
+ IconButton,
8
+ useTheme,
9
+ } from "@mui/material";
10
+ import { Handle, type NodeProps, Position } from "@xyflow/react";
11
+ import type { ProcessTask } from "../../../../../admin-core/src/api/e4/graphqlRequestSdk";
12
+ import { mapIconByOrchestrationType } from "../task-icon";
5
13
 
6
14
  export function TaskNode(props: NodeProps): JSX.Element {
7
15
  const theme = useTheme();
@@ -12,6 +20,7 @@ export function TaskNode(props: NodeProps): JSX.Element {
12
20
  display: "flex",
13
21
  justifyContent: "center",
14
22
  alignItems: "center",
23
+ opacity: !props?.data?.disabled || props?.data?.selected ? 1 : 0.5,
15
24
  //width: props.width + 24 + theme.spacing(1),
16
25
  }}
17
26
  >
@@ -21,9 +30,12 @@ export function TaskNode(props: NodeProps): JSX.Element {
21
30
  borderStyle: "solid",
22
31
  borderColor: "grey.700",
23
32
  "&:hover": {
24
- borderColor: "#4E97FD", //Blue not implemented in the theme
25
- backgroundColor: "#DBF0FE",
33
+ borderColor: props?.data?.disabled ? "grey.700" : "#4E97FD", //Blue not implemented in the theme
34
+ backgroundColor: props?.data?.disabled ? "#fff" : "#DBF0FE",
26
35
  },
36
+ display: "flex",
37
+ alignItems: "center",
38
+ justifyContent: "center",
27
39
  }}
28
40
  >
29
41
  <CardContent
@@ -35,27 +47,49 @@ export function TaskNode(props: NodeProps): JSX.Element {
35
47
  alignItems: "center",
36
48
  }}
37
49
  >
38
- {props?.data?.icon as any}
50
+ {mapIconByOrchestrationType(
51
+ (props?.data?.processTask as ProcessTask)?.orchestrationType
52
+ ?.code as string,
53
+ )}
39
54
  <Typography
40
55
  variant="h6"
41
56
  sx={{ textAlign: "center", paddingLeft: theme.spacing(1) }}
42
57
  >
43
- {props?.data?.label as string}
58
+ {(props?.data?.processTask as ProcessTask)?.name as string}
44
59
  </Typography>
45
60
  </CardContent>
46
61
  <Handle type="target" position={Position.Top} />
47
62
  <Handle type="source" position={Position.Bottom} />
48
63
  </Card>
49
- {props?.data?.isLast ? (
50
- <AddCircleOutlineIcon
51
- sx={{
52
- color: "grey.600",
53
- marginLeft: theme.spacing(1),
54
- "&:hover": {
55
- color: "#4E97FD", //Blue not implemented in the theme
56
- },
64
+ {props?.data.isLast ? (
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
+ );
57
81
  }}
58
- />
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>
59
93
  ) : null}
60
94
  </Box>
61
95
  );