@evenicanpm/admin-integrate 1.2.0 → 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 +35 -0
- package/documents/Process/get-process-details.ts +73 -0
- package/documents/Process/list.ts +51 -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 +48 -0
- package/src/api/Integrations/queries/get-process.server.ts +14 -0
- package/src/api/Integrations/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 +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 +3 -0
- package/src/components/integration-list/integration-filter.ts +21 -0
- package/src/components/integration-list/integration-status-icon.tsx +32 -0
- package/src/components/integration-list/integration-tag.tsx +33 -0
- package/src/components/integration-list/list/index.ts +1 -0
- 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/components/integration-list/list/integration-list.tsx +258 -0
- 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 +31 -26
- 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 +68 -8
- 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/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 → 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,38 +1,44 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
4
1
|
// API
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { Theme, useTheme } from "@mui/material";
|
|
10
|
-
import { Card, Box, Stack, Typography, Grid2 as Grid } from "@mui/material";
|
|
11
|
-
|
|
2
|
+
import type {
|
|
3
|
+
GetProcessExecutionsQuery,
|
|
4
|
+
ProcessExecutionInput,
|
|
5
|
+
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
12
6
|
// Custom components
|
|
13
7
|
import { FlexBox } from "@evenicanpm/admin-core/components/flex-box";
|
|
14
8
|
import {
|
|
15
9
|
TablePagination,
|
|
16
10
|
TableSkeleton,
|
|
17
11
|
} from "@evenicanpm/admin-integrate/components/data-table";
|
|
18
|
-
import { ListFilter } from "@evenicanpm/admin-integrate/components/list-filter";
|
|
19
|
-
|
|
20
|
-
// Local components
|
|
21
|
-
import ExecutionsListTable from "./executions-list-table";
|
|
22
|
-
|
|
23
12
|
// Types
|
|
24
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
25
|
-
import { ListFilterOutput } from "@evenicanpm/admin-integrate/components/list-filter/list-filter-types";
|
|
13
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
26
14
|
import {
|
|
27
|
-
ExecutionsListFilters,
|
|
15
|
+
type ExecutionsListFilters,
|
|
28
16
|
executionListFilters,
|
|
29
17
|
} from "@evenicanpm/admin-integrate/components/execution/execution-filter";
|
|
18
|
+
import { ListFilter } from "@evenicanpm/admin-integrate/components/list-filter";
|
|
19
|
+
import type { ListFilterOutput } from "@evenicanpm/admin-integrate/components/list-filter/list-filter-types";
|
|
20
|
+
// MUI
|
|
21
|
+
import {
|
|
22
|
+
Box,
|
|
23
|
+
Card,
|
|
24
|
+
Grid2 as Grid,
|
|
25
|
+
Stack,
|
|
26
|
+
type Theme,
|
|
27
|
+
Typography,
|
|
28
|
+
useTheme,
|
|
29
|
+
} from "@mui/material";
|
|
30
|
+
import { useTranslations } from "next-intl";
|
|
31
|
+
import type React from "react";
|
|
32
|
+
import { useEffect, useState } from "react";
|
|
33
|
+
// Local components
|
|
34
|
+
import ExecutionsListTable from "./executions-list-table";
|
|
30
35
|
|
|
31
36
|
// Returned from processExecutions query
|
|
32
37
|
export interface Item {
|
|
33
38
|
id: string;
|
|
34
39
|
name: string;
|
|
35
40
|
startDate: string;
|
|
41
|
+
endDate?: string;
|
|
36
42
|
executionStatus: {
|
|
37
43
|
id: string;
|
|
38
44
|
};
|
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
4
|
-
// API
|
|
5
|
-
import { getProcessExecutions } from "@evenicanpm/admin-integrate/api/dashboard/queries";
|
|
6
|
-
import {
|
|
7
|
-
ProcessExecutionInput,
|
|
1
|
+
import type {
|
|
8
2
|
GetProcessExecutionsQuery,
|
|
3
|
+
ProcessExecutionInput,
|
|
9
4
|
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { Box } from "@mui/material";
|
|
13
|
-
|
|
5
|
+
// API
|
|
6
|
+
import { getProcessExecutions } from "@evenicanpm/admin-integrate/api/dashboard/queries";
|
|
14
7
|
// Custom components
|
|
15
8
|
import {
|
|
9
|
+
type Crumb,
|
|
16
10
|
IntegrateBreadcrumbs,
|
|
17
|
-
Crumb,
|
|
18
11
|
} from "@evenicanpm/admin-integrate/components/breadcrumbs";
|
|
12
|
+
// Types
|
|
13
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
19
14
|
|
|
15
|
+
// MUI
|
|
16
|
+
import { Box } from "@mui/material";
|
|
17
|
+
import { useTranslations } from "next-intl";
|
|
18
|
+
import React, { useState } from "react";
|
|
20
19
|
// Local components
|
|
21
20
|
import ExecutionsList from "./executions-list";
|
|
22
21
|
|
|
23
|
-
// Types
|
|
24
|
-
import { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
25
|
-
|
|
26
22
|
export default function Executions() {
|
|
27
23
|
const t = useTranslations("Integrate");
|
|
28
24
|
const l = useTranslations("Integrate.Executions.ListHeader");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./integration-create";
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { ConfigurationMergeMutationVariables } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
2
|
+
import {
|
|
3
|
+
processConfigImport,
|
|
4
|
+
processConfigMerge,
|
|
5
|
+
} from "@evenicanpm/admin-integrate/api/process-config/mutation";
|
|
6
|
+
import {
|
|
7
|
+
type Crumb,
|
|
8
|
+
IntegrateBreadcrumbs,
|
|
9
|
+
} from "@evenicanpm/admin-integrate/components/breadcrumbs";
|
|
10
|
+
import { IntegrationDetailsHeader } from "@evenicanpm/admin-integrate/components/header";
|
|
11
|
+
import { removeTemplateConfig } from "@evenicanpm/admin-integrate/components/templates/wizard";
|
|
12
|
+
import { slugify } from "@evenicanpm/admin-integrate/utils/slugify";
|
|
13
|
+
import { Clear, SaveOutlined } from "@mui/icons-material";
|
|
14
|
+
import { Box, Button, Card, type Theme, useTheme } from "@mui/material";
|
|
15
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
16
|
+
import { useTranslations } from "next-intl";
|
|
17
|
+
import { useEffect, useState } from "react";
|
|
18
|
+
import PreCreationStep from "./pre-creation-step";
|
|
19
|
+
import SelectStep from "./select-step";
|
|
20
|
+
import TemplateListStep from "./template-list-step";
|
|
21
|
+
import WizardStep from "./wizard-step";
|
|
22
|
+
|
|
23
|
+
export default function IntegrationCreate() {
|
|
24
|
+
const t = useTranslations("Integrate");
|
|
25
|
+
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const styles = getStyles(theme);
|
|
28
|
+
|
|
29
|
+
const router = useRouter();
|
|
30
|
+
const searchParams = useSearchParams();
|
|
31
|
+
const pathname = usePathname();
|
|
32
|
+
const processConfigMergeMutation = processConfigMerge();
|
|
33
|
+
const processConfigImportMutation = processConfigImport();
|
|
34
|
+
|
|
35
|
+
const breadcrumbs: Crumb[] = [
|
|
36
|
+
{
|
|
37
|
+
name: t("Header.dashboard"),
|
|
38
|
+
url: "/e4integrate",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: t("Header.integrations"),
|
|
42
|
+
url: "/e4integrate/integrations",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: t("Header.newIntegration"),
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
const [name, setName] = useState<string>("");
|
|
50
|
+
const [step, setStep] = useState<number>(0);
|
|
51
|
+
const [processConfig, setProcessConfig] = useState<any | null>(null);
|
|
52
|
+
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (searchParams.get("group")) {
|
|
55
|
+
setStep(2);
|
|
56
|
+
}
|
|
57
|
+
}, [searchParams]);
|
|
58
|
+
|
|
59
|
+
const handleCancel = () => {
|
|
60
|
+
if (step > 0) {
|
|
61
|
+
const confirmClose = confirm(t("Common.unsavedChanges"));
|
|
62
|
+
if (!confirmClose) return;
|
|
63
|
+
setStep(0);
|
|
64
|
+
router.replace(pathname);
|
|
65
|
+
} else {
|
|
66
|
+
router.push("/e4integrate/integrations");
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const handleProcessConfigMerge = (configMergeInput: any) => {
|
|
71
|
+
const newProcessConfigMerge = { ...configMergeInput };
|
|
72
|
+
const code = slugify(name);
|
|
73
|
+
for (const c of newProcessConfigMerge.input.config) {
|
|
74
|
+
c.name = name;
|
|
75
|
+
c.code = code;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
processConfigMergeMutation.mutate(
|
|
79
|
+
{
|
|
80
|
+
input:
|
|
81
|
+
removeTemplateConfig(newProcessConfigMerge?.input) ||
|
|
82
|
+
({} as ConfigurationMergeMutationVariables),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
onSuccess: ({ configurationMerge }) =>
|
|
86
|
+
setProcessConfig(configurationMerge),
|
|
87
|
+
onError: (error) => {
|
|
88
|
+
console.error("Update failed:", error);
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const handleProcessConfigImport = () => {
|
|
95
|
+
processConfigImportMutation.mutate(
|
|
96
|
+
{
|
|
97
|
+
config: processConfig,
|
|
98
|
+
reRoutedFromMerge: true,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
onSuccess: (res) => {
|
|
102
|
+
console.log("res", res);
|
|
103
|
+
router.push("/e4integrate/integrations");
|
|
104
|
+
},
|
|
105
|
+
onError: (error) => {
|
|
106
|
+
console.error("Update failed:", error);
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
// Case when name of process is edited after config merge has been called (ie on pre-creation step), when sending config to import.
|
|
114
|
+
// If name is changed during wizard step, name is already updated in payload to config merge.
|
|
115
|
+
if (processConfig?.Processes) {
|
|
116
|
+
const newConfig = { ...processConfig };
|
|
117
|
+
const code = slugify(name);
|
|
118
|
+
newConfig.Processes[0].Name = name;
|
|
119
|
+
newConfig.Processes[0].Process = code;
|
|
120
|
+
}
|
|
121
|
+
}, [name]);
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<>
|
|
125
|
+
<IntegrateBreadcrumbs breadcrumbs={breadcrumbs} />
|
|
126
|
+
<Card>
|
|
127
|
+
<Box sx={styles.header}>
|
|
128
|
+
<IntegrationDetailsHeader
|
|
129
|
+
name={name || t("Templates.defaultNewName")}
|
|
130
|
+
setName={setName}
|
|
131
|
+
toolbar={step === 3 ? "disabled" : "hidden"}
|
|
132
|
+
draft
|
|
133
|
+
untitled={name === ""}
|
|
134
|
+
>
|
|
135
|
+
<Button
|
|
136
|
+
color="error"
|
|
137
|
+
variant="contained"
|
|
138
|
+
startIcon={<Clear />}
|
|
139
|
+
onClick={handleCancel}
|
|
140
|
+
>
|
|
141
|
+
{t("Templates.cancel")}
|
|
142
|
+
</Button>
|
|
143
|
+
<Button
|
|
144
|
+
color="info"
|
|
145
|
+
variant="contained"
|
|
146
|
+
startIcon={<SaveOutlined />}
|
|
147
|
+
onClick={handleProcessConfigImport}
|
|
148
|
+
disabled={step !== 3}
|
|
149
|
+
>
|
|
150
|
+
{t("Templates.create")}
|
|
151
|
+
</Button>
|
|
152
|
+
</IntegrationDetailsHeader>
|
|
153
|
+
</Box>
|
|
154
|
+
{step === 0 && <SelectStep setStep={setStep} />}
|
|
155
|
+
{step === 1 && <TemplateListStep />}
|
|
156
|
+
{step === 2 && (
|
|
157
|
+
<WizardStep
|
|
158
|
+
setStep={setStep}
|
|
159
|
+
setProcessConfigMerge={handleProcessConfigMerge}
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
162
|
+
{step === 3 && <PreCreationStep processConfig={processConfig} />}
|
|
163
|
+
</Card>
|
|
164
|
+
</>
|
|
165
|
+
);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const getStyles = (theme: Theme) => {
|
|
169
|
+
return {
|
|
170
|
+
header: {
|
|
171
|
+
padding: theme.spacing(2),
|
|
172
|
+
},
|
|
173
|
+
};
|
|
174
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//import type { ProcessConfigMerge } from "@evenicanpm/admin-integrate/components/templates/types";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
processConfig: any | null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function PreCreationStep(props: Props) {
|
|
9
|
+
// TODO: render integration
|
|
10
|
+
console.log("processConfigMerge payload:", props.processConfig);
|
|
11
|
+
return <Box></Box>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// Custom components
|
|
2
|
+
import LinkCard from "@evenicanpm/admin-integrate/components/link-cards";
|
|
3
|
+
import {
|
|
4
|
+
DescriptionOutlined,
|
|
5
|
+
InsertDriveFileOutlined,
|
|
6
|
+
} from "@mui/icons-material";
|
|
7
|
+
|
|
8
|
+
// Mui
|
|
9
|
+
import {
|
|
10
|
+
Box,
|
|
11
|
+
Grid2 as Grid,
|
|
12
|
+
type Theme,
|
|
13
|
+
Typography,
|
|
14
|
+
useTheme,
|
|
15
|
+
} from "@mui/material";
|
|
16
|
+
import { useTranslations } from "next-intl";
|
|
17
|
+
import type React from "react";
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
setStep: React.Dispatch<React.SetStateAction<number>>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default function SelectStep(props: Props) {
|
|
24
|
+
const t = useTranslations("Integrate.Templates");
|
|
25
|
+
|
|
26
|
+
const theme = useTheme();
|
|
27
|
+
const styles = getStyles(theme);
|
|
28
|
+
|
|
29
|
+
const handleClickBlank = () => {
|
|
30
|
+
props.setStep(3);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const handleClickTemplate = () => {
|
|
34
|
+
props.setStep(1);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Box sx={styles.main}>
|
|
39
|
+
<Grid container spacing={1} maxWidth={theme.spacing(70)}>
|
|
40
|
+
<Grid size={{ xs: 12 }}>
|
|
41
|
+
<Typography variant="h6" align="center">
|
|
42
|
+
{t("selectStepTitle")}
|
|
43
|
+
</Typography>
|
|
44
|
+
</Grid>
|
|
45
|
+
<Grid size={{ xs: 12, md: 6 }}>
|
|
46
|
+
<LinkCard
|
|
47
|
+
title={t("selectBlank")}
|
|
48
|
+
description={t("selectBlankDescription")}
|
|
49
|
+
onClick={handleClickBlank}
|
|
50
|
+
>
|
|
51
|
+
<Box
|
|
52
|
+
sx={{
|
|
53
|
+
...styles.iconSquare,
|
|
54
|
+
color: "grey.600",
|
|
55
|
+
backgroundColor: "grey.300",
|
|
56
|
+
}}
|
|
57
|
+
>
|
|
58
|
+
<InsertDriveFileOutlined sx={styles.icon} />
|
|
59
|
+
</Box>
|
|
60
|
+
</LinkCard>
|
|
61
|
+
</Grid>
|
|
62
|
+
<Grid size={{ xs: 12, md: 6 }}>
|
|
63
|
+
<LinkCard
|
|
64
|
+
title={t("selectTemplate")}
|
|
65
|
+
description={t("selectTemplateDescription")}
|
|
66
|
+
onClick={handleClickTemplate}
|
|
67
|
+
>
|
|
68
|
+
<Box
|
|
69
|
+
sx={{
|
|
70
|
+
...styles.iconSquare,
|
|
71
|
+
color: "bluish.600",
|
|
72
|
+
backgroundColor: "bluish.300",
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<DescriptionOutlined sx={styles.icon} />
|
|
76
|
+
</Box>
|
|
77
|
+
</LinkCard>
|
|
78
|
+
</Grid>
|
|
79
|
+
</Grid>
|
|
80
|
+
</Box>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const getStyles = (theme: Theme) => {
|
|
85
|
+
return {
|
|
86
|
+
main: {
|
|
87
|
+
backgroundColor: theme.palette.grey[50],
|
|
88
|
+
padding: theme.spacing(2),
|
|
89
|
+
border: `1px solid ${theme.palette.grey[300]}`,
|
|
90
|
+
minHeight: `min(${theme.spacing(80)}, 60vh)`,
|
|
91
|
+
display: "flex",
|
|
92
|
+
alignItems: "center",
|
|
93
|
+
justifyContent: "center",
|
|
94
|
+
},
|
|
95
|
+
iconSquare: {
|
|
96
|
+
padding: theme.spacing(1),
|
|
97
|
+
paddingBottom: theme.spacing(0.5),
|
|
98
|
+
marginBottom: theme.spacing(1),
|
|
99
|
+
borderRadius: 1,
|
|
100
|
+
},
|
|
101
|
+
icon: {
|
|
102
|
+
fontSize: "h4.fontSize",
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
FilterQueryInput,
|
|
3
|
+
GetProcessTemplateGroupsQuery,
|
|
4
|
+
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
5
|
+
import { getProcessTemplateGroups } from "@evenicanpm/admin-integrate/api/templates/queries";
|
|
6
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
7
|
+
import TemplatesList from "@evenicanpm/admin-integrate/components/templates/templates-list";
|
|
8
|
+
import { Box, Typography, useTheme } from "@mui/material";
|
|
9
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
10
|
+
import { useTranslations } from "next-intl";
|
|
11
|
+
import { useState } from "react";
|
|
12
|
+
|
|
13
|
+
export default function TemplateListStep() {
|
|
14
|
+
const t = useTranslations("Integrate.Templates");
|
|
15
|
+
|
|
16
|
+
const router = useRouter();
|
|
17
|
+
const pathname = usePathname();
|
|
18
|
+
const searchParams = useSearchParams();
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
|
|
21
|
+
const heading: Head[] = [
|
|
22
|
+
{
|
|
23
|
+
id: "name",
|
|
24
|
+
label: t("ListHeader.name"),
|
|
25
|
+
align: "left",
|
|
26
|
+
width: "95%",
|
|
27
|
+
sortable: true,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "view",
|
|
31
|
+
label: t("ListHeader.actions"),
|
|
32
|
+
align: "right",
|
|
33
|
+
width: "5%",
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
// TODO: initialize input based on url query params
|
|
38
|
+
const [input, setInput] = useState<FilterQueryInput>({
|
|
39
|
+
sort: "name",
|
|
40
|
+
sortDesc: false,
|
|
41
|
+
top: 10,
|
|
42
|
+
skip: 0,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const { data, isLoading } = getProcessTemplateGroups.useData({
|
|
46
|
+
input: input,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const handleRedirect = (id: string) => {
|
|
50
|
+
const currentParams = new URLSearchParams(searchParams.toString());
|
|
51
|
+
currentParams.set("group", id);
|
|
52
|
+
router.replace(`${pathname}?${currentParams.toString()}`);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Box
|
|
57
|
+
sx={{
|
|
58
|
+
backgroundColor: theme.palette.grey[50],
|
|
59
|
+
padding: theme.spacing(2),
|
|
60
|
+
border: `1px solid ${theme.palette.grey[300]}`,
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
<Box sx={{ margin: theme.spacing(2, 0) }}>
|
|
64
|
+
<Typography variant="h6">{t("listStepTitle")}</Typography>
|
|
65
|
+
</Box>
|
|
66
|
+
<TemplatesList
|
|
67
|
+
heading={heading}
|
|
68
|
+
data={data as GetProcessTemplateGroupsQuery}
|
|
69
|
+
loading={isLoading}
|
|
70
|
+
input={input}
|
|
71
|
+
setInput={setInput}
|
|
72
|
+
handleRedirect={handleRedirect}
|
|
73
|
+
isTemplateGroupsList
|
|
74
|
+
/>
|
|
75
|
+
</Box>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// Custom components
|
|
2
|
+
import { Wizard } from "@evenicanpm/admin-integrate/components/templates";
|
|
3
|
+
// Types
|
|
4
|
+
import type { ProcessConfigMerge } from "@evenicanpm/admin-integrate/components/templates/types";
|
|
5
|
+
// Mui
|
|
6
|
+
import { Box } from "@mui/material";
|
|
7
|
+
// Util
|
|
8
|
+
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
9
|
+
|
|
10
|
+
const metadata = {
|
|
11
|
+
name: "",
|
|
12
|
+
code: "",
|
|
13
|
+
parallelProcessingGroup: 1,
|
|
14
|
+
sort: 1,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
setStep: React.Dispatch<React.SetStateAction<number>>;
|
|
19
|
+
setProcessConfigMerge: React.Dispatch<
|
|
20
|
+
React.SetStateAction<ProcessConfigMerge | null>
|
|
21
|
+
>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function WizardStep(props: Props) {
|
|
25
|
+
const router = useRouter();
|
|
26
|
+
const pathname = usePathname();
|
|
27
|
+
const searchParams = useSearchParams();
|
|
28
|
+
|
|
29
|
+
const handleBack = () => {
|
|
30
|
+
props.setStep(1);
|
|
31
|
+
router.replace(pathname);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleFinish = () => {
|
|
35
|
+
props.setStep(3);
|
|
36
|
+
router.replace(pathname);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Box>
|
|
41
|
+
<Wizard
|
|
42
|
+
metadata={metadata}
|
|
43
|
+
processTemplateGroupId={searchParams.get("group")?.toString()}
|
|
44
|
+
handleBack={handleBack}
|
|
45
|
+
handleFinish={handleFinish}
|
|
46
|
+
setProcessConfigMerge={props.setProcessConfigMerge}
|
|
47
|
+
/>
|
|
48
|
+
</Box>
|
|
49
|
+
);
|
|
50
|
+
}
|