@evenicanpm/admin-integrate 1.1.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.
- package/README.md +29 -0
- package/documents/ProcessExecution/fragments.ts +16 -0
- package/documents/ProcessExecution/list.ts +31 -0
- package/package.json +19 -0
- package/src/api/dashboard/queries/get-process-executions.query.ts +48 -0
- package/src/api/dashboard/queries/get-process-executions.server.ts +11 -0
- package/src/api/dashboard/queries/index.ts +1 -0
- package/src/auth/.keep +0 -0
- package/src/auth/types/.keep +0 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +42 -0
- package/src/components/breadcrumbs/index.ts +2 -0
- package/src/components/button/index.ts +1 -0
- package/src/components/button/outlined-icon-button.tsx +47 -0
- package/src/components/core/index.ts +1 -0
- package/src/components/core/loading.tsx +15 -0
- package/src/components/dashboard-list/dashboard-list-row.tsx +145 -0
- package/src/components/dashboard-list/dashboard-list.tsx +157 -0
- package/src/components/dashboard-list/index.ts +1 -0
- package/src/components/data-table/index.ts +3 -0
- package/src/components/data-table/table-header.tsx +109 -0
- package/src/components/data-table/table-pagination.tsx +36 -0
- package/src/components/data-table/table-row.tsx +27 -0
- package/src/components/data-table/table-skeleton.tsx +45 -0
- package/src/components/execution/execution-filter.ts +30 -0
- package/src/components/execution/execution-status-icon.tsx +30 -0
- package/src/components/execution/execution-tag.tsx +100 -0
- package/src/components/execution/index.ts +2 -0
- package/src/components/footer/footer.tsx +55 -0
- package/src/components/footer/index.ts +1 -0
- package/src/components/header/dashboard-list-header.tsx +88 -0
- package/src/components/header/execution-details-header.tsx +154 -0
- package/src/components/header/header.tsx +42 -0
- package/src/components/header/index.ts +3 -0
- package/src/components/icons/up-down.tsx +21 -0
- package/src/components/integration-view/edges/default-edge.tsx +23 -0
- package/src/components/integration-view/elk-layout-options.ts +39 -0
- package/src/components/integration-view/elk-types.ts +19 -0
- package/src/components/integration-view/flow-types.tsx +16 -0
- package/src/components/integration-view/index.ts +1 -0
- package/src/components/integration-view/integration-view.tsx +159 -0
- package/src/components/integration-view/nodes/connection-node.tsx +10 -0
- package/src/components/integration-view/nodes/entry-node.tsx +10 -0
- package/src/components/integration-view/nodes/group-node.tsx +10 -0
- package/src/components/integration-view/nodes/task-node.tsx +17 -0
- package/src/components/integration-view/temp-data/initialElements.ts +238 -0
- package/src/components/integration-view/types.ts +12 -0
- package/src/components/layouts/index.ts +2 -0
- package/src/components/layouts/main-layout.tsx +28 -0
- package/src/components/layouts/root-container.tsx +43 -0
- package/src/components/link-cards/index.ts +1 -0
- package/src/components/link-cards/link-card.tsx +36 -0
- package/src/components/link-cards/styles.ts +29 -0
- package/src/components/list-filter/date-filter.tsx +55 -0
- package/src/components/list-filter/date-range-filter.tsx +101 -0
- package/src/components/list-filter/index.ts +6 -0
- package/src/components/list-filter/list-filter-types.ts +70 -0
- package/src/components/list-filter/list-filter.tsx +409 -0
- package/src/components/list-filter/multi-select-filter.tsx +117 -0
- package/src/components/list-filter/select-filter.tsx +82 -0
- package/src/hooks/use-breadcrumbs.ts +45 -0
- package/src/hooks/use-timestamp.tsx +25 -0
- package/src/lib/.keep +0 -0
- package/src/pages/dashboard/dashboard-link-cards.tsx +122 -0
- package/src/pages/dashboard/dashboard-list-sections.tsx +149 -0
- package/src/pages/dashboard/dashboard.tsx +14 -0
- package/src/pages/dashboard/index.ts +1 -0
- package/src/pages/execution-details/execution-details.tsx +43 -0
- package/src/pages/execution-details/index.ts +1 -0
- package/src/pages/executions/executions-list/executions-list-row.tsx +142 -0
- package/src/pages/executions/executions-list/executions-list-table.tsx +78 -0
- package/src/pages/executions/executions-list/executions-list.tsx +265 -0
- package/src/pages/executions/executions-list/index.ts +1 -0
- package/src/pages/executions/executions.tsx +98 -0
- package/src/pages/executions/index.ts +1 -0
- package/src/pages/integrations/index.ts +1 -0
- package/src/pages/integrations/integrations.tsx +39 -0
- package/src/pages/scheduler/index.ts +1 -0
- package/src/pages/scheduler/scheduler.tsx +39 -0
- package/tsconfig.json +28 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Box, Typography, AppBar, Toolbar, Stack } from "@mui/material";
|
|
3
|
+
import { Theme, useTheme } from "@mui/material";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
title: string; // e.g. Executions
|
|
7
|
+
section: string; // e.g. e4Integrate
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const IntegrateHeader: React.FC<Props> = (props: Props) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const styles = getStyles(theme);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Box sx={{ flexGrow: 1 }}>
|
|
16
|
+
<AppBar position="static" sx={styles.appbar} elevation={2}>
|
|
17
|
+
<Toolbar sx={styles.toolbar}>
|
|
18
|
+
<Stack>
|
|
19
|
+
<Typography variant="body1" color="info.main">
|
|
20
|
+
{props.section}
|
|
21
|
+
</Typography>
|
|
22
|
+
<Typography variant="h4">{props.title}</Typography>
|
|
23
|
+
</Stack>
|
|
24
|
+
</Toolbar>
|
|
25
|
+
</AppBar>
|
|
26
|
+
</Box>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getStyles = (theme: Theme) => {
|
|
31
|
+
return {
|
|
32
|
+
appbar: {
|
|
33
|
+
color: "text.primary",
|
|
34
|
+
},
|
|
35
|
+
toolbar: {
|
|
36
|
+
backgroundColor: "white",
|
|
37
|
+
padding: theme.spacing(2, 0),
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default IntegrateHeader;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import createSvgIcon from "@mui/material/utils/createSvgIcon";
|
|
2
|
+
|
|
3
|
+
const UpDown = createSvgIcon(
|
|
4
|
+
<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
5
|
+
<path
|
|
6
|
+
d="M8.64847 6.88354H3.35158C3.04454 6.88354 2.86173 7.2269 3.03517 7.4812L5.68362 11.3824C5.83596 11.6062 6.16526 11.6062 6.3176 11.3824L8.96605 7.4812C9.13714 7.2269 8.9555 6.88354 8.64847 6.88354Z"
|
|
7
|
+
fill="currentColor"
|
|
8
|
+
/>
|
|
9
|
+
<path
|
|
10
|
+
d="M8.64852 6.76641C8.54188 6.76641 8.43524 6.76641 8.32743 6.76641C8.05204 6.76641 7.77782 6.76641 7.50243 6.76641C7.13329 6.76641 6.76532 6.76641 6.39618 6.76641C6.0036 6.76641 5.61102 6.76641 5.21845 6.76641C4.87274 6.76641 4.52821 6.76641 4.18251 6.76641C3.95517 6.76641 3.72783 6.76641 3.49931 6.76641C3.45361 6.76641 3.40673 6.76641 3.36103 6.76641C3.17705 6.76758 3.00478 6.85898 2.91455 7.02187C2.82197 7.18828 2.83251 7.39102 2.93916 7.54922C2.96728 7.59141 2.9954 7.63242 3.02353 7.67344C3.16064 7.87617 3.29892 8.07891 3.43603 8.28164C3.64111 8.58281 3.84618 8.88516 4.05009 9.18633C4.26923 9.50977 4.48954 9.8332 4.70868 10.1566C4.89384 10.4285 5.07782 10.7016 5.26298 10.9734C5.36259 11.1211 5.46337 11.2687 5.56298 11.4164C5.63798 11.5277 5.73642 11.6168 5.87001 11.6508C6.08446 11.7059 6.2954 11.6145 6.41962 11.4363C6.50282 11.3168 6.58368 11.1949 6.66571 11.0742C6.84032 10.8164 7.01493 10.5598 7.18954 10.302C7.40751 9.97969 7.62665 9.65859 7.84461 9.33633C8.05438 9.02812 8.26415 8.71875 8.47274 8.41055C8.62391 8.18789 8.77508 7.96406 8.92625 7.74141C9.02703 7.59375 9.14891 7.44961 9.14539 7.26094C9.14422 6.98672 8.91922 6.77109 8.64852 6.76641C8.49735 6.76406 8.49735 6.99844 8.64852 7.00078C8.85125 7.0043 8.98133 7.22109 8.88055 7.39687C8.8618 7.42969 8.83836 7.46133 8.81727 7.49297C8.70125 7.66289 8.58641 7.83398 8.47039 8.00391C8.06493 8.60156 7.65946 9.19922 7.25282 9.79687C6.93173 10.2703 6.61063 10.7437 6.28954 11.216C6.2661 11.2512 6.24266 11.2863 6.21805 11.3203C6.12313 11.4504 5.94149 11.4715 5.82548 11.3684C5.79149 11.3379 5.76806 11.2992 5.74227 11.2617C5.69774 11.1961 5.65321 11.1305 5.60868 11.0648C5.2454 10.5305 4.88212 9.99492 4.52001 9.46055C4.13915 8.89922 3.75712 8.33672 3.37626 7.77539C3.29775 7.65937 3.21806 7.54453 3.14072 7.42852C3.05634 7.30195 3.07392 7.14726 3.18642 7.0582C3.2497 7.00898 3.31298 7.00078 3.3915 7.00078C3.86025 7.00078 4.33017 7.00078 4.79892 7.00078C5.55009 7.00078 6.30126 7.00078 7.05243 7.00078C7.55985 7.00078 8.0661 7.00078 8.57352 7.00078C8.5993 7.00078 8.62391 7.00078 8.64969 7.00078C8.79852 7.00078 8.79969 6.76641 8.64852 6.76641ZM8.64852 5.11641H3.35165C3.04462 5.11641 2.86181 4.77305 3.03525 4.51875L5.68368 0.617578C5.83602 0.39375 6.16532 0.39375 6.31766 0.617578L8.9661 4.51875C9.13719 4.77305 8.95555 5.11641 8.64852 5.11641Z"
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
/>
|
|
13
|
+
<path
|
|
14
|
+
d="M8.64832 4.99922C8.28153 4.99922 7.91473 4.99922 7.54676 4.99922C6.80262 4.99922 6.05849 4.99922 5.31552 4.99922C4.73193 4.99922 4.14834 4.99922 3.56592 4.99922C3.50615 4.99922 3.44639 4.99922 3.38662 4.99922C3.30459 4.99922 3.23428 4.98515 3.17803 4.93476C3.07022 4.83633 3.05733 4.6957 3.1417 4.57031C3.16865 4.53047 3.19561 4.49062 3.22256 4.45195C3.55068 3.96914 3.87881 3.48633 4.20576 3.00234C4.60888 2.4082 5.01201 1.81524 5.41513 1.2211C5.52529 1.05821 5.63661 0.895317 5.74677 0.732426C5.77372 0.692583 5.7995 0.650395 5.83583 0.62227C5.95536 0.52852 6.12763 0.55313 6.21903 0.680864C6.30106 0.794536 6.37724 0.912895 6.45575 1.02891C6.62333 1.27618 6.79208 1.52461 6.95966 1.77188C7.37801 2.38828 7.79637 3.00469 8.21473 3.61992C8.37293 3.85312 8.53113 4.08515 8.68816 4.31836C8.7327 4.38281 8.77605 4.44844 8.82059 4.51289C8.8452 4.55039 8.87566 4.58789 8.89441 4.6289C8.96824 4.8 8.84051 4.9957 8.64832 4.99922C8.49715 5.00156 8.49715 5.23593 8.64832 5.23359C8.92371 5.2289 9.15926 5.00039 9.14871 4.71914C9.14519 4.60898 9.10301 4.51289 9.04324 4.425C8.93777 4.26914 8.8323 4.11445 8.72684 3.95859C8.53934 3.68203 8.35184 3.40547 8.16317 3.12891C7.94285 2.80547 7.72371 2.48086 7.5034 2.15742C7.30184 1.85977 7.10028 1.56211 6.89755 1.26563C6.76395 1.06875 6.62919 0.870707 6.49559 0.673833C6.47098 0.637505 6.44638 0.600005 6.42059 0.563677C6.29403 0.382036 6.06903 0.287115 5.85224 0.356255C5.65419 0.418364 5.56044 0.591802 5.45146 0.751176C5.30146 0.971488 5.15263 1.1918 5.00263 1.41328C4.79287 1.72266 4.5831 2.03203 4.37216 2.34141C4.1542 2.6625 3.93623 2.98242 3.71943 3.30352C3.54365 3.5625 3.3667 3.82266 3.19092 4.08164C3.10654 4.20586 3.021 4.3289 2.93779 4.45429C2.82998 4.61601 2.82178 4.82929 2.9249 4.99687C3.01983 5.15039 3.18389 5.23476 3.36318 5.23593C3.50615 5.23711 3.65029 5.23593 3.79326 5.23593C4.08974 5.23593 4.38623 5.23593 4.68271 5.23593C5.06357 5.23593 5.44325 5.23593 5.82411 5.23593C6.21317 5.23593 6.60223 5.23593 6.9913 5.23593C7.31942 5.23593 7.64872 5.23593 7.97684 5.23593C8.17371 5.23593 8.37059 5.23593 8.56746 5.23593C8.59441 5.23593 8.62137 5.23593 8.64832 5.23593C8.79832 5.23359 8.79949 4.99922 8.64832 4.99922Z"
|
|
15
|
+
fill="currentColor"
|
|
16
|
+
/>
|
|
17
|
+
</svg>,
|
|
18
|
+
"UpDown",
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export default UpDown;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BaseEdge, EdgeProps, getSmoothStepPath } from "@xyflow/react";
|
|
2
|
+
|
|
3
|
+
export function DefaultEdge({
|
|
4
|
+
id,
|
|
5
|
+
sourceX,
|
|
6
|
+
sourceY,
|
|
7
|
+
targetX,
|
|
8
|
+
targetY,
|
|
9
|
+
}: EdgeProps): JSX.Element {
|
|
10
|
+
const [edgePath] = getSmoothStepPath({
|
|
11
|
+
sourceX,
|
|
12
|
+
sourceY,
|
|
13
|
+
targetX,
|
|
14
|
+
targetY,
|
|
15
|
+
borderRadius: 0,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<BaseEdge id={id} path={edgePath} />
|
|
21
|
+
</>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LayoutOptions } from "elkjs";
|
|
2
|
+
|
|
3
|
+
export const layoutOptions: LayoutOptions = {
|
|
4
|
+
"elk.algorithm": "layered",
|
|
5
|
+
"elk.direction": "DOWN",
|
|
6
|
+
|
|
7
|
+
// Arrange parent and child nodes in clear layers
|
|
8
|
+
"org.eclipse.elk.hierarchyHandling": "INCLUDE_CHILDREN",
|
|
9
|
+
|
|
10
|
+
// Center parent nodes among their children, children immediately below
|
|
11
|
+
"org.eclipse.elk.layered.contentAlignment": "H_CENTER,V_TOP",
|
|
12
|
+
|
|
13
|
+
// Reduce edge crossings
|
|
14
|
+
"org.eclipse.elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
|
|
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",
|
|
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",
|
|
26
|
+
|
|
27
|
+
// Add spacing between edges that do not share a connection point
|
|
28
|
+
"org.eclipse.elk.spacing.edgeEdge": "30",
|
|
29
|
+
|
|
30
|
+
// Node placement strategy for centered alignment
|
|
31
|
+
"org.eclipse.elk.layered.nodePlacement.strategy": "SIMPLE",
|
|
32
|
+
|
|
33
|
+
// Layering strategy to optimize horizontal alignment
|
|
34
|
+
"org.eclipse.elk.layered.layering.strategy": "NETWORK_SIMPLEX",
|
|
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",
|
|
39
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ElkExtendedEdge, ElkNode } from "elkjs";
|
|
2
|
+
import { extend } from "lodash";
|
|
3
|
+
|
|
4
|
+
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;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ElkExtendedEdgeWithFlow extends ElkExtendedEdge {
|
|
18
|
+
type?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DefaultEdge } from "./edges/default-edge";
|
|
2
|
+
import { ConnectionNode } from "./nodes/connection-node";
|
|
3
|
+
import { EntryNode } from "./nodes/entry-node";
|
|
4
|
+
import { GroupNode } from "./nodes/group-node";
|
|
5
|
+
import { TaskNode } from "./nodes/task-node";
|
|
6
|
+
|
|
7
|
+
export const edgeTypes = {
|
|
8
|
+
"default-edge": DefaultEdge,
|
|
9
|
+
};
|
|
10
|
+
|
|
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
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as IntegrationView } from "./integration-view";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useLayoutEffect } from "react";
|
|
4
|
+
import { Box, Typography, AppBar, Toolbar, Stack } from "@mui/material";
|
|
5
|
+
import { Theme, useTheme } from "@mui/material";
|
|
6
|
+
|
|
7
|
+
import ELK from "elkjs/lib/elk.bundled.js";
|
|
8
|
+
|
|
9
|
+
import "@xyflow/react/dist/style.css";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
Background,
|
|
13
|
+
ReactFlow,
|
|
14
|
+
ReactFlowProvider,
|
|
15
|
+
useEdgesState,
|
|
16
|
+
useNodesState,
|
|
17
|
+
useReactFlow,
|
|
18
|
+
} from "@xyflow/react";
|
|
19
|
+
|
|
20
|
+
import { nodeTypes, edgeTypes } from "./flow-types";
|
|
21
|
+
|
|
22
|
+
import { layoutOptions as elkOptions } from "./elk-layout-options";
|
|
23
|
+
|
|
24
|
+
import { initialNodes, initialEdges } from "./temp-data/initialElements";
|
|
25
|
+
import { ElkNodeWithFlow } from "./elk-types";
|
|
26
|
+
|
|
27
|
+
const elk = new ELK();
|
|
28
|
+
|
|
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);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
interface Props {
|
|
86
|
+
title?: string; // e.g. Executions
|
|
87
|
+
section?: string; // e.g. e4Integrate
|
|
88
|
+
}
|
|
89
|
+
|
|
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
|
+
};
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export default () => (
|
|
156
|
+
<ReactFlowProvider>
|
|
157
|
+
<IntegrationView />
|
|
158
|
+
</ReactFlowProvider>
|
|
159
|
+
);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handle, NodeProps, Position } from "@xyflow/react";
|
|
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
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handle, NodeProps, Position } from "@xyflow/react";
|
|
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
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Handle, NodeProps, Position } from "@xyflow/react";
|
|
2
|
+
|
|
3
|
+
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
|
+
);
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Handle, NodeProps, Position } from "@xyflow/react";
|
|
2
|
+
|
|
3
|
+
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
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { ElkExtendedEdge } from "elkjs";
|
|
2
|
+
import { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "../elk-//types";
|
|
3
|
+
|
|
4
|
+
const position = { x: 0, y: 0 };
|
|
5
|
+
|
|
6
|
+
export const initialNodes: ElkNodeWithFlow[] = [
|
|
7
|
+
{
|
|
8
|
+
id: "1",
|
|
9
|
+
type: "task-node",
|
|
10
|
+
data: { label: "input" },
|
|
11
|
+
position,
|
|
12
|
+
layoutOptions: {
|
|
13
|
+
"org.eclipse.elk.priority": "1",
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
{
|
|
18
|
+
id: "2",
|
|
19
|
+
data: { label: "node 2" },
|
|
20
|
+
position,
|
|
21
|
+
//type: "custom-group",
|
|
22
|
+
children: [
|
|
23
|
+
{
|
|
24
|
+
id: "2gs",
|
|
25
|
+
data: { label: "Group 1" },
|
|
26
|
+
position,
|
|
27
|
+
width: 150,
|
|
28
|
+
height: 50,
|
|
29
|
+
//extent: "parent",
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
{
|
|
33
|
+
id: "2g1",
|
|
34
|
+
data: { label: "2g1" },
|
|
35
|
+
position,
|
|
36
|
+
width: 150,
|
|
37
|
+
height: 70,
|
|
38
|
+
extent: "parent",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "2g3",
|
|
42
|
+
data: { label: "2g3" },
|
|
43
|
+
position,
|
|
44
|
+
width: 150,
|
|
45
|
+
height: 20,
|
|
46
|
+
extent: "parent",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "2g4",
|
|
50
|
+
data: { label: "2g4" },
|
|
51
|
+
position,
|
|
52
|
+
width: 150,
|
|
53
|
+
height: 60,
|
|
54
|
+
extent: "parent",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: "2g2",
|
|
58
|
+
data: { label: "2g2" },
|
|
59
|
+
position,
|
|
60
|
+
width: 150,
|
|
61
|
+
height: 80,
|
|
62
|
+
extent: "parent",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
layoutOptions: {
|
|
66
|
+
"org.eclipse.elk.priority": "2",
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
{
|
|
71
|
+
id: "3",
|
|
72
|
+
data: { label: "node 2" },
|
|
73
|
+
position,
|
|
74
|
+
//height: 400,
|
|
75
|
+
//width: 400,
|
|
76
|
+
//type: "custom-group",
|
|
77
|
+
children: [
|
|
78
|
+
{
|
|
79
|
+
id: "3gs",
|
|
80
|
+
data: { label: "Group 1" },
|
|
81
|
+
position,
|
|
82
|
+
width: 150,
|
|
83
|
+
height: 50,
|
|
84
|
+
extent: "parent",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: "3g1",
|
|
88
|
+
data: { label: "2g1" },
|
|
89
|
+
position,
|
|
90
|
+
width: 150,
|
|
91
|
+
height: 50,
|
|
92
|
+
extent: "parent",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "3g1-b",
|
|
96
|
+
data: { label: "2g1" },
|
|
97
|
+
position,
|
|
98
|
+
width: 150,
|
|
99
|
+
height: 50,
|
|
100
|
+
extent: "parent",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "3gconnect",
|
|
104
|
+
data: { label: "2g1" },
|
|
105
|
+
position,
|
|
106
|
+
//type: "connection-node",
|
|
107
|
+
width: 1,
|
|
108
|
+
height: 1,
|
|
109
|
+
extent: "parent",
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "3g2",
|
|
113
|
+
data: { label: "2g2" },
|
|
114
|
+
position,
|
|
115
|
+
width: 150,
|
|
116
|
+
height: 50,
|
|
117
|
+
extent: "parent",
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: "3g3",
|
|
121
|
+
data: { label: "2g3" },
|
|
122
|
+
position,
|
|
123
|
+
width: 150,
|
|
124
|
+
height: 50,
|
|
125
|
+
extent: "parent",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "3g4",
|
|
129
|
+
data: { label: "2g4" },
|
|
130
|
+
position,
|
|
131
|
+
width: 150,
|
|
132
|
+
height: 50,
|
|
133
|
+
extent: "parent",
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
layoutOptions: {
|
|
137
|
+
"org.eclipse.elk.priority": "2",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
id: "4",
|
|
142
|
+
data: { label: "node 2" },
|
|
143
|
+
position,
|
|
144
|
+
//height: 400,
|
|
145
|
+
//width: 400,
|
|
146
|
+
//type: "custom-group",
|
|
147
|
+
children: [
|
|
148
|
+
{
|
|
149
|
+
id: "4gs",
|
|
150
|
+
data: { label: "Group 1" },
|
|
151
|
+
position,
|
|
152
|
+
width: 150,
|
|
153
|
+
height: 50,
|
|
154
|
+
extent: "parent",
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "4g1",
|
|
158
|
+
data: { label: "2g1" },
|
|
159
|
+
position,
|
|
160
|
+
width: 150,
|
|
161
|
+
height: 50,
|
|
162
|
+
extent: "parent",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "4g2",
|
|
166
|
+
data: { label: "2g2" },
|
|
167
|
+
position,
|
|
168
|
+
width: 150,
|
|
169
|
+
height: 50,
|
|
170
|
+
extent: "parent",
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "4g3",
|
|
174
|
+
data: { label: "2g3" },
|
|
175
|
+
position,
|
|
176
|
+
width: 150,
|
|
177
|
+
height: 50,
|
|
178
|
+
extent: "parent",
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
id: "4g4",
|
|
182
|
+
data: { label: "2g4" },
|
|
183
|
+
position,
|
|
184
|
+
width: 150,
|
|
185
|
+
height: 50,
|
|
186
|
+
extent: "parent",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
layoutOptions: {
|
|
190
|
+
"org.eclipse.elk.priority": "2",
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
];
|
|
194
|
+
|
|
195
|
+
export const initialEdges: ElkExtendedEdgeWithFlow[] = [
|
|
196
|
+
{ id: "e1-2", sources: ["1"], targets: ["2"], type: "default-edge" },
|
|
197
|
+
{ id: "2gs-2g1", sources: ["2gs"], targets: ["2g1"], type: "default-edge" },
|
|
198
|
+
{ id: "2gs-2g2", sources: ["2gs"], targets: ["2g2"], type: "default-edge" },
|
|
199
|
+
{ id: "2gs-2g3", sources: ["2gs"], targets: ["2g3"], type: "default-edge" },
|
|
200
|
+
{ id: "2g1-2g4", sources: ["2g1"], targets: ["2g4"], type: "default-edge" },
|
|
201
|
+
{ id: "2g2-2g4", sources: ["2g2"], targets: ["2g4"], type: "default-edge" },
|
|
202
|
+
{ id: "2g3-2g4", sources: ["2g3"], targets: ["2g4"], type: "default-edge" },
|
|
203
|
+
//{ id: "e1-3", sources: ["1"], targets: ["3"], type: "default-edge" },
|
|
204
|
+
{ id: "3gs-3g1", sources: ["3gs"], targets: ["3g1"], type: "default-edge" },
|
|
205
|
+
{ id: "3gs-3gb", sources: ["3gs"], targets: ["3g1-b"], type: "default-edge" },
|
|
206
|
+
{
|
|
207
|
+
id: "3g1-3gconnect",
|
|
208
|
+
sources: ["3g1"],
|
|
209
|
+
targets: ["3gconnect"],
|
|
210
|
+
type: "default-edge",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
id: "3g1-b-3gconnect",
|
|
214
|
+
sources: ["3g1-b"],
|
|
215
|
+
targets: ["3gconnect"],
|
|
216
|
+
type: "default-edge",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
id: "3g1-3g2",
|
|
220
|
+
sources: ["3gconnect"],
|
|
221
|
+
targets: ["3g2"],
|
|
222
|
+
type: "default-edge",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "3g1-3g3",
|
|
226
|
+
sources: ["3gconnect"],
|
|
227
|
+
targets: ["3g3"],
|
|
228
|
+
type: "default-edge",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "3g1-3g4",
|
|
232
|
+
sources: ["3gconnect"],
|
|
233
|
+
targets: ["3g4"],
|
|
234
|
+
type: "default-edge",
|
|
235
|
+
},
|
|
236
|
+
{ id: "e1-3", sources: ["1"], targets: ["3"], type: "default-edge" },
|
|
237
|
+
{ id: "e1-4", sources: ["1"], targets: ["4"], type: "default-edge" },
|
|
238
|
+
];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { styled } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
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
|
+
import { LayoutProvider } from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-layout-context";
|
|
8
|
+
|
|
9
|
+
// STYLED COMPONENT
|
|
10
|
+
const StyledContainer = styled("div")(({ theme }) => ({
|
|
11
|
+
margin: 0,
|
|
12
|
+
padding: 0,
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
export default function MainLayout({
|
|
16
|
+
children,
|
|
17
|
+
}: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}) {
|
|
20
|
+
return (
|
|
21
|
+
<LayoutProvider>
|
|
22
|
+
<DashboardSidebar />
|
|
23
|
+
<BodyWrapper>
|
|
24
|
+
<StyledContainer>{children}</StyledContainer>
|
|
25
|
+
</BodyWrapper>
|
|
26
|
+
</LayoutProvider>
|
|
27
|
+
);
|
|
28
|
+
}
|