@evenicanpm/admin-integrate 1.1.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/documents/Process/fragments.ts +13 -0
  2. package/documents/Process/list.ts +27 -0
  3. package/documents/ProcessSchedule/fragments.ts +24 -0
  4. package/documents/ProcessSchedule/read.ts +12 -0
  5. package/documents/ProcessScheduleGroup/fragments.ts +29 -0
  6. package/documents/ProcessScheduleGroup/read.ts +12 -0
  7. package/documents/ScheduledProcess/fragments.ts +24 -0
  8. package/documents/ScheduledProcess/list.ts +27 -0
  9. package/package.json +21 -17
  10. package/src/api/Integrations/queries/get-process.query.ts +48 -0
  11. package/src/api/Integrations/queries/get-process.server.ts +9 -0
  12. package/src/api/Integrations/queries/index.ts +1 -0
  13. package/src/api/dashboard/queries/get-process-executions.query.ts +33 -36
  14. package/src/api/dashboard/queries/get-process-executions.server.ts +4 -4
  15. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +45 -0
  16. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +14 -0
  17. package/src/api/scheduler/queries/get-process-schedule.query.ts +45 -0
  18. package/src/api/scheduler/queries/get-process-schedule.server.ts +14 -0
  19. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +45 -0
  20. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +11 -0
  21. package/src/api/scheduler/queries/index.ts +3 -0
  22. package/src/components/breadcrumbs/breadcrumbs.tsx +23 -26
  23. package/src/components/breadcrumbs/index.ts +1 -1
  24. package/src/components/breadcrumbs/types.tsx +4 -0
  25. package/src/components/button/outlined-icon-button.tsx +26 -38
  26. package/src/components/core/date-time-popover.tsx +32 -0
  27. package/src/components/core/edited-typography.tsx +20 -0
  28. package/src/components/core/index.ts +3 -0
  29. package/src/components/core/loading.tsx +6 -6
  30. package/src/components/core/title-edit.tsx +122 -0
  31. package/src/components/dashboard-list/dashboard-list-row.tsx +114 -115
  32. package/src/components/dashboard-list/dashboard-list.tsx +119 -119
  33. package/src/components/data-table/table-header.tsx +85 -81
  34. package/src/components/data-table/table-pagination.tsx +27 -27
  35. package/src/components/data-table/table-row.tsx +14 -14
  36. package/src/components/data-table/table-skeleton.tsx +34 -34
  37. package/src/components/execution/execution-filter.ts +22 -22
  38. package/src/components/execution/execution-status-icon.tsx +16 -17
  39. package/src/components/execution/execution-tag.tsx +81 -80
  40. package/src/components/footer/footer.tsx +34 -34
  41. package/src/components/header/dashboard-list-header.tsx +64 -63
  42. package/src/components/header/execution-details-header.tsx +102 -129
  43. package/src/components/header/header.tsx +27 -27
  44. package/src/components/header/index.ts +1 -0
  45. package/src/components/header/integration-details-header.tsx +99 -0
  46. package/src/components/icons/up-down.tsx +15 -15
  47. package/src/components/integration-list/index.ts +2 -0
  48. package/src/components/integration-list/integration-filter.ts +21 -0
  49. package/src/components/integration-list/integration-status-icon.tsx +33 -0
  50. package/src/components/integration-list/integration-tag.tsx +77 -0
  51. package/src/components/integration-view/edges/default-edge.tsx +18 -17
  52. package/src/components/integration-view/elk-layout-options.ts +26 -26
  53. package/src/components/integration-view/elk-types.ts +16 -12
  54. package/src/components/integration-view/flow-types.tsx +5 -5
  55. package/src/components/integration-view/integration-view.tsx +132 -130
  56. package/src/components/integration-view/nodes/base-node.tsx +50 -0
  57. package/src/components/integration-view/nodes/connection-node.tsx +8 -8
  58. package/src/components/integration-view/nodes/entry-node.tsx +8 -8
  59. package/src/components/integration-view/nodes/group-node.tsx +47 -6
  60. package/src/components/integration-view/nodes/task-node.tsx +58 -13
  61. package/src/components/integration-view/temp-data/initialElements.tsx +224 -0
  62. package/src/components/integration-view/types.ts +6 -6
  63. package/src/components/layouts/main-layout.tsx +13 -13
  64. package/src/components/layouts/root-container.tsx +25 -25
  65. package/src/components/link-cards/link-card.tsx +23 -23
  66. package/src/components/link-cards/styles.ts +15 -15
  67. package/src/components/list-filter/date-filter.tsx +41 -45
  68. package/src/components/list-filter/date-range-filter.tsx +78 -77
  69. package/src/components/list-filter/list-filter-types.ts +38 -38
  70. package/src/components/list-filter/list-filter.tsx +363 -354
  71. package/src/components/list-filter/multi-select-filter.tsx +94 -95
  72. package/src/components/list-filter/select-filter.tsx +67 -64
  73. package/src/components/scheduler/day-selector.tsx +174 -0
  74. package/src/components/scheduler/day-tag.tsx +73 -0
  75. package/src/components/scheduler/index.ts +4 -0
  76. package/src/components/scheduler/schedule-filter.ts +25 -0
  77. package/src/components/scheduler/schedule-icon.tsx +87 -0
  78. package/src/components/scheduler/scheduler-types.ts +40 -0
  79. package/src/hooks/use-breadcrumbs.ts +31 -31
  80. package/src/hooks/use-recurrence.tsx +13 -0
  81. package/src/hooks/use-timestamp.tsx +21 -21
  82. package/src/pages/dashboard/dashboard-link-cards.tsx +99 -99
  83. package/src/pages/dashboard/dashboard-list-sections.tsx +130 -125
  84. package/src/pages/dashboard/dashboard.tsx +6 -6
  85. package/src/pages/execution-details/execution-details.tsx +23 -29
  86. package/src/pages/executions/executions-list/executions-list-row.tsx +101 -104
  87. package/src/pages/executions/executions-list/executions-list-table.tsx +45 -53
  88. package/src/pages/executions/executions-list/executions-list.tsx +219 -212
  89. package/src/pages/executions/executions.tsx +67 -72
  90. package/src/pages/integrations/integration-list/index.ts +1 -0
  91. package/src/pages/integrations/integration-list/integration-list-row.tsx +147 -0
  92. package/src/pages/integrations/integration-list/integration-list-table.tsx +78 -0
  93. package/src/pages/integrations/integration-list/integration-list.tsx +262 -0
  94. package/src/pages/integrations/integrations.tsx +83 -28
  95. package/src/pages/scheduler/schedule-drawer/edited/edited-types.ts +17 -0
  96. package/src/pages/scheduler/schedule-drawer/edited/index.ts +1 -0
  97. package/src/pages/scheduler/schedule-drawer/index.ts +1 -0
  98. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +227 -0
  99. package/src/pages/scheduler/schedule-drawer/schedule-details-main.tsx +292 -0
  100. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +77 -0
  101. package/src/pages/scheduler/schedule-drawer/schedule-details-skeleton.tsx +64 -0
  102. package/src/pages/scheduler/schedule-drawer/schedule-details.tsx +42 -0
  103. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +72 -0
  104. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +103 -0
  105. package/src/pages/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +94 -0
  106. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +101 -0
  107. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +93 -0
  108. package/src/pages/scheduler/scheduler.tsx +106 -30
  109. package/src/pages/scheduler/schedules-list/index.ts +1 -0
  110. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +235 -0
  111. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +74 -0
  112. package/src/pages/scheduler/schedules-list/schedules-list.tsx +280 -0
  113. package/tsconfig.json +29 -26
  114. package/src/components/integration-view/temp-data/initialElements.ts +0 -238
