@evenicanpm/admin-integrate 1.2.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +30 -0
- package/documents/Process/fragments.ts +22 -0
- package/documents/Process/get-process-details.ts +72 -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/ProcessExport/read.ts +108 -0
- package/documents/ProcessScheduleGroup/read.ts +43 -0
- package/documents/ProcessTask/fragments.ts +288 -0
- package/documents/ProcessTask/read.ts +12 -0
- package/documents/ProcessTemplate/fragments.ts +74 -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/configuration/queries/configuration-export.query.ts +48 -0
- package/src/api/configuration/queries/configuration-export.server.ts +9 -0
- package/src/api/configuration/queries/index.ts +1 -0
- 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 +45 -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 +42 -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 +46 -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 +39 -0
- package/src/api/templates/queries/template-input-search.server.ts +42 -0
- package/src/api/templates/queries/types.ts +34 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +33 -6
- package/src/components/button/outlined-icon-button.tsx +2 -2
- package/src/components/core/date-time-popover.tsx +12 -5
- package/src/components/core/drawer-buttons.tsx +52 -0
- package/src/components/core/edited-typography.tsx +2 -2
- 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 +31 -22
- package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
- package/src/components/dashboard-list/dashboard-list.tsx +20 -16
- package/src/components/data-table/table-header.tsx +6 -8
- 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 +10 -5
- 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 +202 -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 +108 -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 +2 -6
- 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 +12 -0
- package/src/components/integration-view/integration-view.tsx +562 -56
- package/src/components/integration-view/nodes/add-node.tsx +20 -0
- 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 +33 -13
- package/src/components/integration-view/nodes/row-node.tsx +19 -0
- package/src/components/integration-view/nodes/task-node.tsx +50 -16
- package/src/components/integration-view/task-icon.tsx +193 -0
- package/src/components/integration-view/temp-data/initialElements.tsx +34 -32
- package/src/components/integration-view/types.ts +2 -2
- package/src/components/integration-view/utils/mapping.ts +404 -0
- package/src/components/layouts/main-layout.tsx +3 -4
- package/src/components/layouts/root-container.tsx +5 -11
- 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 +7 -4
- package/src/components/list-filter/date-range-filter.tsx +15 -7
- package/src/components/list-filter/index.ts +1 -1
- package/src/components/list-filter/list-filter.tsx +31 -26
- package/src/components/list-filter/multi-select-filter.tsx +11 -10
- package/src/components/list-filter/select-filter.tsx +23 -12
- 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 +501 -0
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +137 -100
- 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 +10 -14
- package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +214 -0
- package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +7 -26
- 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 +1392 -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 +76 -0
- package/src/components/templates/wizard.tsx +737 -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 +8 -10
- package/src/pages/dashboard/dashboard.tsx +1 -2
- package/src/pages/execution-details/execution-details.tsx +212 -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 +29 -36
- 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 +216 -0
- package/src/pages/integration-create/pre-creation-step.tsx +84 -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 +51 -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 +468 -0
- package/src/pages/integration-details/task-drawer/add-task.tsx +172 -0
- package/src/pages/integration-details/task-drawer/edit-task.tsx +161 -0
- package/src/pages/integration-details/task-drawer/task-drawer.tsx +157 -0
- package/src/pages/integration-details/task-drawer/task-reducer.ts +103 -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 +28 -43
- 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,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
|
-
};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { useTranslations } from "next-intl";
|
|
2
|
-
import React, { useState } from "react";
|
|
3
|
-
|
|
4
|
-
// API
|
|
5
|
-
import {
|
|
6
|
-
ProcessScheduleGroupDetailsUpdate,
|
|
7
|
-
GetProcessScheduleByIdQuery,
|
|
8
|
-
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
9
|
-
|
|
10
|
-
// MUI
|
|
11
|
-
import { Theme, useTheme } from "@mui/material";
|
|
12
|
-
import { Drawer, Box } from "@mui/material";
|
|
13
|
-
|
|
14
|
-
// Local components
|
|
15
|
-
import ScheduleDrawerGroup from "./schedule-drawer-group";
|
|
16
|
-
import ScheduleDrawerLegacy from "./schedule-drawer-legacy";
|
|
17
|
-
|
|
18
|
-
// Types
|
|
19
|
-
import { Edited, initialEdited } from "./edited";
|
|
20
|
-
import { DrawerOpen } from "../scheduler";
|
|
21
|
-
|
|
22
|
-
export type ProcessScheduleById =
|
|
23
|
-
GetProcessScheduleByIdQuery["processScheduleById"];
|
|
24
|
-
|
|
25
|
-
interface Props {
|
|
26
|
-
drawerOpen: DrawerOpen | null;
|
|
27
|
-
setDrawerOpen: (drawerOpen: DrawerOpen | null) => void;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default function ScheduleDrawer(props: Props) {
|
|
31
|
-
const t = useTranslations("Integrate.Scheduler");
|
|
32
|
-
|
|
33
|
-
const theme = useTheme();
|
|
34
|
-
const styles = getStyles(theme);
|
|
35
|
-
|
|
36
|
-
const [edited, setEdited] = useState<Edited>(initialEdited);
|
|
37
|
-
|
|
38
|
-
const [detailsGroup, setDetailsGroup] =
|
|
39
|
-
useState<ProcessScheduleGroupDetailsUpdate | null>(null);
|
|
40
|
-
const [detailsLegacy, setDetailsLegacy] =
|
|
41
|
-
useState<ProcessScheduleById | null>(null);
|
|
42
|
-
|
|
43
|
-
const handleClose = () => {
|
|
44
|
-
const isEdited = Object.values(edited).some((value) => value);
|
|
45
|
-
if (isEdited) {
|
|
46
|
-
const confirmClose = confirm(t("unsavedChanges"));
|
|
47
|
-
if (!confirmClose) return;
|
|
48
|
-
}
|
|
49
|
-
setDetailsGroup(null);
|
|
50
|
-
setDetailsLegacy(null);
|
|
51
|
-
setEdited(initialEdited);
|
|
52
|
-
props.setDrawerOpen(null);
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<Drawer
|
|
57
|
-
open={props.drawerOpen !== null}
|
|
58
|
-
onClose={handleClose}
|
|
59
|
-
anchor="right"
|
|
60
|
-
>
|
|
61
|
-
<Box sx={styles.main}>
|
|
62
|
-
{props.drawerOpen && props.drawerOpen.group && (
|
|
63
|
-
<ScheduleDrawerGroup
|
|
64
|
-
drawerOpen={props.drawerOpen}
|
|
65
|
-
details={detailsGroup}
|
|
66
|
-
setDetails={setDetailsGroup}
|
|
67
|
-
edited={edited}
|
|
68
|
-
setEdited={setEdited}
|
|
69
|
-
handleClose={handleClose}
|
|
70
|
-
/>
|
|
71
|
-
)}
|
|
72
|
-
{props.drawerOpen && !props.drawerOpen.group && (
|
|
73
|
-
<ScheduleDrawerLegacy
|
|
74
|
-
drawerOpen={props.drawerOpen}
|
|
75
|
-
details={detailsLegacy}
|
|
76
|
-
setDetails={setDetailsLegacy}
|
|
77
|
-
edited={edited}
|
|
78
|
-
setEdited={setEdited}
|
|
79
|
-
handleClose={handleClose}
|
|
80
|
-
/>
|
|
81
|
-
)}
|
|
82
|
-
</Box>
|
|
83
|
-
</Drawer>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const getStyles = (theme: Theme) => {
|
|
88
|
-
return {
|
|
89
|
-
main: {
|
|
90
|
-
[theme.breakpoints.down("sm")]: {
|
|
91
|
-
width: theme.spacing(35),
|
|
92
|
-
},
|
|
93
|
-
[theme.breakpoints.up("sm")]: {
|
|
94
|
-
width: theme.spacing(55),
|
|
95
|
-
},
|
|
96
|
-
[theme.breakpoints.up("xl")]: {
|
|
97
|
-
width: theme.spacing(75),
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useSortable } from "@dnd-kit/sortable";
|
|
3
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
4
|
-
|
|
5
|
-
// Mui
|
|
6
|
-
import { Box, Stack, IconButton, Typography } from "@mui/material";
|
|
7
|
-
import { DragIndicator, DeleteOutline } from "@mui/icons-material";
|
|
8
|
-
|
|
9
|
-
// Custom components
|
|
10
|
-
import {
|
|
11
|
-
StyledTableCell,
|
|
12
|
-
StyledTableRow,
|
|
13
|
-
StyledIconButton,
|
|
14
|
-
} from "@evenicanpm/admin-integrate/components/data-table/table-row";
|
|
15
|
-
|
|
16
|
-
// Types
|
|
17
|
-
import { Process } from "./schedule-details-integrations";
|
|
18
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
19
|
-
import { TableCellProps } from "@mui/material";
|
|
20
|
-
|
|
21
|
-
interface Props {
|
|
22
|
-
item: Process;
|
|
23
|
-
heading: Head[];
|
|
24
|
-
handleDeleteIntegration: (item: Process) => void;
|
|
25
|
-
readOnly?: boolean;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default function SortableIntegrationRow(props: Props) {
|
|
29
|
-
const styles = getStyles();
|
|
30
|
-
|
|
31
|
-
const { attributes, listeners, setNodeRef, transform, transition } =
|
|
32
|
-
useSortable({ id: props.item.id });
|
|
33
|
-
|
|
34
|
-
const transformStyles = {
|
|
35
|
-
transform: CSS.Transform.toString(transform),
|
|
36
|
-
transition,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const handleClickDelete = () => {
|
|
40
|
-
if (!props.readOnly) {
|
|
41
|
-
props.handleDeleteIntegration(props.item);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const listenersProps = props.readOnly ? {} : listeners;
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<StyledTableRow
|
|
49
|
-
ref={setNodeRef}
|
|
50
|
-
sx={{ ...transformStyles, ...styles.row }}
|
|
51
|
-
{...attributes}
|
|
52
|
-
>
|
|
53
|
-
<StyledTableCell
|
|
54
|
-
align={props.heading[0].align as TableCellProps["align"]}
|
|
55
|
-
width={props.heading[0].width}
|
|
56
|
-
sx={{ padding: 0 }}
|
|
57
|
-
>
|
|
58
|
-
<IconButton {...listenersProps} disableRipple>
|
|
59
|
-
<DragIndicator />
|
|
60
|
-
</IconButton>
|
|
61
|
-
</StyledTableCell>
|
|
62
|
-
<StyledTableCell
|
|
63
|
-
align={props.heading[1].align as TableCellProps["align"]}
|
|
64
|
-
width={props.heading[1].width}
|
|
65
|
-
>
|
|
66
|
-
<Stack spacing={1} direction="row">
|
|
67
|
-
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
68
|
-
{/* process icon */}
|
|
69
|
-
</Box>
|
|
70
|
-
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
71
|
-
<Typography variant="caption">{props.item.name}</Typography>
|
|
72
|
-
</Box>
|
|
73
|
-
</Stack>
|
|
74
|
-
</StyledTableCell>
|
|
75
|
-
<StyledTableCell
|
|
76
|
-
align={props.heading[2].align as TableCellProps["align"]}
|
|
77
|
-
width={props.heading[2].width}
|
|
78
|
-
>
|
|
79
|
-
<StyledIconButton onClick={handleClickDelete} disabled={props.readOnly}>
|
|
80
|
-
<DeleteOutline color={props.readOnly ? "disabled" : "error"} />
|
|
81
|
-
</StyledIconButton>
|
|
82
|
-
</StyledTableCell>
|
|
83
|
-
</StyledTableRow>
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const getStyles = () => {
|
|
88
|
-
return {
|
|
89
|
-
row: {
|
|
90
|
-
backgroundColor: "white",
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
|
-
};
|
/package/src/{pages/integrations/integration-list → components/integration-list/list}/index.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|