@evenicanpm/admin-integrate 1.2.2 → 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.
- package/documents/ConfigImport/configuration-import.ts +54 -0
- package/documents/CopyProcess/copy.ts +25 -0
- package/documents/Endpoint/fragments.ts +9 -0
- package/documents/Endpoint/list.ts +22 -0
- package/documents/Process/fragments.ts +22 -0
- package/documents/Process/get-process-details.ts +73 -0
- package/documents/Process/list.ts +24 -0
- package/documents/ProcessConfig/fragments.ts +116 -0
- package/documents/ProcessConfig/read.ts +35 -0
- package/documents/ProcessExecution/fragments.ts +12 -0
- package/documents/ProcessExecution/list.ts +30 -1
- package/documents/ProcessExecutionDetails/fragments.ts +96 -0
- package/documents/ProcessExecutionDetails/read.ts +12 -0
- package/documents/ProcessScheduleGroup/read.ts +43 -0
- package/documents/ProcessTask/fragments.ts +285 -0
- package/documents/ProcessTask/read.ts +12 -0
- package/documents/ProcessTemplate/fragments.ts +69 -0
- package/documents/ProcessTemplate/list.ts +67 -0
- package/documents/ProcessTemplate/read.ts +12 -0
- package/documents/RunProcess/run.ts +11 -0
- package/package.json +4 -3
- package/src/api/Integrations/queries/get-process.query.ts +12 -12
- package/src/api/Integrations/queries/get-process.server.ts +7 -2
- package/src/api/dashboard/queries/get-process-executions.query.ts +6 -3
- package/src/api/dashboard/queries/get-process-executions.server.ts +1 -1
- package/src/api/execution-details/queries/get-process-execution-details.query.ts +46 -0
- package/src/api/execution-details/queries/get-process-execution-details.server.ts +11 -0
- package/src/api/execution-details/queries/get-process-executions-by-process.query.ts +48 -0
- package/src/api/execution-details/queries/get-process-executions-by-process.server.ts +11 -0
- package/src/api/execution-details/queries/index.ts +2 -0
- package/src/api/process/mutations/copy-process.mutation.ts +48 -0
- package/src/api/process/mutations/copy-process.server.ts +14 -0
- package/src/api/process/mutations/index.ts +2 -0
- package/src/api/process/mutations/run-process.mutation.ts +41 -0
- package/src/api/process/mutations/run-process.server.ts +14 -0
- package/src/api/process/queries/get-process-by-id.query.ts +85 -0
- package/src/api/process/queries/get-process-by-id.server.ts +20 -0
- package/src/api/process/queries/index.ts +4 -0
- package/src/api/process-config/mutation/index.ts +2 -0
- package/src/api/process-config/mutation/process-config-import.mutation.ts +33 -0
- package/src/api/process-config/mutation/process-config-import.server.ts +14 -0
- package/src/api/process-config/mutation/process-config-merge.mutation.ts +33 -0
- package/src/api/process-config/mutation/process-config-merge.server.ts +14 -0
- package/src/api/process-task/queries/get-process-task-by-id.query.ts +45 -0
- package/src/api/process-task/queries/get-process-task-by-id.server.ts +9 -0
- package/src/api/process-task/queries/index.ts +1 -0
- package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +47 -0
- package/src/api/scheduler/mutation/create-process-schedule-group-details.server.ts +14 -0
- package/src/api/scheduler/mutation/index.ts +2 -0
- package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +47 -0
- package/src/api/scheduler/mutation/update-process-schedule-group-details.server.ts +14 -0
- package/src/api/scheduler/queries/get-non-scheduled-processes.query.ts +48 -0
- package/src/api/scheduler/queries/get-non-scheduled-processes.server.ts +11 -0
- package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +6 -3
- package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +3 -3
- package/src/api/scheduler/queries/get-process-schedule.query.ts +6 -3
- package/src/api/scheduler/queries/get-process-schedule.server.ts +3 -3
- package/src/api/scheduler/queries/get-scheduled-processes.query.ts +6 -3
- package/src/api/scheduler/queries/get-scheduled-processes.server.ts +1 -1
- package/src/api/scheduler/queries/index.ts +3 -2
- package/src/api/templates/queries/get-process-template-groups.query.ts +48 -0
- package/src/api/templates/queries/get-process-template-groups.server.ts +11 -0
- package/src/api/templates/queries/get-process-template-records.query.ts +48 -0
- package/src/api/templates/queries/get-process-template-records.server.ts +11 -0
- package/src/api/templates/queries/get-process-template.query.ts +48 -0
- package/src/api/templates/queries/get-process-template.server.ts +9 -0
- package/src/api/templates/queries/get-process-templates.query.ts +45 -0
- package/src/api/templates/queries/get-process-templates.server.ts +9 -0
- package/src/api/templates/queries/index.ts +5 -0
- package/src/api/templates/queries/template-input-search.query.ts +34 -0
- package/src/api/templates/queries/template-input-search.server.ts +35 -0
- package/src/api/templates/queries/types.ts +28 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +32 -5
- package/src/components/button/outlined-icon-button.tsx +2 -2
- package/src/components/core/date-time-popover.tsx +11 -4
- package/src/components/core/drawer-buttons.tsx +52 -0
- package/src/components/core/edited-typography.tsx +1 -1
- package/src/components/core/index.ts +4 -2
- package/src/components/core/loading.tsx +1 -1
- package/src/components/core/status-tag.tsx +97 -0
- package/src/components/core/title-edit.tsx +18 -11
- package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
- package/src/components/dashboard-list/dashboard-list.tsx +19 -15
- package/src/components/data-table/table-header.tsx +5 -7
- package/src/components/data-table/table-pagination.tsx +1 -1
- package/src/components/data-table/table-row.tsx +1 -1
- package/src/components/data-table/table-skeleton.tsx +9 -4
- package/src/components/execution/execution-filter.ts +1 -1
- package/src/components/execution/execution-status-icon.tsx +7 -7
- package/src/components/execution/execution-tag.tsx +12 -77
- package/src/components/execution/index.ts +1 -1
- package/src/components/execution-history-drawer/execution-history-drawer.tsx +203 -0
- package/src/components/execution-history-drawer/executions-card.tsx +85 -0
- package/src/components/execution-history-drawer/index.ts +1 -0
- package/src/components/footer/footer.tsx +10 -6
- package/src/components/header/dashboard-list-header.tsx +12 -7
- package/src/components/header/execution-details-header.tsx +35 -26
- package/src/components/header/header.tsx +10 -3
- package/src/components/header/index.ts +1 -1
- package/src/components/header/integration-details-header.tsx +104 -45
- package/src/components/integration-list/index.ts +2 -1
- package/src/components/integration-list/integration-filter.ts +1 -1
- package/src/components/integration-list/integration-status-icon.tsx +7 -8
- package/src/components/integration-list/integration-tag.tsx +6 -50
- package/src/components/integration-list/list/integration-list-row.tsx +161 -0
- package/src/components/integration-list/list/integration-list-table.tsx +62 -0
- package/src/{pages/integrations/integration-list → components/integration-list/list}/integration-list.tsx +47 -51
- package/src/components/integration-view/animated-svg.tsx +31 -0
- package/src/components/integration-view/edges/default-edge.tsx +1 -1
- package/src/components/integration-view/elk-layout-options.ts +2 -2
- package/src/components/integration-view/elk-types.ts +35 -6
- package/src/components/integration-view/flow-types.tsx +10 -0
- package/src/components/integration-view/integration-view.tsx +990 -55
- package/src/components/integration-view/nodes/empty-node.tsx +65 -0
- package/src/components/integration-view/nodes/entry-node.tsx +98 -4
- package/src/components/integration-view/nodes/execution-entry-node.tsx +107 -0
- package/src/components/integration-view/nodes/execution-task-node.tsx +88 -0
- package/src/components/integration-view/nodes/group-node.tsx +19 -13
- package/src/components/integration-view/nodes/row-node.tsx +19 -0
- package/src/components/integration-view/nodes/task-node.tsx +14 -8
- package/src/components/integration-view/task-icon.tsx +193 -0
- package/src/components/integration-view/temp-data/initialElements.tsx +36 -32
- package/src/components/integration-view/types.ts +2 -2
- package/src/components/layouts/main-layout.tsx +2 -3
- package/src/components/layouts/root-container.tsx +3 -6
- package/src/components/link-cards/link-card.tsx +15 -4
- package/src/components/link-cards/styles.ts +1 -1
- package/src/components/list-filter/date-filter.tsx +4 -3
- package/src/components/list-filter/date-range-filter.tsx +11 -5
- package/src/components/list-filter/index.ts +1 -1
- package/src/components/list-filter/list-filter.tsx +30 -25
- package/src/components/list-filter/multi-select-filter.tsx +11 -10
- package/src/components/list-filter/select-filter.tsx +13 -8
- package/src/components/scheduler/day-selector.tsx +29 -15
- package/src/components/scheduler/day-tag.tsx +14 -51
- package/src/components/scheduler/index.ts +2 -1
- package/src/components/scheduler/schedule-drawer/details-reducer.ts +217 -0
- package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +503 -0
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +136 -99
- package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +94 -0
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-skeleton.tsx +1 -2
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-details.tsx +9 -13
- package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +218 -0
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +6 -25
- package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +116 -0
- package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +130 -0
- package/src/components/scheduler/schedule-filter.ts +1 -1
- package/src/components/scheduler/schedule-icon.tsx +5 -6
- package/src/components/scheduler/schedule-integration-icon.tsx +31 -0
- package/src/components/templates/index.ts +1 -0
- package/src/components/templates/inputs/index.tsx +1351 -0
- package/src/components/templates/template-filter.ts +5 -0
- package/src/components/templates/templates-list/index.ts +1 -0
- package/src/components/templates/templates-list/templates-list-row.tsx +55 -0
- package/src/components/templates/templates-list/templates-list-table.tsx +58 -0
- package/src/components/templates/templates-list/templates-list.tsx +253 -0
- package/src/components/templates/types.tsx +75 -0
- package/src/components/templates/wizard.tsx +689 -0
- package/src/hooks/use-breadcrumbs.ts +1 -1
- package/src/hooks/use-recurrence.tsx +1 -2
- package/src/pages/dashboard/dashboard-link-cards.tsx +8 -11
- package/src/pages/dashboard/dashboard-list-sections.tsx +7 -9
- package/src/pages/dashboard/dashboard.tsx +1 -2
- package/src/pages/execution-details/execution-details.tsx +211 -14
- package/src/pages/execution-details/task-execution-details.tsx +160 -0
- package/src/pages/execution-details/task-execution-drawer.tsx +54 -0
- package/src/pages/executions/executions-list/executions-list-row.tsx +21 -27
- package/src/pages/executions/executions-list/executions-list-table.tsx +28 -35
- package/src/pages/executions/executions-list/executions-list.tsx +24 -18
- package/src/pages/executions/executions.tsx +11 -15
- package/src/pages/integration-create/index.ts +1 -0
- package/src/pages/integration-create/integration-create.tsx +174 -0
- package/src/pages/integration-create/pre-creation-step.tsx +12 -0
- package/src/pages/integration-create/select-step.tsx +105 -0
- package/src/pages/integration-create/template-list-step.tsx +77 -0
- package/src/pages/integration-create/wizard-step.tsx +50 -0
- package/src/pages/integration-details/import-process/copy-tasks-list.tsx +265 -0
- package/src/pages/integration-details/import-process/copy-tasks-row.tsx +77 -0
- package/src/pages/integration-details/import-process/import-confirm.tsx +61 -0
- package/src/pages/integration-details/import-process/import-drawer.tsx +48 -0
- package/src/pages/integration-details/import-process/import-process-reducer.ts +90 -0
- package/src/pages/integration-details/import-process/import-process.tsx +149 -0
- package/src/pages/integration-details/index.ts +1 -0
- package/src/pages/integration-details/integration-details.tsx +221 -0
- package/src/pages/integration-details/task-drawer/add-task.tsx +120 -0
- package/src/pages/integration-details/task-drawer/edit-task.tsx +175 -0
- package/src/pages/integration-details/task-drawer/task-drawer.tsx +139 -0
- package/src/pages/integration-details/task-drawer/task-reducer.ts +73 -0
- package/src/pages/integrations/integrations.tsx +11 -14
- package/src/pages/scheduler/scheduler.tsx +12 -24
- package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +27 -37
- package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +27 -42
- package/src/pages/scheduler/schedules-list/schedules-list.tsx +48 -21
- package/src/utils/date-functions.ts +69 -0
- package/src/utils/slugify.ts +3 -0
- package/tsconfig.json +12 -4
- package/src/hooks/use-timestamp.tsx +0 -25
- package/src/pages/integrations/integration-list/integration-list-row.tsx +0 -147
- package/src/pages/integrations/integration-list/integration-list-table.tsx +0 -78
- package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +0 -227
- package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +0 -77
- package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +0 -72
- package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +0 -103
- package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +0 -101
- package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +0 -93
- /package/src/{pages/integrations/integration-list → components/integration-list/list}/index.ts +0 -0
- /package/src/{pages → components}/scheduler/schedule-drawer/edited/edited-types.ts +0 -0
- /package/src/{pages → components}/scheduler/schedule-drawer/edited/index.ts +0 -0
- /package/src/{pages → components}/scheduler/schedule-drawer/index.ts +0 -0
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
import { redirect, RedirectType } from "next/navigation";
|
|
3
|
-
|
|
4
|
-
// MUI
|
|
5
|
-
import { Theme, useTheme } from "@mui/material";
|
|
6
|
-
import { Box, Stack, Typography, Popover } from "@mui/material";
|
|
7
|
-
import { RemoveRedEye } from "@mui/icons-material";
|
|
8
|
-
import { SxProps } from "@mui/material";
|
|
9
|
-
|
|
10
|
-
// Custom components
|
|
11
|
-
import {
|
|
12
|
-
StyledTableCell,
|
|
13
|
-
StyledTableRow,
|
|
14
|
-
StyledIconButton,
|
|
15
|
-
} from "@evenicanpm/admin-integrate/components/data-table/table-row";
|
|
16
|
-
import {
|
|
17
|
-
IntegrationTag,
|
|
18
|
-
IntegrationStatusIcon,
|
|
19
|
-
} from "@evenicanpm/admin-integrate/components/integration-list";
|
|
20
|
-
|
|
21
|
-
// Hooks
|
|
22
|
-
import useTimestamp from "@evenicanpm/admin-integrate/hooks/use-timestamp";
|
|
23
|
-
|
|
24
|
-
// Types
|
|
25
|
-
import { executionItem } from "./integration-list";
|
|
26
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
27
|
-
import { TableCellProps } from "@mui/material";
|
|
28
|
-
|
|
29
|
-
interface Props {
|
|
30
|
-
item: executionItem;
|
|
31
|
-
heading: Head[]; // for alignment
|
|
32
|
-
sx?: SxProps;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const IntegrationListRow: React.FC<Props> = (props: Props) => {
|
|
36
|
-
const theme = useTheme();
|
|
37
|
-
const styles = getStyles(theme);
|
|
38
|
-
|
|
39
|
-
// e.g. "xx days ago"
|
|
40
|
-
const time = useTimestamp(props.item.modified);
|
|
41
|
-
const localTime = new Date(props.item.modified).toString();
|
|
42
|
-
|
|
43
|
-
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
44
|
-
const open = Boolean(anchorEl);
|
|
45
|
-
|
|
46
|
-
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => {
|
|
47
|
-
setAnchorEl(event.currentTarget);
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const handlePopoverClose = () => {
|
|
51
|
-
setAnchorEl(null);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
const handleRedirect = () => {
|
|
55
|
-
redirect(
|
|
56
|
-
`/e4integrate/integration/${props.item.id}?IntegrationId=${props.item.id}`,
|
|
57
|
-
RedirectType.push,
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<StyledTableRow sx={props.sx}>
|
|
63
|
-
<StyledTableCell
|
|
64
|
-
align={props.heading[0].align as TableCellProps["align"]}
|
|
65
|
-
width={props.heading[0].width}
|
|
66
|
-
>
|
|
67
|
-
<Stack spacing={1} direction="row">
|
|
68
|
-
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
69
|
-
<IntegrationStatusIcon processIcon={props.item.processIcon} />
|
|
70
|
-
</Box>
|
|
71
|
-
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
72
|
-
<Typography>{props.item.name}</Typography>
|
|
73
|
-
</Box>
|
|
74
|
-
</Stack>
|
|
75
|
-
</StyledTableCell>
|
|
76
|
-
<StyledTableCell
|
|
77
|
-
align={props.heading[1].align as TableCellProps["align"]}
|
|
78
|
-
width={props.heading[1].width}
|
|
79
|
-
>
|
|
80
|
-
<Typography>{props.item.id}</Typography>
|
|
81
|
-
</StyledTableCell>
|
|
82
|
-
<StyledTableCell
|
|
83
|
-
align={props.heading[1].align as TableCellProps["align"]}
|
|
84
|
-
width={props.heading[1].width}
|
|
85
|
-
>
|
|
86
|
-
<IntegrationTag
|
|
87
|
-
process={{
|
|
88
|
-
isScheduled: props.item.isScheduled,
|
|
89
|
-
isTriggered: props.item.isTriggered,
|
|
90
|
-
}}
|
|
91
|
-
/>
|
|
92
|
-
</StyledTableCell>
|
|
93
|
-
<StyledTableCell
|
|
94
|
-
align={props.heading[2].align as TableCellProps["align"]}
|
|
95
|
-
width={props.heading[2].width}
|
|
96
|
-
sx={styles.timeCell}
|
|
97
|
-
>
|
|
98
|
-
<Typography
|
|
99
|
-
onMouseEnter={handlePopoverOpen}
|
|
100
|
-
onMouseLeave={handlePopoverClose}
|
|
101
|
-
>
|
|
102
|
-
{time}
|
|
103
|
-
</Typography>
|
|
104
|
-
<Popover
|
|
105
|
-
sx={{ pointerEvents: "none" }}
|
|
106
|
-
open={open}
|
|
107
|
-
anchorEl={anchorEl}
|
|
108
|
-
anchorOrigin={{
|
|
109
|
-
vertical: "bottom",
|
|
110
|
-
horizontal: "center",
|
|
111
|
-
}}
|
|
112
|
-
transformOrigin={{
|
|
113
|
-
vertical: "top",
|
|
114
|
-
horizontal: "center",
|
|
115
|
-
}}
|
|
116
|
-
onClose={handlePopoverClose}
|
|
117
|
-
disableRestoreFocus
|
|
118
|
-
>
|
|
119
|
-
<Box sx={styles.popover}>
|
|
120
|
-
<Typography>{localTime}</Typography>
|
|
121
|
-
</Box>
|
|
122
|
-
</Popover>
|
|
123
|
-
</StyledTableCell>
|
|
124
|
-
<StyledTableCell
|
|
125
|
-
align={props.heading[3].align as TableCellProps["align"]}
|
|
126
|
-
width={props.heading[3].width}
|
|
127
|
-
>
|
|
128
|
-
<StyledIconButton onClick={handleRedirect}>
|
|
129
|
-
<RemoveRedEye />
|
|
130
|
-
</StyledIconButton>
|
|
131
|
-
</StyledTableCell>
|
|
132
|
-
</StyledTableRow>
|
|
133
|
-
);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const getStyles = (theme: Theme) => {
|
|
137
|
-
return {
|
|
138
|
-
timeCell: {
|
|
139
|
-
cursor: "default",
|
|
140
|
-
},
|
|
141
|
-
popover: {
|
|
142
|
-
padding: theme.spacing(1),
|
|
143
|
-
},
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
export default IntegrationListRow;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
// Types
|
|
4
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
5
|
-
import { Item } from "./integration-list";
|
|
6
|
-
|
|
7
|
-
// API
|
|
8
|
-
import { ProcessExecutionInput } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
9
|
-
|
|
10
|
-
// MUI
|
|
11
|
-
import { Theme, useTheme } from "@mui/material";
|
|
12
|
-
import { TableContainer, Table, TableBody } from "@mui/material";
|
|
13
|
-
import { SxProps } from "@mui/material";
|
|
14
|
-
|
|
15
|
-
// Custom components
|
|
16
|
-
import { TableHeader } from "@evenicanpm/admin-integrate/components/data-table";
|
|
17
|
-
|
|
18
|
-
// Local components
|
|
19
|
-
import IntegrationListRow from "./integration-list-row";
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
heading: Head[];
|
|
23
|
-
items: Item[];
|
|
24
|
-
input: ProcessExecutionInput;
|
|
25
|
-
setInput: (newInput: ProcessExecutionInput) => void;
|
|
26
|
-
rowSx?: SxProps;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default function IntegrationListTable(props: Props) {
|
|
30
|
-
const theme = useTheme();
|
|
31
|
-
const styles = getStyles(theme);
|
|
32
|
-
|
|
33
|
-
const handleRequestSort = (property: string) => {
|
|
34
|
-
const current = props.input.sort;
|
|
35
|
-
if (property === current) {
|
|
36
|
-
props.setInput({
|
|
37
|
-
...props.input,
|
|
38
|
-
sortDesc: !props.input.sortDesc,
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
props.setInput({
|
|
42
|
-
...props.input,
|
|
43
|
-
sort: property,
|
|
44
|
-
sortDesc: false,
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<>
|
|
51
|
-
<TableContainer>
|
|
52
|
-
<Table>
|
|
53
|
-
<TableHeader
|
|
54
|
-
heading={props.heading}
|
|
55
|
-
orderBy={props.input.sort}
|
|
56
|
-
order={props.input.sortDesc ? "desc" : "asc"}
|
|
57
|
-
onRequestSort={handleRequestSort}
|
|
58
|
-
rowSx={props.rowSx}
|
|
59
|
-
/>
|
|
60
|
-
<TableBody>
|
|
61
|
-
{props.items.map((item, index) => (
|
|
62
|
-
<IntegrationListRow
|
|
63
|
-
key={index}
|
|
64
|
-
item={item}
|
|
65
|
-
heading={props.heading}
|
|
66
|
-
sx={props.rowSx}
|
|
67
|
-
/>
|
|
68
|
-
))}
|
|
69
|
-
</TableBody>
|
|
70
|
-
</Table>
|
|
71
|
-
</TableContainer>
|
|
72
|
-
</>
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const getStyles = (theme: Theme) => {
|
|
77
|
-
return {};
|
|
78
|
-
};
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
4
|
-
// Dnd
|
|
5
|
-
import {
|
|
6
|
-
DndContext,
|
|
7
|
-
closestCenter,
|
|
8
|
-
KeyboardSensor,
|
|
9
|
-
PointerSensor,
|
|
10
|
-
useSensor,
|
|
11
|
-
useSensors,
|
|
12
|
-
DragEndEvent,
|
|
13
|
-
} from "@dnd-kit/core";
|
|
14
|
-
import {
|
|
15
|
-
arrayMove,
|
|
16
|
-
SortableContext,
|
|
17
|
-
sortableKeyboardCoordinates,
|
|
18
|
-
verticalListSortingStrategy,
|
|
19
|
-
} from "@dnd-kit/sortable";
|
|
20
|
-
import { restrictToFirstScrollableAncestor } from "@dnd-kit/modifiers";
|
|
21
|
-
|
|
22
|
-
// Api
|
|
23
|
-
import {
|
|
24
|
-
GetProcessScheduleGroupDetailsQuery,
|
|
25
|
-
ProcessScheduleGroupDetailsUpdate,
|
|
26
|
-
GetProcessScheduleByIdQuery,
|
|
27
|
-
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
28
|
-
|
|
29
|
-
// MUI
|
|
30
|
-
import { Theme, useTheme } from "@mui/material";
|
|
31
|
-
import {
|
|
32
|
-
Box,
|
|
33
|
-
Typography,
|
|
34
|
-
Stack,
|
|
35
|
-
TableContainer,
|
|
36
|
-
Table,
|
|
37
|
-
TableBody,
|
|
38
|
-
Button,
|
|
39
|
-
} from "@mui/material";
|
|
40
|
-
import { Add } from "@mui/icons-material";
|
|
41
|
-
|
|
42
|
-
// Custom components
|
|
43
|
-
import { TableHeader } from "@evenicanpm/admin-integrate/components/data-table";
|
|
44
|
-
import { EditedTypography } from "@evenicanpm/admin-integrate/components/core";
|
|
45
|
-
|
|
46
|
-
// Local components
|
|
47
|
-
import SortableIntegrationRow from "./sortable-integration-row";
|
|
48
|
-
|
|
49
|
-
// Types
|
|
50
|
-
import { Edited } from "./edited";
|
|
51
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
52
|
-
|
|
53
|
-
export type Process = {
|
|
54
|
-
id: string;
|
|
55
|
-
sort: number;
|
|
56
|
-
name: string;
|
|
57
|
-
processIcon: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
interface Props {
|
|
61
|
-
data: GetProcessScheduleGroupDetailsQuery | GetProcessScheduleByIdQuery;
|
|
62
|
-
details: ProcessScheduleGroupDetailsUpdate;
|
|
63
|
-
setDetails: (newDetails: ProcessScheduleGroupDetailsUpdate) => void;
|
|
64
|
-
edited: Edited;
|
|
65
|
-
setEdited: (newEdited: Edited) => void;
|
|
66
|
-
readOnly?: boolean;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export default function ScheduleDetailsIntegrations(props: Props) {
|
|
70
|
-
const t = useTranslations("Integrate.Scheduler");
|
|
71
|
-
|
|
72
|
-
const theme = useTheme();
|
|
73
|
-
const styles = getStyles(theme);
|
|
74
|
-
|
|
75
|
-
const [items, setItems] = useState<Process[]>([]);
|
|
76
|
-
|
|
77
|
-
const sensors = useSensors(
|
|
78
|
-
useSensor(PointerSensor),
|
|
79
|
-
useSensor(KeyboardSensor, {
|
|
80
|
-
coordinateGetter: sortableKeyboardCoordinates,
|
|
81
|
-
}),
|
|
82
|
-
);
|
|
83
|
-
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (props.data) {
|
|
86
|
-
if ("processScheduleGroupDetails" in props.data) {
|
|
87
|
-
setItems(
|
|
88
|
-
(props.data.processScheduleGroupDetails?.processSchedule
|
|
89
|
-
?.processes as Process[]) || [],
|
|
90
|
-
);
|
|
91
|
-
} else if ("processScheduleById" in props.data) {
|
|
92
|
-
setItems([props.data.processScheduleById?.process as Process]);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}, [props.data]);
|
|
96
|
-
|
|
97
|
-
function handleDragEnd(event: DragEndEvent) {
|
|
98
|
-
const { active, over } = event;
|
|
99
|
-
|
|
100
|
-
if (over && active.id !== over.id) {
|
|
101
|
-
setItems((items) => {
|
|
102
|
-
const oldIndex = items.findIndex((process) => process.id === active.id);
|
|
103
|
-
const newIndex = items.findIndex((process) => process.id === over.id);
|
|
104
|
-
|
|
105
|
-
return arrayMove(items, oldIndex, newIndex);
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
props.setDetails({
|
|
109
|
-
...props.details,
|
|
110
|
-
processes: items,
|
|
111
|
-
});
|
|
112
|
-
if (!props.edited.integrations) {
|
|
113
|
-
props.setEdited({
|
|
114
|
-
...props.edited,
|
|
115
|
-
integrations: true,
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// @ts-ignore
|
|
122
|
-
const handleDeleteIntegration = (item: Process) => {
|
|
123
|
-
// TODO: delete integration
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
let heading: Head[] = [
|
|
127
|
-
{
|
|
128
|
-
id: "drag",
|
|
129
|
-
label: "",
|
|
130
|
-
align: "right",
|
|
131
|
-
width: "1%",
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
id: "name",
|
|
135
|
-
label: t("integration"),
|
|
136
|
-
align: "left",
|
|
137
|
-
width: "92%",
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
id: "actions",
|
|
141
|
-
label: t("ListHeader.actions"),
|
|
142
|
-
align: "right",
|
|
143
|
-
width: "7%",
|
|
144
|
-
},
|
|
145
|
-
];
|
|
146
|
-
|
|
147
|
-
return (
|
|
148
|
-
<Box sx={styles.main}>
|
|
149
|
-
{items.length > 0 ? (
|
|
150
|
-
<>
|
|
151
|
-
<Box display="flex" justifyContent="space-between">
|
|
152
|
-
<Stack direction="row" spacing={1} alignItems="center">
|
|
153
|
-
<Typography variant="body1">
|
|
154
|
-
{t("scheduledIntegrations")}
|
|
155
|
-
</Typography>
|
|
156
|
-
<EditedTypography edited={props.edited.integrations} />
|
|
157
|
-
</Stack>
|
|
158
|
-
{!props.readOnly && (
|
|
159
|
-
<Button
|
|
160
|
-
color="info"
|
|
161
|
-
variant="contained"
|
|
162
|
-
sx={{ fontSize: theme.typography.caption.fontSize }}
|
|
163
|
-
startIcon={<Add />}
|
|
164
|
-
>
|
|
165
|
-
Add
|
|
166
|
-
</Button>
|
|
167
|
-
)}
|
|
168
|
-
</Box>
|
|
169
|
-
<Box sx={styles.list}>
|
|
170
|
-
<DndContext
|
|
171
|
-
sensors={sensors}
|
|
172
|
-
collisionDetection={closestCenter}
|
|
173
|
-
onDragEnd={handleDragEnd}
|
|
174
|
-
modifiers={[restrictToFirstScrollableAncestor]}
|
|
175
|
-
>
|
|
176
|
-
<SortableContext
|
|
177
|
-
items={items}
|
|
178
|
-
strategy={verticalListSortingStrategy}
|
|
179
|
-
>
|
|
180
|
-
<TableContainer>
|
|
181
|
-
<Table>
|
|
182
|
-
<TableHeader
|
|
183
|
-
heading={heading}
|
|
184
|
-
orderBy={"sort"}
|
|
185
|
-
order={"asc"}
|
|
186
|
-
/>
|
|
187
|
-
<TableBody>
|
|
188
|
-
{items.map((item) => (
|
|
189
|
-
<SortableIntegrationRow
|
|
190
|
-
key={item.id}
|
|
191
|
-
item={item}
|
|
192
|
-
heading={heading}
|
|
193
|
-
handleDeleteIntegration={handleDeleteIntegration}
|
|
194
|
-
readOnly={props.readOnly}
|
|
195
|
-
/>
|
|
196
|
-
))}
|
|
197
|
-
</TableBody>
|
|
198
|
-
</Table>
|
|
199
|
-
</TableContainer>
|
|
200
|
-
</SortableContext>
|
|
201
|
-
</DndContext>
|
|
202
|
-
</Box>
|
|
203
|
-
</>
|
|
204
|
-
) : (
|
|
205
|
-
<></>
|
|
206
|
-
)}
|
|
207
|
-
</Box>
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
const getStyles = (theme: Theme) => {
|
|
212
|
-
return {
|
|
213
|
-
main: {
|
|
214
|
-
padding: theme.spacing(2, 3),
|
|
215
|
-
|
|
216
|
-
maxHeight: "50vh",
|
|
217
|
-
overflow: "auto",
|
|
218
|
-
},
|
|
219
|
-
list: {
|
|
220
|
-
margin: theme.spacing(1, 0),
|
|
221
|
-
borderColor: theme.palette.grey[200],
|
|
222
|
-
borderWidth: theme.spacing(0.25),
|
|
223
|
-
borderStyle: "solid",
|
|
224
|
-
borderRadius: "1%",
|
|
225
|
-
},
|
|
226
|
-
};
|
|
227
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
// Api
|
|
4
|
-
import { ProcessScheduleGroupDetailsUpdate } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
5
|
-
|
|
6
|
-
// MUI
|
|
7
|
-
import { Theme, useTheme } from "@mui/material";
|
|
8
|
-
import { Box, Stack } from "@mui/material";
|
|
9
|
-
|
|
10
|
-
// Custom components
|
|
11
|
-
import { ScheduleIcon } from "@evenicanpm/admin-integrate/components/scheduler";
|
|
12
|
-
import {
|
|
13
|
-
TitleEdit,
|
|
14
|
-
EditedTypography,
|
|
15
|
-
} from "@evenicanpm/admin-integrate/components/core";
|
|
16
|
-
|
|
17
|
-
// Types
|
|
18
|
-
import { Edited } from "./edited";
|
|
19
|
-
|
|
20
|
-
interface Props {
|
|
21
|
-
details: ProcessScheduleGroupDetailsUpdate;
|
|
22
|
-
setDetails: (newDetails: ProcessScheduleGroupDetailsUpdate) => void;
|
|
23
|
-
edited: Edited;
|
|
24
|
-
setEdited: (newEdited: Edited) => void;
|
|
25
|
-
readOnly?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default function ScheduleDetailsName(props: Props) {
|
|
29
|
-
const theme = useTheme();
|
|
30
|
-
const styles = getStyles(theme);
|
|
31
|
-
|
|
32
|
-
const onConfirm = (input: string) => {
|
|
33
|
-
if (input !== props.details.name) {
|
|
34
|
-
props.setDetails({
|
|
35
|
-
...props.details,
|
|
36
|
-
name: input,
|
|
37
|
-
code: input.replaceAll(" ", "_").toLowerCase(),
|
|
38
|
-
});
|
|
39
|
-
props.setEdited({
|
|
40
|
-
...props.edited,
|
|
41
|
-
name: true,
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<Box sx={styles.main}>
|
|
48
|
-
<Stack direction="row" spacing={1} sx={styles.stack}>
|
|
49
|
-
<Box display="flex" justifyContent="center" alignItems="center">
|
|
50
|
-
<ScheduleIcon
|
|
51
|
-
isDisabled={props.details.isDisabled || false}
|
|
52
|
-
isLegacy={props.readOnly || false}
|
|
53
|
-
enablePopover
|
|
54
|
-
/>
|
|
55
|
-
</Box>
|
|
56
|
-
<TitleEdit
|
|
57
|
-
title={props.details.name || ""}
|
|
58
|
-
onConfirm={onConfirm}
|
|
59
|
-
readOnly={props.readOnly}
|
|
60
|
-
fullWidth
|
|
61
|
-
/>
|
|
62
|
-
</Stack>
|
|
63
|
-
<EditedTypography edited={props.edited.name} />
|
|
64
|
-
</Box>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const getStyles = (theme: Theme) => {
|
|
69
|
-
return {
|
|
70
|
-
main: {
|
|
71
|
-
marginBottom: theme.spacing(2),
|
|
72
|
-
},
|
|
73
|
-
stack: {
|
|
74
|
-
minHeight: theme.spacing(7),
|
|
75
|
-
},
|
|
76
|
-
};
|
|
77
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { useTranslations } from "next-intl";
|
|
2
|
-
|
|
3
|
-
// MUI
|
|
4
|
-
import { Theme, useTheme } from "@mui/material";
|
|
5
|
-
import { Box, IconButton, Button, Stack } from "@mui/material";
|
|
6
|
-
import {
|
|
7
|
-
KeyboardDoubleArrowRightOutlined,
|
|
8
|
-
Clear,
|
|
9
|
-
Save,
|
|
10
|
-
} from "@mui/icons-material";
|
|
11
|
-
|
|
12
|
-
// Custom components
|
|
13
|
-
import { OutlinedIconButton } from "@evenicanpm/admin-integrate/components/button";
|
|
14
|
-
|
|
15
|
-
// Types
|
|
16
|
-
import { Edited } from "./edited";
|
|
17
|
-
|
|
18
|
-
interface Props {
|
|
19
|
-
handleClose: () => void;
|
|
20
|
-
handleSave: () => void;
|
|
21
|
-
edited: Edited;
|
|
22
|
-
readOnly?: boolean;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default function ScheduleDrawerButtons(props: Props) {
|
|
26
|
-
const t = useTranslations("Integrate.Scheduler");
|
|
27
|
-
|
|
28
|
-
const theme = useTheme();
|
|
29
|
-
const styles = getStyles(theme);
|
|
30
|
-
|
|
31
|
-
const isEdited = Object.values(props.edited).some((value) => value);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<Box sx={styles.buttons} display="flex" justifyContent="space-between">
|
|
35
|
-
<IconButton onClick={props.handleClose}>
|
|
36
|
-
<KeyboardDoubleArrowRightOutlined />
|
|
37
|
-
</IconButton>
|
|
38
|
-
<Stack spacing={1} direction="row">
|
|
39
|
-
{!props.readOnly && (
|
|
40
|
-
<Button
|
|
41
|
-
variant="contained"
|
|
42
|
-
color="info"
|
|
43
|
-
startIcon={<Save />}
|
|
44
|
-
onClick={props.handleSave}
|
|
45
|
-
disabled={!isEdited}
|
|
46
|
-
>
|
|
47
|
-
{t("save")}
|
|
48
|
-
</Button>
|
|
49
|
-
)}
|
|
50
|
-
<OutlinedIconButton onClick={props.handleClose} sx={styles.closeButton}>
|
|
51
|
-
<Clear />
|
|
52
|
-
</OutlinedIconButton>
|
|
53
|
-
</Stack>
|
|
54
|
-
</Box>
|
|
55
|
-
);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const getStyles = (theme: Theme) => {
|
|
59
|
-
return {
|
|
60
|
-
buttons: {
|
|
61
|
-
padding: theme.spacing(2),
|
|
62
|
-
backgroundColor: "grey.100",
|
|
63
|
-
},
|
|
64
|
-
closeButton: {
|
|
65
|
-
backgroundColor: "error.main",
|
|
66
|
-
"&:hover": {
|
|
67
|
-
backgroundColor: "error.500",
|
|
68
|
-
},
|
|
69
|
-
color: "white",
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
};
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
|
|
3
|
-
// Api
|
|
4
|
-
import {
|
|
5
|
-
GetProcessScheduleGroupDetailsQuery,
|
|
6
|
-
ProcessScheduleGroupDetailsUpdate,
|
|
7
|
-
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
8
|
-
import { getProcessScheduleGroupDetails } from "@evenicanpm/admin-integrate/api/scheduler/queries";
|
|
9
|
-
|
|
10
|
-
// Mui
|
|
11
|
-
import { Divider } from "@mui/material";
|
|
12
|
-
|
|
13
|
-
// Local components
|
|
14
|
-
import ScheduleDrawerButtons from "./schedule-drawer-buttons";
|
|
15
|
-
import ScheduleDetails from "./schedule-details";
|
|
16
|
-
import ScheduleDetailsIntegrations from "./schedule-details-integrations";
|
|
17
|
-
import ScheduleDetailsSkeleton from "./schedule-details-skeleton";
|
|
18
|
-
|
|
19
|
-
// Types
|
|
20
|
-
import { DrawerOpen } from "../scheduler";
|
|
21
|
-
import { Edited } from "./edited";
|
|
22
|
-
|
|
23
|
-
interface Props {
|
|
24
|
-
drawerOpen: DrawerOpen;
|
|
25
|
-
details: ProcessScheduleGroupDetailsUpdate | null;
|
|
26
|
-
setDetails: (newDetails: ProcessScheduleGroupDetailsUpdate | null) => void;
|
|
27
|
-
edited: Edited;
|
|
28
|
-
setEdited: (newEdited: Edited) => void;
|
|
29
|
-
handleClose: () => void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default function ScheduleDrawerGroup(props: Props) {
|
|
33
|
-
const styles = getStyles();
|
|
34
|
-
|
|
35
|
-
const { data } = getProcessScheduleGroupDetails.useData({
|
|
36
|
-
id: props.drawerOpen.id,
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
useEffect(() => {
|
|
40
|
-
if (data) {
|
|
41
|
-
const typedData = data as GetProcessScheduleGroupDetailsQuery;
|
|
42
|
-
if (typedData.processScheduleGroupDetails) {
|
|
43
|
-
const fetchedDetails = typedData.processScheduleGroupDetails;
|
|
44
|
-
const processes = fetchedDetails.processSchedule?.processes || [];
|
|
45
|
-
const newDetails = {
|
|
46
|
-
...fetchedDetails,
|
|
47
|
-
processes:
|
|
48
|
-
processes.map((pr) => ({
|
|
49
|
-
id: pr?.id || "",
|
|
50
|
-
sort: pr?.sort || 0,
|
|
51
|
-
})) || [],
|
|
52
|
-
};
|
|
53
|
-
delete newDetails.processSchedule;
|
|
54
|
-
|
|
55
|
-
props.setDetails(newDetails as ProcessScheduleGroupDetailsUpdate);
|
|
56
|
-
} else {
|
|
57
|
-
props.setDetails(null);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, [data]);
|
|
61
|
-
|
|
62
|
-
const handleSave = () => {};
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<>
|
|
66
|
-
<ScheduleDrawerButtons
|
|
67
|
-
handleClose={props.handleClose}
|
|
68
|
-
handleSave={handleSave}
|
|
69
|
-
edited={props.edited}
|
|
70
|
-
/>
|
|
71
|
-
<Divider sx={styles.divider} />
|
|
72
|
-
{props.details ? (
|
|
73
|
-
<>
|
|
74
|
-
<ScheduleDetails
|
|
75
|
-
id={props.drawerOpen.id}
|
|
76
|
-
details={props.details}
|
|
77
|
-
setDetails={props.setDetails}
|
|
78
|
-
edited={props.edited}
|
|
79
|
-
setEdited={props.setEdited}
|
|
80
|
-
/>
|
|
81
|
-
<Divider sx={styles.divider} />
|
|
82
|
-
<ScheduleDetailsIntegrations
|
|
83
|
-
data={data as GetProcessScheduleGroupDetailsQuery}
|
|
84
|
-
details={props.details}
|
|
85
|
-
setDetails={props.setDetails}
|
|
86
|
-
edited={props.edited}
|
|
87
|
-
setEdited={props.setEdited}
|
|
88
|
-
/>
|
|
89
|
-
</>
|
|
90
|
-
) : (
|
|
91
|
-
<ScheduleDetailsSkeleton />
|
|
92
|
-
)}
|
|
93
|
-
</>
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
const getStyles = () => {
|
|
98
|
-
return {
|
|
99
|
-
divider: {
|
|
100
|
-
borderColor: "grey.400",
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
};
|