@@ -1,39 +1,39 @@
1
1
  import { LayoutOptions } from "elkjs";
2
2
 
3
3
  export const layoutOptions: LayoutOptions = {
4
- "elk.algorithm": "layered",
5
- "elk.direction": "DOWN",
4
+ "elk.algorithm": "layered",
5
+ "elk.direction": "DOWN",
6
6
 
7
- // Arrange parent and child nodes in clear layers
8
- "org.eclipse.elk.hierarchyHandling": "INCLUDE_CHILDREN",
7
+ // Arrange parent and child nodes in clear layers
8
+ "org.eclipse.elk.hierarchyHandling": "INCLUDE_CHILDREN",
9
9
 
10
- // Center parent nodes among their children, children immediately below
11
- "org.eclipse.elk.layered.contentAlignment": "H_CENTER,V_TOP",
10
+ // Center parent nodes among their children, children immediately below
11
+ "org.eclipse.elk.layered.contentAlignment": "H_CENTER,V_TOP",
12
12
 
13
- // Reduce edge crossings
14
- "org.eclipse.elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
13
+ // Reduce edge crossings
14
+ "org.eclipse.elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
15
15
 
16
- // Minimize bends and keep edges as short as possible
17
- "org.eclipse.elk.layered.nodePlacement.edgeRouting": "ORTHOGONAL",
18
- "org.eclipse.elk.layered.nodePlacement.edgeAvoidance": "true",
19
- "org.eclipse.elk.layered.nodePlacement.edgeNodeOverlapAvoided": "true",
20
- "org.eclipse.elk.layered.nodePlacement.edgeStraightening": "true",
16
+ // Minimize bends and keep edges as short as possible
17
+ "org.eclipse.elk.layered.nodePlacement.edgeRouting": "ORTHOGONAL",
18
+ "org.eclipse.elk.layered.nodePlacement.edgeAvoidance": "true",
19
+ "org.eclipse.elk.layered.nodePlacement.edgeNodeOverlapAvoided": "true",
20
+ "org.eclipse.elk.layered.nodePlacement.edgeStraightening": "true",
21
21
 
22
- // Layout spacing options
23
- "org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers": "75",
24
- "org.eclipse.elk.spacing.nodeNode": "80",
25
- "org.eclipse.elk.spacing.portPort": "10",
22
+ // Layout spacing options
23
+ "org.eclipse.elk.layered.spacing.nodeNodeBetweenLayers": "75",
24
+ "org.eclipse.elk.spacing.nodeNode": "80",
25
+ "org.eclipse.elk.spacing.portPort": "10",
26
26
 
27
- // Add spacing between edges that do not share a connection point
28
- "org.eclipse.elk.spacing.edgeEdge": "30",
27
+ // Add spacing between edges that do not share a connection point
28
+ "org.eclipse.elk.spacing.edgeEdge": "30",
29
29
 
30
- // Node placement strategy for centered alignment
31
- "org.eclipse.elk.layered.nodePlacement.strategy": "SIMPLE",
30
+ // Node placement strategy for centered alignment
31
+ "org.eclipse.elk.layered.nodePlacement.strategy": "SIMPLE",
32
32
 
33
- // Layering strategy to optimize horizontal alignment
34
- "org.eclipse.elk.layered.layering.strategy": "NETWORK_SIMPLEX",
33
+ // Layering strategy to optimize horizontal alignment
34
+ "org.eclipse.elk.layered.layering.strategy": "NETWORK_SIMPLEX",
35
35
 
36
- // Merge edges to have them originate from the same point
37
- "org.eclipse.elk.layered.mergeEdges": "true",
38
- "org.eclipse.elk.layered.considerModelOrder.strategy": "PREFER_NODES",
36
+ // Merge edges to have them originate from the same point
37
+ "org.eclipse.elk.layered.mergeEdges": "true",
38
+ "org.eclipse.elk.layered.considerModelOrder.strategy": "PREFER_NODES",
39
39
  };
