@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,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
// Api
|
|
1
|
+
import type { GetProcessScheduleByIdQuery } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
4
2
|
import { getProcessScheduleById } from "@evenicanpm/admin-integrate/api/scheduler/queries";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
// Mui
|
|
3
|
+
import { DrawerButtons } from "@evenicanpm/admin-integrate/components/core";
|
|
8
4
|
import { Divider } from "@mui/material";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import ScheduleDrawerButtons from "./schedule-drawer-buttons";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import type { Edited } from "./edited";
|
|
12
7
|
import ScheduleDetails from "./schedule-details";
|
|
13
8
|
import ScheduleDetailsIntegrations from "./schedule-details-integrations";
|
|
14
9
|
import ScheduleDetailsSkeleton from "./schedule-details-skeleton";
|
|
15
|
-
|
|
16
|
-
// Types
|
|
17
|
-
import { DrawerOpen } from "../scheduler";
|
|
18
|
-
import { Edited } from "./edited";
|
|
19
|
-
import { ProcessScheduleById } from "./schedule-drawer";
|
|
10
|
+
import type { DrawerOpen, ProcessScheduleById } from "./schedule-drawer";
|
|
20
11
|
|
|
21
12
|
interface Props {
|
|
22
13
|
drawerOpen: DrawerOpen;
|
|
@@ -27,7 +18,7 @@ interface Props {
|
|
|
27
18
|
handleClose: () => void;
|
|
28
19
|
}
|
|
29
20
|
|
|
30
|
-
export default function ScheduleDrawerLegacy(props: Props) {
|
|
21
|
+
export default function ScheduleDrawerLegacy(props: Readonly<Props>) {
|
|
31
22
|
const styles = getStyles();
|
|
32
23
|
|
|
33
24
|
const { data } = getProcessScheduleById.useData({
|
|
@@ -47,23 +38,14 @@ export default function ScheduleDrawerLegacy(props: Props) {
|
|
|
47
38
|
}
|
|
48
39
|
}, [data]);
|
|
49
40
|
|
|
50
|
-
const handleSave = () => {};
|
|
51
|
-
|
|
52
41
|
return (
|
|
53
42
|
<>
|
|
54
|
-
<
|
|
55
|
-
handleClose={props.handleClose}
|
|
56
|
-
handleSave={handleSave}
|
|
57
|
-
edited={props.edited}
|
|
58
|
-
readOnly
|
|
59
|
-
/>
|
|
60
|
-
<Divider sx={styles.divider} />
|
|
43
|
+
<DrawerButtons handleClose={() => props.handleClose()} />
|
|
61
44
|
{props.details ? (
|
|
62
45
|
<>
|
|
63
46
|
<ScheduleDetails
|
|
64
47
|
id={props.drawerOpen.id}
|
|
65
48
|
details={props.details}
|
|
66
|
-
setDetails={props.setDetails}
|
|
67
49
|
edited={props.edited}
|
|
68
50
|
setEdited={props.setEdited}
|
|
69
51
|
readOnly
|
|
@@ -72,7 +54,6 @@ export default function ScheduleDrawerLegacy(props: Props) {
|
|
|
72
54
|
<ScheduleDetailsIntegrations
|
|
73
55
|
data={data as GetProcessScheduleByIdQuery}
|
|
74
56
|
details={props.details}
|
|
75
|
-
setDetails={props.setDetails}
|
|
76
57
|
edited={props.edited}
|
|
77
58
|
setEdited={props.setEdited}
|
|
78
59
|
readOnly
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
GetProcessByIdQuery,
|
|
3
|
+
GetProcessScheduleByIdQuery,
|
|
4
|
+
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
5
|
+
import { Box, Drawer, type Theme, useTheme } from "@mui/material";
|
|
6
|
+
import { useTranslations } from "next-intl";
|
|
7
|
+
import { useEffect, useReducer, useState } from "react";
|
|
8
|
+
import {
|
|
9
|
+
DetailsActionType,
|
|
10
|
+
detailsReducer,
|
|
11
|
+
type SetDefaultScheduledProcessAction,
|
|
12
|
+
} from "./details-reducer";
|
|
13
|
+
import { type Edited, initialEdited } from "./edited";
|
|
14
|
+
import ScheduleDrawerGroup from "./schedule-drawer-group";
|
|
15
|
+
import ScheduleDrawerLegacy from "./schedule-drawer-legacy";
|
|
16
|
+
|
|
17
|
+
export type DrawerOpen = {
|
|
18
|
+
id: string;
|
|
19
|
+
group?: boolean;
|
|
20
|
+
addMode?: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ProcessScheduleById =
|
|
24
|
+
GetProcessScheduleByIdQuery["processScheduleById"];
|
|
25
|
+
|
|
26
|
+
interface Props {
|
|
27
|
+
drawerOpen: DrawerOpen | null;
|
|
28
|
+
setDrawerOpen: (drawerOpen: DrawerOpen | null) => void;
|
|
29
|
+
processData?: GetProcessByIdQuery;
|
|
30
|
+
handleSave?: (loading: boolean) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default function ScheduleDrawer(props: Readonly<Props>) {
|
|
34
|
+
const t = useTranslations("Integrate.Scheduler");
|
|
35
|
+
|
|
36
|
+
const theme = useTheme();
|
|
37
|
+
const styles = getStyles(theme);
|
|
38
|
+
|
|
39
|
+
const [edited, setEdited] = useState<Edited>(initialEdited);
|
|
40
|
+
|
|
41
|
+
const [detailsGroup, dispatchDetailsGroup] = useReducer(detailsReducer, {
|
|
42
|
+
details: null,
|
|
43
|
+
});
|
|
44
|
+
const [detailsLegacy, setDetailsLegacy] =
|
|
45
|
+
useState<ProcessScheduleById | null>(null);
|
|
46
|
+
|
|
47
|
+
const handleClose = (confirmClose?: boolean) => {
|
|
48
|
+
if (confirmClose) {
|
|
49
|
+
const isEdited = Object.values(edited).some(Boolean);
|
|
50
|
+
if (isEdited && !props.drawerOpen?.addMode) {
|
|
51
|
+
const confirmClose = confirm(t("unsavedChanges"));
|
|
52
|
+
if (!confirmClose) return;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
dispatchDetailsGroup({ type: DetailsActionType.CLOSE });
|
|
56
|
+
setDetailsLegacy(null);
|
|
57
|
+
setEdited(initialEdited);
|
|
58
|
+
props.setDrawerOpen(null);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (props.drawerOpen?.group && props.processData?.processById) {
|
|
63
|
+
dispatchDetailsGroup({
|
|
64
|
+
type: DetailsActionType.SET_DEFAULT_SCHEDULED_PROCESS,
|
|
65
|
+
defaultScheduledProcess: {
|
|
66
|
+
id: props.processData.processById.id,
|
|
67
|
+
name: props.processData.processById.name as string,
|
|
68
|
+
processIcon: props.processData.processById.processIcon as string,
|
|
69
|
+
},
|
|
70
|
+
} as SetDefaultScheduledProcessAction);
|
|
71
|
+
}
|
|
72
|
+
}, [props.drawerOpen, props.processData]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Drawer
|
|
76
|
+
open={props.drawerOpen !== null}
|
|
77
|
+
onClose={() => handleClose(true)}
|
|
78
|
+
anchor="right"
|
|
79
|
+
>
|
|
80
|
+
<Box sx={styles.main}>
|
|
81
|
+
{(props.drawerOpen?.group || props.drawerOpen?.addMode) && (
|
|
82
|
+
<ScheduleDrawerGroup
|
|
83
|
+
drawerOpen={props.drawerOpen}
|
|
84
|
+
detailsState={detailsGroup}
|
|
85
|
+
dispatchDetails={dispatchDetailsGroup}
|
|
86
|
+
edited={edited}
|
|
87
|
+
setEdited={setEdited}
|
|
88
|
+
handleClose={handleClose}
|
|
89
|
+
handleSave={props.handleSave}
|
|
90
|
+
/>
|
|
91
|
+
)}
|
|
92
|
+
{props.drawerOpen &&
|
|
93
|
+
!props.drawerOpen.group &&
|
|
94
|
+
!props.drawerOpen.addMode && (
|
|
95
|
+
<ScheduleDrawerLegacy
|
|
96
|
+
drawerOpen={props.drawerOpen}
|
|
97
|
+
details={detailsLegacy}
|
|
98
|
+
setDetails={setDetailsLegacy}
|
|
99
|
+
edited={edited}
|
|
100
|
+
setEdited={setEdited}
|
|
101
|
+
handleClose={handleClose}
|
|
102
|
+
/>
|
|
103
|
+
)}
|
|
104
|
+
</Box>
|
|
105
|
+
</Drawer>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const getStyles = (theme: Theme) => {
|
|
110
|
+
return {
|
|
111
|
+
main: {
|
|
112
|
+
maxWidth: `100vw`,
|
|
113
|
+
minWidth: `min(${theme.spacing(70)}, 100vw)`,
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useSortable } from "@dnd-kit/sortable";
|
|
2
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
3
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
4
|
+
import {
|
|
5
|
+
StyledIconButton,
|
|
6
|
+
StyledTableCell,
|
|
7
|
+
StyledTableRow,
|
|
8
|
+
} from "@evenicanpm/admin-integrate/components/data-table/table-row";
|
|
9
|
+
import { ScheduleIntegrationIcon } from "@evenicanpm/admin-integrate/components/scheduler";
|
|
10
|
+
import { DeleteOutline, DragIndicator } from "@mui/icons-material";
|
|
11
|
+
import AddCircleOutlineIcon from "@mui/icons-material/AddCircleOutline";
|
|
12
|
+
import {
|
|
13
|
+
Box,
|
|
14
|
+
IconButton,
|
|
15
|
+
Stack,
|
|
16
|
+
type TableCellProps,
|
|
17
|
+
Typography,
|
|
18
|
+
} from "@mui/material";
|
|
19
|
+
import type { Process } from "./schedule-details-integrations";
|
|
20
|
+
|
|
21
|
+
interface Props {
|
|
22
|
+
item: Process;
|
|
23
|
+
processes: Process[];
|
|
24
|
+
heading: Head[];
|
|
25
|
+
handleDeleteIntegration: (item: Process) => void;
|
|
26
|
+
handleClickAddIntegration: (item: Process) => void;
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
nonScheduledMode?: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default function SortableIntegrationRow(props: Readonly<Props>) {
|
|
32
|
+
const styles = getStyles();
|
|
33
|
+
|
|
34
|
+
const { attributes, listeners, setNodeRef, transform, transition } =
|
|
35
|
+
useSortable({ id: props.item.id });
|
|
36
|
+
|
|
37
|
+
const transformStyles = {
|
|
38
|
+
transform: CSS.Transform.toString(transform),
|
|
39
|
+
transition,
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const handleClickDelete = () => {
|
|
43
|
+
if (!props.readOnly) {
|
|
44
|
+
props.handleDeleteIntegration(props.item);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handleClickAdd = () => {
|
|
49
|
+
if (!props.readOnly) {
|
|
50
|
+
props.handleClickAddIntegration(props.item);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const isInProcesses = props.processes
|
|
55
|
+
? props.processes.some((process) => process.id === props.item.id)
|
|
56
|
+
: false;
|
|
57
|
+
|
|
58
|
+
const listenersProps = props.readOnly ? {} : listeners;
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<StyledTableRow
|
|
62
|
+
ref={setNodeRef}
|
|
63
|
+
sx={{ ...transformStyles, ...styles.row }}
|
|
64
|
+
{...attributes}
|
|
65
|
+
>
|
|
66
|
+
{props.nonScheduledMode ? null : (
|
|
67
|
+
<StyledTableCell
|
|
68
|
+
align={props.heading[0].align as TableCellProps["align"]}
|
|
69
|
+
width={props.heading[0].width}
|
|
70
|
+
sx={{ padding: 0 }}
|
|
71
|
+
>
|
|
72
|
+
<IconButton {...listenersProps} disableRipple>
|
|
73
|
+
<DragIndicator />
|
|
74
|
+
</IconButton>
|
|
75
|
+
</StyledTableCell>
|
|
76
|
+
)}
|
|
77
|
+
<StyledTableCell
|
|
78
|
+
align={
|
|
79
|
+
props.heading[props.nonScheduledMode ? 0 : 1]
|
|
80
|
+
.align as TableCellProps["align"]
|
|
81
|
+
}
|
|
82
|
+
width={props.heading[props.nonScheduledMode ? 0 : 1].width}
|
|
83
|
+
>
|
|
84
|
+
<Stack spacing={1} direction="row">
|
|
85
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
86
|
+
<ScheduleIntegrationIcon
|
|
87
|
+
processIcon={props.item.processIcon || "999"}
|
|
88
|
+
/>
|
|
89
|
+
</Box>
|
|
90
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
91
|
+
<Typography variant="caption">{props.item.name}</Typography>
|
|
92
|
+
</Box>
|
|
93
|
+
</Stack>
|
|
94
|
+
</StyledTableCell>
|
|
95
|
+
<StyledTableCell
|
|
96
|
+
align={
|
|
97
|
+
props.heading[props.nonScheduledMode ? 1 : 2]
|
|
98
|
+
.align as TableCellProps["align"]
|
|
99
|
+
}
|
|
100
|
+
width={props.heading[props.nonScheduledMode ? 1 : 2].width}
|
|
101
|
+
>
|
|
102
|
+
{props.nonScheduledMode ? (
|
|
103
|
+
<StyledIconButton
|
|
104
|
+
onClick={handleClickAdd}
|
|
105
|
+
disabled={props.readOnly || isInProcesses}
|
|
106
|
+
>
|
|
107
|
+
<AddCircleOutlineIcon
|
|
108
|
+
color={props.readOnly || isInProcesses ? "disabled" : "info"}
|
|
109
|
+
/>
|
|
110
|
+
</StyledIconButton>
|
|
111
|
+
) : (
|
|
112
|
+
<StyledIconButton
|
|
113
|
+
onClick={handleClickDelete}
|
|
114
|
+
disabled={props.readOnly}
|
|
115
|
+
>
|
|
116
|
+
<DeleteOutline color={props.readOnly ? "disabled" : "error"} />
|
|
117
|
+
</StyledIconButton>
|
|
118
|
+
)}
|
|
119
|
+
</StyledTableCell>
|
|
120
|
+
</StyledTableRow>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const getStyles = () => {
|
|
125
|
+
return {
|
|
126
|
+
row: {
|
|
127
|
+
backgroundColor: "white",
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Block, CalendarToday, ReportGmailerrorred } from "@mui/icons-material";
|
|
2
|
+
import { Box, Popover, type Theme, Typography, useTheme } from "@mui/material";
|
|
2
3
|
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { Box, Popover, Typography } from "@mui/material";
|
|
6
|
-
import { CalendarToday, Block, ReportGmailerrorred } from "@mui/icons-material";
|
|
4
|
+
import type React from "react";
|
|
5
|
+
import { useState } from "react";
|
|
7
6
|
|
|
8
7
|
interface Props {
|
|
9
8
|
isLegacy?: boolean;
|
|
@@ -17,7 +16,7 @@ const ScheduleIcon: React.FC<Props> = (props: Props) => {
|
|
|
17
16
|
const theme = useTheme();
|
|
18
17
|
const styles = getStyles(theme);
|
|
19
18
|
|
|
20
|
-
const iconMap: { [key: string]:
|
|
19
|
+
const iconMap: { [key: string]: React.ReactNode } = {
|
|
21
20
|
enabled: <CalendarToday color="success" />,
|
|
22
21
|
disabled: <Block sx={{ color: "grey.600" }} />,
|
|
23
22
|
legacy: <ReportGmailerrorred color="error" />,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import CodeIcon from "@mui/icons-material/Code";
|
|
2
|
+
import ElectricBoltIcon from "@mui/icons-material/ElectricBolt";
|
|
3
|
+
import EmailIcon from "@mui/icons-material/Email";
|
|
4
|
+
import IosShareIcon from "@mui/icons-material/IosShare";
|
|
5
|
+
import QuestionMarkIcon from "@mui/icons-material/QuestionMark";
|
|
6
|
+
import StorageIcon from "@mui/icons-material/Storage";
|
|
7
|
+
import TableChartIcon from "@mui/icons-material/TableChart";
|
|
8
|
+
import type { SxProps } from "@mui/material";
|
|
9
|
+
import { purple } from "@mui/material/colors";
|
|
10
|
+
|
|
11
|
+
interface Props {
|
|
12
|
+
processIcon: string;
|
|
13
|
+
sx?: SxProps;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const ScheduleIntegrationIcon: React.FC<Props> = (props: Props) => {
|
|
17
|
+
const color = purple[500];
|
|
18
|
+
const statusIconMap: { [key: string]: React.ReactNode } = {
|
|
19
|
+
DB: <StorageIcon color="success" />,
|
|
20
|
+
Webhook: <ElectricBoltIcon color="error" />,
|
|
21
|
+
Restful: <CodeIcon color="info" />,
|
|
22
|
+
Table: <TableChartIcon sx={{ color: color }} />,
|
|
23
|
+
Email: <EmailIcon color="warning" />,
|
|
24
|
+
Export: <IosShareIcon color="primary" />,
|
|
25
|
+
noIcon: <QuestionMarkIcon color="info" />,
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
return statusIconMap[props.processIcon] || statusIconMap.noIcon;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default ScheduleIntegrationIcon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Wizard } from "./wizard";
|