@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,11 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
1
|
+
import { Copyright } from "@mui/icons-material";
|
|
4
2
|
// MUI
|
|
5
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Box,
|
|
5
|
+
Grid2 as Grid,
|
|
6
|
+
type Theme,
|
|
7
|
+
Typography,
|
|
8
|
+
useTheme,
|
|
9
|
+
} from "@mui/material";
|
|
6
10
|
import styled from "@mui/material/styles/styled";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
11
|
+
import { useTranslations } from "next-intl";
|
|
12
|
+
import type React from "react";
|
|
9
13
|
|
|
10
14
|
// Styled components
|
|
11
15
|
const Footer = styled("footer")(() => ({
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { redirect, RedirectType } from "next/navigation";
|
|
3
|
-
import { useTranslations } from "next-intl";
|
|
4
|
-
|
|
5
|
-
// MUI
|
|
6
|
-
import { Theme, useTheme } from "@mui/material";
|
|
7
|
-
import { Grid2 as Grid, Box, Typography, Button } from "@mui/material";
|
|
8
1
|
import { Refresh, VisibilityOutlined } from "@mui/icons-material";
|
|
2
|
+
// MUI
|
|
3
|
+
import {
|
|
4
|
+
Box,
|
|
5
|
+
Button,
|
|
6
|
+
Grid2 as Grid,
|
|
7
|
+
type Theme,
|
|
8
|
+
Typography,
|
|
9
|
+
useTheme,
|
|
10
|
+
} from "@mui/material";
|
|
11
|
+
import { RedirectType, redirect } from "next/navigation";
|
|
12
|
+
import { useTranslations } from "next-intl";
|
|
13
|
+
import type React from "react";
|
|
9
14
|
|
|
10
15
|
// Custom components
|
|
11
16
|
import { OutlinedIconButton } from "../button";
|
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import React, { useState } from "react";
|
|
2
|
-
|
|
3
|
-
// MUI
|
|
4
|
-
import { Theme, useTheme } from "@mui/material";
|
|
5
|
-
import { Grid2 as Grid, Typography, Stack } from "@mui/material";
|
|
6
|
-
|
|
7
|
-
// Custom components
|
|
8
|
-
import { ExecutionTag } from "@evenicanpm/admin-integrate/components/execution";
|
|
9
1
|
import { DateTimePopover } from "@evenicanpm/admin-integrate/components/core";
|
|
2
|
+
import { ExecutionTag } from "@evenicanpm/admin-integrate/components/execution";
|
|
3
|
+
import {
|
|
4
|
+
toDurationDate,
|
|
5
|
+
toShortDate,
|
|
6
|
+
} from "@evenicanpm/admin-integrate/utils/date-functions";
|
|
7
|
+
import {
|
|
8
|
+
Grid2 as Grid,
|
|
9
|
+
Stack,
|
|
10
|
+
type Theme,
|
|
11
|
+
Typography,
|
|
12
|
+
useTheme,
|
|
13
|
+
} from "@mui/material";
|
|
14
|
+
import { useTranslations } from "next-intl";
|
|
15
|
+
import type React from "react";
|
|
16
|
+
import { useState } from "react";
|
|
10
17
|
|
|
11
|
-
interface Execution {
|
|
18
|
+
export interface Execution {
|
|
12
19
|
name: string;
|
|
13
20
|
startDate: string;
|
|
14
|
-
endDate
|
|
21
|
+
endDate?: string;
|
|
15
22
|
executionStatus: {
|
|
16
23
|
id: string;
|
|
17
24
|
};
|
|
@@ -23,13 +30,14 @@ interface Props {
|
|
|
23
30
|
}
|
|
24
31
|
|
|
25
32
|
const ExecutionDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
33
|
+
const t = useTranslations("Integrate");
|
|
34
|
+
|
|
26
35
|
const theme = useTheme();
|
|
27
36
|
const styles = getStyles(theme);
|
|
28
37
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const duration = (endDate.getTime() - startDate.getTime()) / 1000;
|
|
38
|
+
const duration = props.execution.endDate
|
|
39
|
+
? toDurationDate(props.execution.startDate, props.execution.endDate)
|
|
40
|
+
: "";
|
|
33
41
|
|
|
34
42
|
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
35
43
|
const open = Boolean(anchorEl);
|
|
@@ -41,7 +49,6 @@ const ExecutionDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
|
41
49
|
const handlePopoverClose = () => {
|
|
42
50
|
setAnchorEl(null);
|
|
43
51
|
};
|
|
44
|
-
|
|
45
52
|
return (
|
|
46
53
|
<Grid container columnSpacing={1}>
|
|
47
54
|
<Grid size={8}>
|
|
@@ -66,18 +73,20 @@ const ExecutionDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
|
66
73
|
</Stack>
|
|
67
74
|
</Grid>
|
|
68
75
|
<Grid size={12}>
|
|
69
|
-
<Stack
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
</Typography>
|
|
78
|
-
<Typography color="grey" variant="caption">
|
|
79
|
-
Duration: {duration}s
|
|
76
|
+
<Stack spacing={1} direction="row">
|
|
77
|
+
<Typography
|
|
78
|
+
color="grey"
|
|
79
|
+
variant="caption"
|
|
80
|
+
onMouseEnter={handlePopoverOpen}
|
|
81
|
+
onMouseLeave={handlePopoverClose}
|
|
82
|
+
>
|
|
83
|
+
{toShortDate(props.execution.startDate)}
|
|
80
84
|
</Typography>
|
|
85
|
+
{duration && (
|
|
86
|
+
<Typography color="grey" variant="caption">
|
|
87
|
+
{t("Executions.duration")}: {duration}
|
|
88
|
+
</Typography>
|
|
89
|
+
)}
|
|
81
90
|
</Stack>
|
|
82
91
|
</Grid>
|
|
83
92
|
<DateTimePopover
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
AppBar,
|
|
3
|
+
Box,
|
|
4
|
+
Stack,
|
|
5
|
+
type Theme,
|
|
6
|
+
Toolbar,
|
|
7
|
+
Typography,
|
|
8
|
+
useTheme,
|
|
9
|
+
} from "@mui/material";
|
|
10
|
+
import type React from "react";
|
|
4
11
|
|
|
5
12
|
interface Props {
|
|
6
13
|
title: string; // e.g. Executions
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as IntegrateHeader } from "./header";
|
|
2
1
|
export { default as DashboardListHeader } from "./dashboard-list-header";
|
|
3
2
|
export { default as ExecutionDetailsHeader } from "./execution-details-header";
|
|
3
|
+
export { default as IntegrateHeader } from "./header";
|
|
4
4
|
export { default as IntegrationDetailsHeader } from "./integration-details-header";
|
|
@@ -1,29 +1,36 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { useTranslations } from "next-intl";
|
|
3
|
-
|
|
4
|
-
// MUI
|
|
5
|
-
import { Theme, useTheme } from "@mui/material";
|
|
6
|
-
import { Grid2 as Grid, Stack, Divider, Button, Box } from "@mui/material";
|
|
7
1
|
import {
|
|
8
|
-
|
|
2
|
+
StatusTag,
|
|
3
|
+
TitleEdit,
|
|
4
|
+
} from "@evenicanpm/admin-integrate/components/core";
|
|
5
|
+
import { IntegrationStatusIcon } from "@evenicanpm/admin-integrate/components/integration-list";
|
|
6
|
+
import {
|
|
7
|
+
AccessTime,
|
|
9
8
|
Code,
|
|
10
9
|
FileUploadOutlined,
|
|
11
10
|
PlayArrowOutlined,
|
|
12
11
|
} from "@mui/icons-material";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
import {
|
|
13
|
+
Box,
|
|
14
|
+
Button,
|
|
15
|
+
Divider,
|
|
16
|
+
Grid2 as Grid,
|
|
17
|
+
Stack,
|
|
18
|
+
type SxProps,
|
|
19
|
+
type Theme,
|
|
20
|
+
useTheme,
|
|
21
|
+
} from "@mui/material";
|
|
22
|
+
import { useTranslations } from "next-intl";
|
|
22
23
|
|
|
23
24
|
interface Props {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
name: string;
|
|
26
|
+
setName: React.Dispatch<React.SetStateAction<string>>;
|
|
27
|
+
onImportClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
28
|
+
onScheduleClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
29
|
+
icon?: string;
|
|
26
30
|
children?: React.ReactNode; // buttons to go in header, e.g. save, cancel etc.
|
|
31
|
+
toolbar?: "enabled" | "disabled" | "hidden";
|
|
32
|
+
draft?: boolean;
|
|
33
|
+
untitled?: boolean;
|
|
27
34
|
}
|
|
28
35
|
|
|
29
36
|
const IntegrationDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
@@ -33,24 +40,39 @@ const IntegrationDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
|
33
40
|
const styles = getStyles(theme);
|
|
34
41
|
|
|
35
42
|
const onConfirm = (input: string) => {
|
|
36
|
-
props.
|
|
43
|
+
props.setName(input);
|
|
37
44
|
};
|
|
38
45
|
|
|
46
|
+
const toolbarStyles: SxProps =
|
|
47
|
+
props.toolbar === "disabled"
|
|
48
|
+
? {
|
|
49
|
+
...styles.controlsButton,
|
|
50
|
+
color: theme.palette.grey[100],
|
|
51
|
+
borderColor: theme.palette.grey[300],
|
|
52
|
+
}
|
|
53
|
+
: styles.controlsButton;
|
|
54
|
+
|
|
39
55
|
return (
|
|
40
|
-
<Grid container rowSpacing={1} columnSpacing={0}>
|
|
41
|
-
<Grid
|
|
56
|
+
<Grid container rowSpacing={1} columnSpacing={0} sx={styles.root}>
|
|
57
|
+
<Grid
|
|
58
|
+
size={{ xs: 12, sm: 8 }}
|
|
59
|
+
pl={2}
|
|
60
|
+
pt={1}
|
|
61
|
+
display="flex"
|
|
62
|
+
alignItems="center"
|
|
63
|
+
>
|
|
42
64
|
<Stack spacing={1} direction="row" alignItems="center">
|
|
43
|
-
{
|
|
44
|
-
<InfoOutlined color="info" />
|
|
65
|
+
<IntegrationStatusIcon processIcon={props.icon || "noIcon"} />
|
|
45
66
|
|
|
46
|
-
<TitleEdit
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
67
|
+
<TitleEdit title={props.name} onConfirm={onConfirm} variant="h5" />
|
|
68
|
+
|
|
69
|
+
{props.untitled && <StatusTag type="warning" text={t("untitled")} />}
|
|
70
|
+
{props.draft && !props.untitled && (
|
|
71
|
+
<StatusTag type="info" text={t("draft")} />
|
|
72
|
+
)}
|
|
51
73
|
</Stack>
|
|
52
74
|
</Grid>
|
|
53
|
-
<Grid size={{ xs: 12, sm: 4 }}>
|
|
75
|
+
<Grid size={{ xs: 12, sm: 4 }} pt={1} pr={2}>
|
|
54
76
|
<Stack
|
|
55
77
|
spacing={1}
|
|
56
78
|
direction="row"
|
|
@@ -61,28 +83,65 @@ const IntegrationDetailsHeader: React.FC<Props> = (props: Props) => {
|
|
|
61
83
|
{props.children}
|
|
62
84
|
</Stack>
|
|
63
85
|
</Grid>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
86
|
+
|
|
87
|
+
{(!props.toolbar || props.toolbar !== "hidden") && (
|
|
88
|
+
<>
|
|
89
|
+
<Grid size={12}>
|
|
90
|
+
<Divider sx={styles.divider} />
|
|
91
|
+
</Grid>
|
|
92
|
+
<Grid size={12} pb={1} pl={1} pr={1}>
|
|
93
|
+
<Stack direction="row">
|
|
94
|
+
<Box sx={toolbarStyles}>
|
|
95
|
+
<Button
|
|
96
|
+
startIcon={<Code />}
|
|
97
|
+
disabled={props.toolbar === "disabled"}
|
|
98
|
+
>
|
|
99
|
+
{t("codeView")}
|
|
100
|
+
</Button>
|
|
101
|
+
</Box>
|
|
102
|
+
<Box sx={toolbarStyles}>
|
|
103
|
+
<Button
|
|
104
|
+
startIcon={<FileUploadOutlined />}
|
|
105
|
+
disabled={props.toolbar === "disabled"}
|
|
106
|
+
onClick={(e) => {
|
|
107
|
+
if (props.onImportClick) props.onImportClick(e);
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
{t("import")}
|
|
111
|
+
</Button>
|
|
112
|
+
</Box>
|
|
113
|
+
<Box sx={{ ...toolbarStyles }}>
|
|
114
|
+
<Button
|
|
115
|
+
startIcon={<AccessTime />}
|
|
116
|
+
disabled={props.toolbar === "disabled"}
|
|
117
|
+
onClick={(e) => {
|
|
118
|
+
if (props.onScheduleClick) props.onScheduleClick(e);
|
|
119
|
+
}}
|
|
120
|
+
>
|
|
121
|
+
{t("schedule")}
|
|
122
|
+
</Button>
|
|
123
|
+
</Box>
|
|
124
|
+
<Box sx={{ ...toolbarStyles, border: "none" }}>
|
|
125
|
+
<Button
|
|
126
|
+
startIcon={<PlayArrowOutlined />}
|
|
127
|
+
disabled={props.toolbar === "disabled"}
|
|
128
|
+
>
|
|
129
|
+
{t("executions")}
|
|
130
|
+
</Button>
|
|
131
|
+
</Box>
|
|
132
|
+
</Stack>
|
|
133
|
+
</Grid>
|
|
134
|
+
</>
|
|
135
|
+
)}
|
|
80
136
|
</Grid>
|
|
81
137
|
);
|
|
82
138
|
};
|
|
83
139
|
|
|
84
140
|
const getStyles = (theme: Theme) => {
|
|
85
141
|
return {
|
|
142
|
+
root: {
|
|
143
|
+
backgroundColor: theme.palette.background.paper,
|
|
144
|
+
},
|
|
86
145
|
divider: {
|
|
87
146
|
border: `1px solid ${theme.palette.grey[500]}`,
|
|
88
147
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Filters,
|
|
3
|
+
MultiSelectFilter,
|
|
4
|
+
} from "@evenicanpm/admin-integrate/components/list-filter/list-filter-types";
|
|
5
|
+
|
|
6
|
+
export interface IntegrationListFilters extends Filters {
|
|
7
|
+
multiSelectFilter: MultiSelectFilter;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const integrationListFilters: IntegrationListFilters = {
|
|
11
|
+
multiSelectFilter: {
|
|
12
|
+
type: "multiSelect",
|
|
13
|
+
label: "IntegrationList.tags",
|
|
14
|
+
value: null,
|
|
15
|
+
options: [
|
|
16
|
+
{ id: "Schedule Pending", value: "IntegrationList.scheduledPending" },
|
|
17
|
+
{ id: "Scheduled", value: "IntegrationList.scheduled" },
|
|
18
|
+
{ id: "Triggered", value: "IntegrationList.triggered" },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import type React from "react";
|
|
11
|
+
|
|
12
|
+
interface Props {
|
|
13
|
+
processIcon: string;
|
|
14
|
+
sx?: SxProps;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const IntegrationStatusIcon: React.FC<Props> = (props: Props) => {
|
|
18
|
+
const color = purple[500];
|
|
19
|
+
const statusIconMap: { [key: string]: React.ReactNode } = {
|
|
20
|
+
DB: <StorageIcon color="success" />,
|
|
21
|
+
Webhook: <ElectricBoltIcon color="error" />,
|
|
22
|
+
Restful: <CodeIcon color="info" />,
|
|
23
|
+
Table: <TableChartIcon sx={{ color: color }} />,
|
|
24
|
+
Email: <EmailIcon color="warning" />,
|
|
25
|
+
Export: <IosShareIcon color="primary" />,
|
|
26
|
+
noIcon: <QuestionMarkIcon color="info" />,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return statusIconMap[props.processIcon] || statusIconMap.noIcon;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default IntegrationStatusIcon;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { StatusTag } from "@evenicanpm/admin-integrate/components/core";
|
|
2
|
+
import { Box, type SxProps } from "@mui/material";
|
|
3
|
+
import { useTranslations } from "next-intl";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
process: {
|
|
7
|
+
isScheduled: number;
|
|
8
|
+
isTriggered: number;
|
|
9
|
+
};
|
|
10
|
+
sx?: SxProps;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const IntegrationTag: React.FC<Props> = ({ process, sx }) => {
|
|
14
|
+
const t = useTranslations("Integrate.IntegrationList");
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<Box display="flex" gap={1} justifyContent="center">
|
|
18
|
+
{process.isTriggered === 1 && (
|
|
19
|
+
<StatusTag type="info" text={t("triggered")} sx={sx} />
|
|
20
|
+
)}
|
|
21
|
+
|
|
22
|
+
{process.isScheduled === 1 && (
|
|
23
|
+
<StatusTag type="success" text={t("scheduled")} sx={sx} />
|
|
24
|
+
)}
|
|
25
|
+
|
|
26
|
+
{process.isScheduled === 0 && (
|
|
27
|
+
<StatusTag type="warning" text={t("scheduledPending")} sx={sx} />
|
|
28
|
+
)}
|
|
29
|
+
</Box>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default IntegrationTag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./integration-list";
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { DateTimePopover } from "@evenicanpm/admin-integrate/components/core";
|
|
2
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
3
|
+
import {
|
|
4
|
+
StyledIconButton,
|
|
5
|
+
StyledTableCell,
|
|
6
|
+
StyledTableRow,
|
|
7
|
+
} from "@evenicanpm/admin-integrate/components/data-table/table-row";
|
|
8
|
+
import {
|
|
9
|
+
IntegrationStatusIcon,
|
|
10
|
+
IntegrationTag,
|
|
11
|
+
} from "@evenicanpm/admin-integrate/components/integration-list";
|
|
12
|
+
import { toDistanceDate } from "@evenicanpm/admin-integrate/utils/date-functions";
|
|
13
|
+
import { ContentCopyOutlined, RemoveRedEye } from "@mui/icons-material";
|
|
14
|
+
import {
|
|
15
|
+
Box,
|
|
16
|
+
Stack,
|
|
17
|
+
type SxProps,
|
|
18
|
+
type TableCellProps,
|
|
19
|
+
type Theme,
|
|
20
|
+
Typography,
|
|
21
|
+
useTheme,
|
|
22
|
+
} from "@mui/material";
|
|
23
|
+
import { RedirectType, redirect } from "next/navigation";
|
|
24
|
+
import type React from "react";
|
|
25
|
+
import { useState } from "react";
|
|
26
|
+
import type { integrationItem } from "./integration-list";
|
|
27
|
+
|
|
28
|
+
interface Props {
|
|
29
|
+
item: integrationItem;
|
|
30
|
+
heading: Head[]; // for alignment
|
|
31
|
+
sx?: SxProps;
|
|
32
|
+
handleRedirect?: (id: string) => void;
|
|
33
|
+
isImportMode?: boolean;
|
|
34
|
+
readOnly?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const IntegrationListRow: React.FC<Props> = (props: Props) => {
|
|
38
|
+
const theme = useTheme();
|
|
39
|
+
const styles = getStyles(theme);
|
|
40
|
+
|
|
41
|
+
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
42
|
+
const open = Boolean(anchorEl);
|
|
43
|
+
|
|
44
|
+
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => {
|
|
45
|
+
setAnchorEl(event.currentTarget);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const handlePopoverClose = () => {
|
|
49
|
+
setAnchorEl(null);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const handleRedirect = () => {
|
|
53
|
+
if (props.handleRedirect) {
|
|
54
|
+
props.handleRedirect(props.item.id);
|
|
55
|
+
} else {
|
|
56
|
+
redirect(`/e4integrate/integrations/${props.item.id}`, RedirectType.push);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const headings = {
|
|
61
|
+
name: props.heading.find((h) => h.id === "name"),
|
|
62
|
+
id: props.heading.find((h) => h.id === "id"),
|
|
63
|
+
isScheduled: props.heading.find((h) => h.id === "isScheduled"),
|
|
64
|
+
modified: props.heading.find((h) => h.id === "modified"),
|
|
65
|
+
view: props.heading.find((h) => h.id === "view"),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<StyledTableRow sx={props.sx}>
|
|
70
|
+
{headings.name && (
|
|
71
|
+
<StyledTableCell
|
|
72
|
+
align={headings.name.align as TableCellProps["align"]}
|
|
73
|
+
width={headings.name.width}
|
|
74
|
+
>
|
|
75
|
+
<Stack spacing={1} direction="row">
|
|
76
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
77
|
+
<IntegrationStatusIcon processIcon={props.item.processIcon} />
|
|
78
|
+
</Box>
|
|
79
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
80
|
+
<Typography>{props.item.name}</Typography>
|
|
81
|
+
</Box>
|
|
82
|
+
</Stack>
|
|
83
|
+
</StyledTableCell>
|
|
84
|
+
)}
|
|
85
|
+
{headings.id && (
|
|
86
|
+
<StyledTableCell
|
|
87
|
+
align={headings.id.align as TableCellProps["align"]}
|
|
88
|
+
width={headings.id.width}
|
|
89
|
+
>
|
|
90
|
+
<Typography>{props.item.id}</Typography>
|
|
91
|
+
</StyledTableCell>
|
|
92
|
+
)}
|
|
93
|
+
{headings.isScheduled && (
|
|
94
|
+
<StyledTableCell
|
|
95
|
+
align={headings.isScheduled.align as TableCellProps["align"]}
|
|
96
|
+
width={headings.isScheduled.width}
|
|
97
|
+
>
|
|
98
|
+
<IntegrationTag
|
|
99
|
+
process={{
|
|
100
|
+
isScheduled: props.item.isScheduled,
|
|
101
|
+
isTriggered: props.item.isTriggered,
|
|
102
|
+
}}
|
|
103
|
+
/>
|
|
104
|
+
</StyledTableCell>
|
|
105
|
+
)}
|
|
106
|
+
{headings.modified && (
|
|
107
|
+
<StyledTableCell
|
|
108
|
+
align={headings.modified.align as TableCellProps["align"]}
|
|
109
|
+
width={headings.modified.width}
|
|
110
|
+
sx={styles.timeCell}
|
|
111
|
+
>
|
|
112
|
+
<Typography
|
|
113
|
+
onMouseEnter={handlePopoverOpen}
|
|
114
|
+
onMouseLeave={handlePopoverClose}
|
|
115
|
+
>
|
|
116
|
+
{toDistanceDate(props.item.modified)}
|
|
117
|
+
</Typography>
|
|
118
|
+
<DateTimePopover
|
|
119
|
+
dateIsoString={props.item.modified}
|
|
120
|
+
sx={{ pointerEvents: "none" }}
|
|
121
|
+
open={open}
|
|
122
|
+
anchorEl={anchorEl}
|
|
123
|
+
anchorOrigin={{
|
|
124
|
+
vertical: "bottom",
|
|
125
|
+
horizontal: "center",
|
|
126
|
+
}}
|
|
127
|
+
transformOrigin={{
|
|
128
|
+
vertical: "top",
|
|
129
|
+
horizontal: "center",
|
|
130
|
+
}}
|
|
131
|
+
onClose={handlePopoverClose}
|
|
132
|
+
disableRestoreFocus
|
|
133
|
+
/>
|
|
134
|
+
</StyledTableCell>
|
|
135
|
+
)}
|
|
136
|
+
{headings.view && (
|
|
137
|
+
<StyledTableCell
|
|
138
|
+
align={headings.view.align as TableCellProps["align"]}
|
|
139
|
+
width={headings.view.width}
|
|
140
|
+
>
|
|
141
|
+
<StyledIconButton onClick={handleRedirect} disabled={props.readOnly}>
|
|
142
|
+
{props.isImportMode ? <ContentCopyOutlined /> : <RemoveRedEye />}
|
|
143
|
+
</StyledIconButton>
|
|
144
|
+
</StyledTableCell>
|
|
145
|
+
)}
|
|
146
|
+
</StyledTableRow>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const getStyles = (theme: Theme) => {
|
|
151
|
+
return {
|
|
152
|
+
timeCell: {
|
|
153
|
+
cursor: "default",
|
|
154
|
+
},
|
|
155
|
+
popover: {
|
|
156
|
+
padding: theme.spacing(1),
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
export default IntegrationListRow;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { ProcessExecutionInput } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
2
|
+
import { TableHeader } from "@evenicanpm/admin-integrate/components/data-table";
|
|
3
|
+
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
4
|
+
import { type SxProps, Table, TableBody, TableContainer } from "@mui/material";
|
|
5
|
+
import type { integrationItem } from "./integration-list";
|
|
6
|
+
import IntegrationListRow from "./integration-list-row";
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
heading: Head[];
|
|
10
|
+
items: integrationItem[];
|
|
11
|
+
input: ProcessExecutionInput;
|
|
12
|
+
setInput: (newInput: ProcessExecutionInput) => void;
|
|
13
|
+
rowSx?: SxProps;
|
|
14
|
+
handleRedirect?: (id: string) => void;
|
|
15
|
+
isImportMode?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function IntegrationListTable(props: Props) {
|
|
20
|
+
const handleRequestSort = (property: string) => {
|
|
21
|
+
const current = props.input.sort;
|
|
22
|
+
if (property === current) {
|
|
23
|
+
props.setInput({
|
|
24
|
+
...props.input,
|
|
25
|
+
sortDesc: !props.input.sortDesc,
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
props.setInput({
|
|
29
|
+
...props.input,
|
|
30
|
+
sort: property,
|
|
31
|
+
sortDesc: false,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<TableContainer>
|
|
38
|
+
<Table>
|
|
39
|
+
<TableHeader
|
|
40
|
+
heading={props.heading}
|
|
41
|
+
orderBy={props.input.sort ?? ""}
|
|
42
|
+
order={props.input.sortDesc ? "desc" : "asc"}
|
|
43
|
+
onRequestSort={handleRequestSort}
|
|
44
|
+
rowSx={props.rowSx}
|
|
45
|
+
/>
|
|
46
|
+
<TableBody>
|
|
47
|
+
{props.items.map((item) => (
|
|
48
|
+
<IntegrationListRow
|
|
49
|
+
key={item.id}
|
|
50
|
+
item={item}
|
|
51
|
+
heading={props.heading}
|
|
52
|
+
sx={props.rowSx}
|
|
53
|
+
handleRedirect={props.handleRedirect}
|
|
54
|
+
isImportMode={props.isImportMode}
|
|
55
|
+
readOnly={props.readOnly}
|
|
56
|
+
/>
|
|
57
|
+
))}
|
|
58
|
+
</TableBody>
|
|
59
|
+
</Table>
|
|
60
|
+
</TableContainer>
|
|
61
|
+
);
|
|
62
|
+
}
|