@@ -1,19 +1,23 @@
1
1
  import { ElkExtendedEdge, ElkNode } from "elkjs";
2
- import { extend } from "lodash";
3
2
 
4
3
  export interface ElkNodeWithFlow extends ElkNode {
5
- type?: string;
6
- data?: {
7
- label: string;
8
- };
9
- position?: {
10
- x: number;
11
- y: number;
12
- };
13
- children?: ElkNodeWithFlow[];
14
- extent?: string;
4
+ type?: string;
5
+ data?: {
6
+ label: string;
7
+ icon?: any;
8
+ isLast?: boolean;
9
+ };
10
+ position?: {
11
+ x: number;
12
+ y: number;
13
+ };
14
+ children?: ElkNodeWithFlow[];
15
+ extent?: string;
15
16
  }
16
17
 
17
18
  export interface ElkExtendedEdgeWithFlow extends ElkExtendedEdge {
18
- type?: string;
19
+ type?: string;
20
+ target?: string;
21
+ source?: string;
22
+ markerEnd?: { type: string };
19
23
  }
@@ -5,12 +5,12 @@ import { GroupNode } from "./nodes/group-node";
5
5
  import { TaskNode } from "./nodes/task-node";
6
6
 
7
7
  export const edgeTypes = {
8
- "default-edge": DefaultEdge,
8
+ "default-edge": DefaultEdge,
9
9
  };
10
10
 
11
11
  export const nodeTypes = {
12
- "connection-node": ConnectionNode,
13
- "entry-node": EntryNode,
14
- "group-node": GroupNode,
15
- "task-node": TaskNode, // Assuming you have a custom connection node
12
+ "connection-node": ConnectionNode,
13
+ "entry-node": EntryNode,
14
+ "group-node": GroupNode,
15
+ "task-node": TaskNode, // Assuming you have a custom connection node
16
16
  };
@@ -1,20 +1,20 @@
1
1
  "use client";
2
2
 
3
3
  import React, { useCallback, useLayoutEffect } from "react";
4
- import { Box, Typography, AppBar, Toolbar, Stack } from "@mui/material";
5
- import { Theme, useTheme } from "@mui/material";
4
+ import { Box } from "@mui/material";
6
5
 
7
6
  import ELK from "elkjs/lib/elk.bundled.js";
8
7
 
9
8
  import "@xyflow/react/dist/style.css";
10
9
 
11
10
  import {
12
- Background,
13
- ReactFlow,
14
- ReactFlowProvider,
15
- useEdgesState,
16
- useNodesState,
17
- useReactFlow,
11
+ Background,
12
+ Controls,
13
+ ReactFlow,
14
+ ReactFlowProvider,
15
+ useEdgesState,
16
+ useNodesState,
17
+ useReactFlow,
18
18
  } from "@xyflow/react";
19
19
 
20
20
  import { nodeTypes, edgeTypes } from "./flow-types";
@@ -22,138 +22,140 @@ import { nodeTypes, edgeTypes } from "./flow-types";
22
22
  import { layoutOptions as elkOptions } from "./elk-layout-options";
23
23
 
24
24
  import { initialNodes, initialEdges } from "./temp-data/initialElements";
25
- import { ElkNodeWithFlow } from "./elk-types";
25
+ import { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "./elk-types";
26
26
 
27
27
  const elk = new ELK();
28
28
 
29
29
  const getLayoutedElements = (nodes: any, edges: any, options: any = {}) => {
30
- const graph: ElkNodeWithFlow = {
31
- id: "root",
32
- children: nodes.map((node: any) => ({
33
- ...node,
34
- targetPosition: "top",
35
- sourcePosition: "bottom",
36
- // Hardcoded until width and height calculation is implemented
37
- width: 150,
38
- height: 50,
39
- })),
40
- edges: edges,
41
- };
42
-
43
- return elk
44
- .layout(graph, { layoutOptions: options })
45
- .then((layoutedGraph: any) => {
46
- let nodeItems: any = [];
47
-
48
- layoutedGraph.children.forEach((node: any) => {
49
- nodeItems.push({
50
- ...node,
51
- // React Flow expects a position property on the node instead of `x`
52
- // and `y` fields.
53
- height: node.height,
54
- position: { x: node.x, y: node.y },
55
- });
56
-
57
- if (node.children) {
58
- node.children.forEach((node2: any) => {
59
- nodeItems.push({
60
- ...node2,
61
- // React Flow expects a position property on the node instead of `x`
62
- // and `y` fields.
63
- targetPosition: "top",
64
- sourcePosition: "bottom",
65
- position: { x: node2.x, y: node2.y },
66
- parentId: node.id,
67
- });
68
- });
69
- }
70
- });
71
-
72
- layoutedGraph.edges.forEach((edge: any) => {
73
- edge.source = edge.sources[0];
74
- edge.target = edge.targets[0];
75
- });
76
-
77
- return {
78
- nodes: nodeItems,
79
- edges: layoutedGraph.edges,
80
- };
81
- })
82
- .catch(console.error);
30
+ const graph: ElkNodeWithFlow = {
31
+ id: "root",
32
+ children: nodes.map((node: any) => ({
33
+ ...node,
34
+ targetPosition: "top",
35
+ sourcePosition: "bottom",
36
+ // Hardcoded until width and height calculation is implemented
37
+ })),
38
+ edges: edges,
39
+ };
40
+
41
+ return elk
42
+ .layout(graph, { layoutOptions: options })
43
+ .then((layoutedGraph: any) => {
44
+ let nodeItems: any = [];
45
+
46
+ layoutedGraph.children.forEach((node: any) => {
47
+ nodeItems.push({
48
+ ...node,
49
+ // React Flow expects a position property on the node instead of `x`
50
+ // and `y` fields.
51
+ height: node.height,
52
+ width: node.width,
53
+ position: { x: node.x, y: node.y + calcYOffset() },
54
+ });
55
+
56
+ if (node.children) {
57
+ node.children.forEach((node2: any) => {
58
+ nodeItems.push({
59
+ ...node2,
60
+ // React Flow expects a position property on the node instead of `x`
61
+ // and `y` fields.
62
+ targetPosition: "top",
63
+ sourcePosition: "bottom",
64
+ position: { x: node2.x, y: node2.y + calcYOffset() },
65
+ parentId: node.id,
66
+ });
67
+ });
68
+ }
69
+ });
70
+
71
+ layoutedGraph.edges.forEach((edge: ElkExtendedEdgeWithFlow) => {
72
+ edge.source = edge.sources[0];
73
+ edge.target = edge.targets[0];
74
+ });
75
+
76
+ return {
77
+ nodes: nodeItems,
78
+ edges: layoutedGraph.edges.map((edge: ElkExtendedEdgeWithFlow) => ({
79
+ ...edge,
80
+ })),
81
+ };
82
+ })
83
+ .catch(console.error);
84
+ };
85
+
86
+ const calcYOffset = () => {
87
+ return 60;
83
88
  };
84
89
 
85
90
  interface Props {
86
- title?: string; // e.g. Executions
87
- section?: string; // e.g. e4Integrate
91
+ title?: string; // e.g. Executions
92
+ section?: string; // e.g. e4Integrate
88
93
  }
89
94
 
90
- const IntegrationView: React.FC<Props> = (props: Props) => {
91
- const theme = useTheme();
92
- const styles = getStyles(theme);
93
-
94
- const [nodes, setNodes, onNodesChange] = useNodesState<any>([]);
95
- const [edges, setEdges, onEdgesChange] = useEdgesState<any>([]);
96
- const { fitView } = useReactFlow();
97
-
98
- const onConnect = useCallback((params: any) => {}, []);
99
- const onLayout = useCallback(
100
- ({ useInitialNodes = false }: any) => {
101
- const opts = { ...elkOptions };
102
- const ns = useInitialNodes ? initialNodes : nodes;
103
- const es = useInitialNodes ? initialEdges : edges;
104
-
105
- getLayoutedElements(ns, es, opts).then(
106
- ({ nodes: layoutedNodes, edges: layoutedEdges }: any) => {
107
- setNodes(layoutedNodes);
108
- setEdges(layoutedEdges);
109
- fitView();
110
- }
111
- );
112
- },
113
- [nodes, edges]
114
- );
115
-
116
- // Calculate the initial layout on mount.
117
- useLayoutEffect(() => {
118
- onLayout({ useInitialNodes: true });
119
- }, []);
120
-
121
- return (
122
- <Box sx={{ flexGrow: 1 }}>
123
- <ReactFlowProvider>
124
- <Box sx={{ width: "750px", height: "750px" }}>
125
- <ReactFlow
126
- nodes={nodes}
127
- edges={edges}
128
- nodeTypes={nodeTypes}
129
- edgeTypes={edgeTypes}
130
- onConnect={onConnect}
131
- onNodesChange={onNodesChange}
132
- onEdgesChange={onEdgesChange}
133
- fitView
134
- >
135
- <Background />
136
- </ReactFlow>
137
- </Box>
138
- </ReactFlowProvider>
139
- </Box>
140
- );
141
- };
142
-
143
- const getStyles = (theme: Theme) => {
144
- return {
145
- appbar: {
146
- color: "#000",
147
- },
148
- toolbar: {
149
- backgroundColor: "#fff",
150
- padding: theme.spacing(2, 0),
151
- },
152
- };
95
+ const IntegrationView: React.FC<Props> = () => {
96
+ const [nodes, setNodes, onNodesChange] = useNodesState<any>([]);
97
+ const [edges, setEdges, onEdgesChange] = useEdgesState<any>([]);
98
+ const { fitView } = useReactFlow();
99
+
100
+ const onConnect = useCallback(() => {}, []);
101
+ const onLayout = useCallback(
102
+ ({ useInitialNodes = false }: any) => {
103
+ const opts = { ...elkOptions };
104
+ const ns = useInitialNodes ? initialNodes : nodes;
105
+ const es = useInitialNodes ? initialEdges : edges;
106
+
107
+ getLayoutedElements(ns, es, opts).then(
108
+ ({ nodes: layoutedNodes, edges: layoutedEdges }: any) => {
109
+ setNodes(layoutedNodes);
110
+ setEdges(layoutedEdges);
111
+ fitView();
112
+ },
113
+ );
114
+ },
115
+ [nodes, edges],
116
+ );
117
+
118
+ // Calculate the initial layout on mount.
119
+ useLayoutEffect(() => {
120
+ onLayout({ useInitialNodes: true });
121
+ }, []);
122
+
123
+ return (
124
+ <Box sx={{ flexGrow: 1 }}>
125
+ <ReactFlowProvider>
126
+ <Box sx={{ width: "750px", height: "600px" }}>
127
+ <ReactFlow
128
+ nodes={nodes}
129
+ edges={edges}
130
+ nodeTypes={nodeTypes}
131
+ edgeTypes={edgeTypes}
132
+ onConnect={onConnect}
133
+ onNodesChange={onNodesChange}
134
+ onEdgesChange={onEdgesChange}
135
+ fitView={true} // Fits the view on initial load
136
+ fitViewOptions={{
137
+ padding: 0.1,
138
+ includeHiddenNodes: false,
139
+ minZoom: 0.1,
140
+ maxZoom: 2,
141
+ duration: 200,
142
+ nodes: [{ id: "1" }, { id: "2" }], // nodes to fit
143
+ }} // Optional options for initial fit
144
+ nodesDraggable={false}
145
+ minZoom={0.1} // Lock zoom to 1
146
+ maxZoom={2} // Lock zoom to 1
147
+ >
148
+ <Background />
149
+ <Controls />
150
+ </ReactFlow>
151
+ </Box>
152
+ </ReactFlowProvider>
153
+ </Box>
154
+ );
153
155
  };
154
156
 
155
157
  export default () => (
156
- <ReactFlowProvider>
157
- <IntegrationView />
158
- </ReactFlowProvider>
158
+ <ReactFlowProvider>
159
+ <IntegrationView />
160
+ </ReactFlowProvider>
159
161
  );
@@ -0,0 +1,50 @@
1
+ import { Card, CardContent, CardHeader } from "@mui/material";
2
+ import { forwardRef, type HTMLAttributes } from "react";
3
+
4
+ export const BaseNode = forwardRef<
5
+ HTMLDivElement,
6
+ HTMLAttributes<HTMLDivElement>
7
+ >(({ className, ...props }, ref) => (
8
+ <Card tabIndex={0}>
9
+ <CardContent ref={ref} {...props} />
10
+ </Card>
11
+ ));
12
+ BaseNode.displayName = "BaseNode";
13
+
14
+ /**
15
+ * A container for a consistent header layout intended to be used inside the
16
+ * `<BaseNode />` component.
17
+ */
18
+ export const BaseNodeHeader = forwardRef<
19
+ HTMLElement,
20
+ HTMLAttributes<HTMLElement>
21
+ >(({ className, ...props }, ref) => <CardHeader ref={ref} {...props} />);
22
+ BaseNodeHeader.displayName = "BaseNodeHeader";
23
+
24
+ /**
25
+ * The title text for the node. To maintain a native application feel, the title
26
+ * text is not selectable.
27
+ */
28
+ export const BaseNodeHeaderTitle = forwardRef<
29
+ HTMLHeadingElement,
30
+ HTMLAttributes<HTMLHeadingElement>
31
+ >(({ className, ...props }, ref) => (
32
+ <h3 ref={ref} data-slot="base-node-title" {...props} />
33
+ ));
34
+ BaseNodeHeaderTitle.displayName = "BaseNodeHeaderTitle";
35
+
36
+ export const BaseNodeContent = forwardRef<
37
+ HTMLDivElement,
38
+ HTMLAttributes<HTMLDivElement>
39
+ >(({ className, ...props }, ref) => (
40
+ <CardContent ref={ref} data-slot="base-node-content" {...props} />
41
+ ));
42
+ BaseNodeContent.displayName = "BaseNodeContent";
43
+
44
+ export const BaseNodeFooter = forwardRef<
45
+ HTMLDivElement,
46
+ HTMLAttributes<HTMLDivElement>
47
+ >(({ className, ...props }, ref) => (
48
+ <div ref={ref} data-slot="base-node-footer" {...props} />
49
+ ));
50
+ BaseNodeFooter.displayName = "BaseNodeFooter";
@@ -1,10 +1,10 @@
1
- import { Handle, NodeProps, Position } from "@xyflow/react";
1
+ import { Handle, Position } from "@xyflow/react";
2
2
 
3
- export function ConnectionNode(props: NodeProps): JSX.Element {
4
- return (
5
- <div>
6
- <Handle type="source" position={Position.Bottom} />
7
- <Handle type="target" position={Position.Top} />
8
- </div>
9
- );
3
+ export function ConnectionNode(): JSX.Element {
4
+ return (
5
+ <div>
6
+ <Handle type="source" position={Position.Bottom} style={{ opacity: 1 }} />
7
+ <Handle type="target" position={Position.Top} style={{ opacity: 0 }} />
8
+ </div>
9
+ );
10
10
  }
@@ -1,10 +1,10 @@
1
- import { Handle, NodeProps, Position } from "@xyflow/react";
1
+ import { Handle, Position } from "@xyflow/react";
2
2
 
3
- export function EntryNode(props: NodeProps): JSX.Element {
4
- return (
5
- <div>
6
- <Handle type="source" position={Position.Bottom} />
7
- <Handle type="target" position={Position.Top} />
8
- </div>
9
- );
3
+ export function EntryNode(): JSX.Element {
4
+ return (
5
+ <div>
6
+ <Handle type="source" position={Position.Bottom} />
7
+ <Handle type="target" position={Position.Top} />
8
+ </div>
9
+ );
10
10
  }
@@ -1,10 +1,51 @@
1
+ import { Box, Card, CardContent, CardHeader, Typography } from "@mui/material";
1
2
  import { Handle, NodeProps, Position } from "@xyflow/react";
3
+ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
2
4
 
3
5
  export function GroupNode(props: NodeProps): JSX.Element {
4
- return (
5
- <div>
6
- <Handle type="source" position={Position.Bottom} />
7
- <Handle type="target" position={Position.Top} />
8
- </div>
9
- );
6
+ return (
7
+ <Box>
8
+ <Card
9
+ sx={{
10
+ borderWidth: 1,
11
+ borderStyle: "solid",
12
+ borderColor: "grey.700",
13
+ width: props.width,
14
+ }}
15
+ >
16
+ <CardHeader
17
+ title={
18
+ <Typography variant="h5" sx={{ textAlign: "center" }}>
19
+ {props?.data?.label as string}
20
+ </Typography>
21
+ }
22
+ sx={{
23
+ height: 62,
24
+ paddingRight: "48px",
25
+ }}
26
+ />
27
+ <CardContent
28
+ sx={{
29
+ height: props.height,
30
+ width: (props.width || 0) + 48,
31
+ display: "flex",
32
+ justifyContent: "center",
33
+ alignItems: "flex-end",
34
+ paddingRight: "48px",
35
+ }}
36
+ >
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
+ />
46
+ </CardContent>
47
+ <Handle type="target" position={Position.Top} />
48
+ </Card>
49
+ </Box>
50
+ );
10
51
  }
@@ -1,17 +1,62 @@
1
+ import { Box, Card, CardContent, Typography, useTheme } from "@mui/material";
1
2
  import { Handle, NodeProps, Position } from "@xyflow/react";
2
3
 
4
+ import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
5
+
3
6
  export function TaskNode(props: NodeProps): JSX.Element {
4
- return (
5
- <div
6
- className="task-node"
7
- style={{
8
- padding: "10px",
9
- border: "1px solid #ddd",
10
- borderRadius: "30px",
11
- }}
12
- >
13
- <Handle type="source" position={Position.Bottom} />
14
- <Handle type="target" position={Position.Top} />
15
- </div>
16
- );
7
+ const theme = useTheme();
8
+
9
+ return (
10
+ <Box
11
+ sx={{
12
+ display: "flex",
13
+ justifyContent: "center",
14
+ alignItems: "center",
15
+ //width: props.width + 24 + theme.spacing(1),
16
+ }}
17
+ >
18
+ <Card
19
+ sx={{
20
+ borderWidth: 1,
21
+ borderStyle: "solid",
22
+ borderColor: "grey.700",
23
+ "&:hover": {
24
+ borderColor: "#4E97FD", //Blue not implemented in the theme
25
+ backgroundColor: "#DBF0FE",
26
+ },
27
+ }}
28
+ >
29
+ <CardContent
30
+ sx={{
31
+ height: props.height,
32
+ width: props.width,
33
+ display: "flex",
34
+ justifyContent: "center",
35
+ alignItems: "center",
36
+ }}
37
+ >
38
+ {props?.data?.icon as any}
39
+ <Typography
40
+ variant="h6"
41
+ sx={{ textAlign: "center", paddingLeft: theme.spacing(1) }}
42
+ >
43
+ {props?.data?.label as string}
44
+ </Typography>
45
+ </CardContent>
46
+ <Handle type="target" position={Position.Top} />
47
+ <Handle type="source" position={Position.Bottom} />
48
+ </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
+ },
57
+ }}
58
+ />
59
+ ) : null}
60
+ </Box>
61
+ );
17
62
  }