@evenicanpm/admin-integrate 1.1.0 → 1.2.2
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/Process/fragments.ts +13 -0
- package/documents/Process/list.ts +27 -0
- package/documents/ProcessSchedule/fragments.ts +24 -0
- package/documents/ProcessSchedule/read.ts +12 -0
- package/documents/ProcessScheduleGroup/fragments.ts +29 -0
- package/documents/ProcessScheduleGroup/read.ts +12 -0
- package/documents/ScheduledProcess/fragments.ts +24 -0
- package/documents/ScheduledProcess/list.ts +27 -0
- package/package.json +21 -17
- package/src/api/Integrations/queries/get-process.query.ts +48 -0
- package/src/api/Integrations/queries/get-process.server.ts +9 -0
- package/src/api/Integrations/queries/index.ts +1 -0
- package/src/api/dashboard/queries/get-process-executions.query.ts +33 -36
- package/src/api/dashboard/queries/get-process-executions.server.ts +4 -4
- package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +45 -0
- package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +14 -0
- package/src/api/scheduler/queries/get-process-schedule.query.ts +45 -0
- package/src/api/scheduler/queries/get-process-schedule.server.ts +14 -0
- package/src/api/scheduler/queries/get-scheduled-processes.query.ts +45 -0
- package/src/api/scheduler/queries/get-scheduled-processes.server.ts +11 -0
- package/src/api/scheduler/queries/index.ts +3 -0
- package/src/components/breadcrumbs/breadcrumbs.tsx +23 -26
- package/src/components/breadcrumbs/index.ts +1 -1
- package/src/components/breadcrumbs/types.tsx +4 -0
- package/src/components/button/outlined-icon-button.tsx +26 -38
- package/src/components/core/date-time-popover.tsx +32 -0
- package/src/components/core/edited-typography.tsx +20 -0
- package/src/components/core/index.ts +3 -0
- package/src/components/core/loading.tsx +6 -6
- package/src/components/core/title-edit.tsx +122 -0
- package/src/components/dashboard-list/dashboard-list-row.tsx +114 -115
- package/src/components/dashboard-list/dashboard-list.tsx +119 -119
- package/src/components/data-table/table-header.tsx +85 -81
- package/src/components/data-table/table-pagination.tsx +27 -27
- package/src/components/data-table/table-row.tsx +14 -14
- package/src/components/data-table/table-skeleton.tsx +34 -34
- package/src/components/execution/execution-filter.ts +22 -22
- package/src/components/execution/execution-status-icon.tsx +16 -17
- package/src/components/execution/execution-tag.tsx +81 -80
- package/src/components/footer/footer.tsx +34 -34
- package/src/components/header/dashboard-list-header.tsx +64 -63
- package/src/components/header/execution-details-header.tsx +102 -129
- package/src/components/header/header.tsx +27 -27
- package/src/components/header/index.ts +1 -0
- package/src/components/header/integration-details-header.tsx +99 -0
- package/src/components/icons/up-down.tsx +15 -15
- package/src/components/integration-list/index.ts +2 -0
- package/src/components/integration-list/integration-filter.ts +21 -0
- package/src/components/integration-list/integration-status-icon.tsx +33 -0
- package/src/components/integration-list/integration-tag.tsx +77 -0
- package/src/components/integration-view/edges/default-edge.tsx +18 -17
- package/src/components/integration-view/elk-layout-options.ts +26 -26
- package/src/components/integration-view/elk-types.ts +16 -12
- package/src/components/integration-view/flow-types.tsx +5 -5
- package/src/components/integration-view/integration-view.tsx +132 -130
- package/src/components/integration-view/nodes/base-node.tsx +50 -0
- package/src/components/integration-view/nodes/connection-node.tsx +8 -8
- package/src/components/integration-view/nodes/entry-node.tsx +8 -8
- package/src/components/integration-view/nodes/group-node.tsx +47 -6
- package/src/components/integration-view/nodes/task-node.tsx +58 -13
- package/src/components/integration-view/temp-data/initialElements.tsx +224 -0
- package/src/components/integration-view/types.ts +6 -6
- package/src/components/layouts/main-layout.tsx +13 -13
- package/src/components/layouts/root-container.tsx +25 -25
- package/src/components/link-cards/link-card.tsx +23 -23
- package/src/components/link-cards/styles.ts +15 -15
- package/src/components/list-filter/date-filter.tsx +41 -45
- package/src/components/list-filter/date-range-filter.tsx +78 -77
- package/src/components/list-filter/list-filter-types.ts +38 -38
- package/src/components/list-filter/list-filter.tsx +363 -354
- package/src/components/list-filter/multi-select-filter.tsx +94 -95
- package/src/components/list-filter/select-filter.tsx +67 -64
- package/src/components/scheduler/day-selector.tsx +174 -0
- package/src/components/scheduler/day-tag.tsx +73 -0
- package/src/components/scheduler/index.ts +4 -0
- package/src/components/scheduler/schedule-filter.ts +25 -0
- package/src/components/scheduler/schedule-icon.tsx +87 -0
- package/src/components/scheduler/scheduler-types.ts +40 -0
- package/src/hooks/use-breadcrumbs.ts +31 -31
- package/src/hooks/use-recurrence.tsx +13 -0
- package/src/hooks/use-timestamp.tsx +21 -21
- package/src/pages/dashboard/dashboard-link-cards.tsx +99 -99
- package/src/pages/dashboard/dashboard-list-sections.tsx +130 -125
- package/src/pages/dashboard/dashboard.tsx +6 -6
- package/src/pages/execution-details/execution-details.tsx +23 -29
- package/src/pages/executions/executions-list/executions-list-row.tsx +101 -104
- package/src/pages/executions/executions-list/executions-list-table.tsx +45 -53
- package/src/pages/executions/executions-list/executions-list.tsx +219 -212
- package/src/pages/executions/executions.tsx +67 -72
- package/src/pages/integrations/integration-list/index.ts +1 -0
- package/src/pages/integrations/integration-list/integration-list-row.tsx +147 -0
- package/src/pages/integrations/integration-list/integration-list-table.tsx +78 -0
- package/src/pages/integrations/integration-list/integration-list.tsx +262 -0
- package/src/pages/integrations/integrations.tsx +83 -28
- package/src/pages/scheduler/schedule-drawer/edited/edited-types.ts +17 -0
- package/src/pages/scheduler/schedule-drawer/edited/index.ts +1 -0
- package/src/pages/scheduler/schedule-drawer/index.ts +1 -0
- package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +227 -0
- package/src/pages/scheduler/schedule-drawer/schedule-details-main.tsx +292 -0
- package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +77 -0
- package/src/pages/scheduler/schedule-drawer/schedule-details-skeleton.tsx +64 -0
- package/src/pages/scheduler/schedule-drawer/schedule-details.tsx +42 -0
- package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +72 -0
- package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +103 -0
- package/src/pages/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +94 -0
- package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +101 -0
- package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +93 -0
- package/src/pages/scheduler/scheduler.tsx +106 -30
- package/src/pages/scheduler/schedules-list/index.ts +1 -0
- package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +235 -0
- package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +74 -0
- package/src/pages/scheduler/schedules-list/schedules-list.tsx +280 -0
- package/tsconfig.json +29 -26
- package/src/components/integration-view/temp-data/initialElements.ts +0 -238
|
@@ -1,47 +1,35 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { IconButton,
|
|
2
|
+
import { IconButton, IconButtonProps } from "@mui/material";
|
|
3
3
|
|
|
4
|
-
interface Props {
|
|
5
|
-
|
|
6
|
-
| "inherit"
|
|
7
|
-
| "default"
|
|
8
|
-
| "primary"
|
|
9
|
-
| "secondary"
|
|
10
|
-
| "error"
|
|
11
|
-
| "info"
|
|
12
|
-
| "success"
|
|
13
|
-
| "warning";
|
|
14
|
-
onClick: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
sx?: SxProps;
|
|
4
|
+
interface Props extends IconButtonProps {
|
|
5
|
+
children: React.ReactNode;
|
|
17
6
|
}
|
|
18
7
|
|
|
19
|
-
const OutlinedIconButton: React.FC<Props> = (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
8
|
+
const OutlinedIconButton: React.FC<Props> = ({
|
|
9
|
+
children,
|
|
10
|
+
sx,
|
|
11
|
+
...props
|
|
12
|
+
}: Props) => {
|
|
13
|
+
const defaultSx = {
|
|
14
|
+
// Default style
|
|
15
|
+
borderWidth: "2px",
|
|
16
|
+
borderStyle: "solid",
|
|
17
|
+
borderColor: props.disabled ? "grey.500" : `${props.color}.light`,
|
|
18
|
+
"&:hover": {
|
|
19
|
+
backgroundColor: "action.hover",
|
|
20
|
+
borderColor: `${props.color}.main`,
|
|
21
|
+
},
|
|
22
|
+
borderRadius: "8px",
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
// Override style
|
|
25
|
+
...sx,
|
|
26
|
+
};
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
onClick={props.onClick}
|
|
41
|
-
>
|
|
42
|
-
{props.children}
|
|
43
|
-
</IconButton>
|
|
44
|
-
);
|
|
28
|
+
return (
|
|
29
|
+
<IconButton sx={defaultSx} {...props}>
|
|
30
|
+
{children}
|
|
31
|
+
</IconButton>
|
|
32
|
+
);
|
|
45
33
|
};
|
|
46
34
|
|
|
47
35
|
export default OutlinedIconButton;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Theme, useTheme } from "@mui/material";
|
|
2
|
+
import { Popover, Box, Typography, PopoverProps } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
interface Props extends PopoverProps {
|
|
5
|
+
dateIsoString: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function DateTimePopover({
|
|
9
|
+
dateIsoString,
|
|
10
|
+
...popoverProps
|
|
11
|
+
}: Props) {
|
|
12
|
+
const theme = useTheme();
|
|
13
|
+
const styles = getStyles(theme);
|
|
14
|
+
|
|
15
|
+
const date = new Date(dateIsoString);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Popover {...popoverProps}>
|
|
19
|
+
<Box sx={styles.popover}>
|
|
20
|
+
<Typography>{date.toString()}</Typography>
|
|
21
|
+
</Box>
|
|
22
|
+
</Popover>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const getStyles = (theme: Theme) => {
|
|
27
|
+
return {
|
|
28
|
+
popover: {
|
|
29
|
+
padding: theme.spacing(1),
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useTranslations } from "next-intl";
|
|
2
|
+
import { Typography } from "@mui/material";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
edited: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function EditedTypography(props: Props) {
|
|
9
|
+
const t = useTranslations("Integrate.Scheduler");
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Typography
|
|
13
|
+
variant="caption"
|
|
14
|
+
color="grey"
|
|
15
|
+
visibility={props.edited ? "visible" : "hidden"}
|
|
16
|
+
>
|
|
17
|
+
{t("edited")}
|
|
18
|
+
</Typography>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -3,13 +3,13 @@ import FlexRowCenter from "@evenicanpm/admin-core/components/flex-box/flex-row-c
|
|
|
3
3
|
import { useTheme } from "@mui/material";
|
|
4
4
|
|
|
5
5
|
const Loading = () => {
|
|
6
|
-
|
|
6
|
+
const theme = useTheme();
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
return (
|
|
9
|
+
<FlexRowCenter sx={{ margin: theme.spacing(1) }}>
|
|
10
|
+
<CircularProgress color="info" />
|
|
11
|
+
</FlexRowCenter>
|
|
12
|
+
);
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export default Loading;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
|
|
3
|
+
import { Theme, useTheme } from "@mui/material";
|
|
4
|
+
import {
|
|
5
|
+
Box,
|
|
6
|
+
Stack,
|
|
7
|
+
Typography,
|
|
8
|
+
TextField,
|
|
9
|
+
IconButton,
|
|
10
|
+
TypographyOwnProps,
|
|
11
|
+
} from "@mui/material";
|
|
12
|
+
import { EditOutlined, Clear, Check } from "@mui/icons-material";
|
|
13
|
+
|
|
14
|
+
import { OutlinedIconButton } from "@evenicanpm/admin-integrate/components/button";
|
|
15
|
+
|
|
16
|
+
interface Props {
|
|
17
|
+
title: string;
|
|
18
|
+
onConfirm: (input: string) => void; // update source of props.title
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
fullWidth?: boolean;
|
|
21
|
+
variant?: TypographyOwnProps["variant"];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default function TitleEdit(props: Props) {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
const styles = getStyles(theme);
|
|
27
|
+
|
|
28
|
+
const [editMode, setEditMode] = useState(false);
|
|
29
|
+
const [input, setInput] = useState(props.title);
|
|
30
|
+
|
|
31
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
32
|
+
setInput(event.target.value);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const handleClickEdit = () => {
|
|
36
|
+
setEditMode(true);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const handleClose = () => {
|
|
40
|
+
setInput(props.title);
|
|
41
|
+
setEditMode(false);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const handleConfirm = () => {
|
|
45
|
+
props.onConfirm(input);
|
|
46
|
+
setEditMode(false);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const handleKeyDown = (event: React.KeyboardEvent) => {
|
|
50
|
+
if (event.key === "Enter" && input !== "") {
|
|
51
|
+
handleConfirm();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<>
|
|
57
|
+
<Box
|
|
58
|
+
sx={{
|
|
59
|
+
width: props.fullWidth ? "100%" : "fit-content",
|
|
60
|
+
overflowX: "auto",
|
|
61
|
+
}}
|
|
62
|
+
display="flex"
|
|
63
|
+
justifyContent="flex-start"
|
|
64
|
+
alignItems="center"
|
|
65
|
+
>
|
|
66
|
+
{!editMode ? (
|
|
67
|
+
<Typography sx={styles.name} variant={props.variant || "h6"}>
|
|
68
|
+
{props.title}
|
|
69
|
+
</Typography>
|
|
70
|
+
) : (
|
|
71
|
+
<TextField
|
|
72
|
+
sx={styles.input}
|
|
73
|
+
fullWidth={props.fullWidth}
|
|
74
|
+
autoFocus
|
|
75
|
+
color="info"
|
|
76
|
+
value={input}
|
|
77
|
+
onChange={handleChange}
|
|
78
|
+
onKeyDown={handleKeyDown}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
</Box>
|
|
82
|
+
{!props.readOnly && (
|
|
83
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
84
|
+
{!editMode ? (
|
|
85
|
+
<IconButton onClick={handleClickEdit}>
|
|
86
|
+
<EditOutlined />
|
|
87
|
+
</IconButton>
|
|
88
|
+
) : (
|
|
89
|
+
<Stack direction="row" spacing={1}>
|
|
90
|
+
<OutlinedIconButton color="error" onClick={handleClose}>
|
|
91
|
+
<Clear />
|
|
92
|
+
</OutlinedIconButton>
|
|
93
|
+
<OutlinedIconButton
|
|
94
|
+
color="success"
|
|
95
|
+
onClick={handleConfirm}
|
|
96
|
+
disabled={input === ""}
|
|
97
|
+
>
|
|
98
|
+
<Check />
|
|
99
|
+
</OutlinedIconButton>
|
|
100
|
+
</Stack>
|
|
101
|
+
)}
|
|
102
|
+
</Box>
|
|
103
|
+
)}
|
|
104
|
+
</>
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const getStyles = (theme: Theme) => {
|
|
109
|
+
return {
|
|
110
|
+
name: {
|
|
111
|
+
overflowX: "auto",
|
|
112
|
+
whiteSpace: "nowrap",
|
|
113
|
+
fontWeight: "medium",
|
|
114
|
+
},
|
|
115
|
+
input: {
|
|
116
|
+
minWidth: theme.spacing(30),
|
|
117
|
+
"& .MuiInputBase-input": {
|
|
118
|
+
padding: theme.spacing(1, 1),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
};
|
|
@@ -8,9 +8,9 @@ import { RemoveRedEye } from "@mui/icons-material";
|
|
|
8
8
|
|
|
9
9
|
// Custom components
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
StyledTableCell,
|
|
12
|
+
StyledTableRow,
|
|
13
|
+
StyledIconButton,
|
|
14
14
|
} from "@evenicanpm/admin-integrate/components/data-table/table-row";
|
|
15
15
|
import { ExecutionStatusIcon } from "@evenicanpm/admin-integrate/components/execution";
|
|
16
16
|
|
|
@@ -20,126 +20,125 @@ import useTimestamp from "@evenicanpm/admin-integrate/hooks/use-timestamp";
|
|
|
20
20
|
// Types
|
|
21
21
|
import { Item } from "./dashboard-list";
|
|
22
22
|
import { Head } from "../data-table/table-header";
|
|
23
|
-
import { TableCellProps } from "@mui/material";
|
|
23
|
+
import { TableCellProps, SxProps } from "@mui/material";
|
|
24
24
|
|
|
25
25
|
interface Props {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
item: Item;
|
|
27
|
+
heading: Head[]; // for alignment
|
|
28
|
+
enableBgColor?: boolean;
|
|
29
|
+
sx?: SxProps;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
const DashboardListRow: React.FC<Props> = (props: Props) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
33
|
+
const theme = useTheme();
|
|
34
|
+
const styles = getStyles(theme);
|
|
35
|
+
|
|
36
|
+
// e.g. "xx days ago"
|
|
37
|
+
const time = useTimestamp(props.item.startDate);
|
|
38
|
+
const localTime = new Date(props.item.startDate).toString();
|
|
39
|
+
|
|
40
|
+
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
41
|
+
const open = Boolean(anchorEl);
|
|
42
|
+
|
|
43
|
+
const handlePopoverOpen = (event: React.MouseEvent<HTMLElement>) => {
|
|
44
|
+
setAnchorEl(event.currentTarget);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const handlePopoverClose = () => {
|
|
48
|
+
setAnchorEl(null);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const handleRedirect = () => {
|
|
52
|
+
redirect(
|
|
53
|
+
`/e4integrate/executions/${props.item.process.id}?ExecutionId=${props.item.id}`,
|
|
54
|
+
RedirectType.push,
|
|
55
|
+
);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
// only relevant for execution status 450 & 500 (i.e. Notifications list)
|
|
59
|
+
let bgColor = "";
|
|
60
|
+
if (props.enableBgColor) {
|
|
61
|
+
switch (props.item.executionStatus.id) {
|
|
62
|
+
case "450":
|
|
63
|
+
bgColor = "warning.100";
|
|
64
|
+
break;
|
|
65
|
+
case "500":
|
|
66
|
+
bgColor = "error.100";
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const sx = props.sx || {};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<StyledTableRow sx={{ ...sx, backgroundColor: bgColor }}>
|
|
75
|
+
<StyledTableCell
|
|
76
|
+
align={props.heading[0].align as TableCellProps["align"]}
|
|
77
|
+
width={props.heading[0].width}
|
|
78
|
+
>
|
|
79
|
+
<Stack spacing={1} direction="row">
|
|
80
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
81
|
+
<ExecutionStatusIcon
|
|
82
|
+
executionStatusId={props.item.executionStatus.id}
|
|
83
|
+
/>
|
|
84
|
+
</Box>
|
|
85
|
+
<Box display="flex" justifyContent="flex-end" alignItems="center">
|
|
86
|
+
<Typography>{props.item.name}</Typography>
|
|
87
|
+
</Box>
|
|
88
|
+
</Stack>
|
|
89
|
+
</StyledTableCell>
|
|
90
|
+
<StyledTableCell
|
|
91
|
+
align={props.heading[1].align as TableCellProps["align"]}
|
|
92
|
+
width={props.heading[1].width}
|
|
93
|
+
sx={styles.timeCell}
|
|
94
|
+
>
|
|
95
|
+
<Typography
|
|
96
|
+
onMouseEnter={handlePopoverOpen}
|
|
97
|
+
onMouseLeave={handlePopoverClose}
|
|
98
|
+
>
|
|
99
|
+
{time}
|
|
100
|
+
</Typography>
|
|
101
|
+
<Popover
|
|
102
|
+
sx={{ pointerEvents: "none" }}
|
|
103
|
+
open={open}
|
|
104
|
+
anchorEl={anchorEl}
|
|
105
|
+
anchorOrigin={{
|
|
106
|
+
vertical: "bottom",
|
|
107
|
+
horizontal: "center",
|
|
108
|
+
}}
|
|
109
|
+
transformOrigin={{
|
|
110
|
+
vertical: "top",
|
|
111
|
+
horizontal: "center",
|
|
112
|
+
}}
|
|
113
|
+
onClose={handlePopoverClose}
|
|
114
|
+
disableRestoreFocus
|
|
115
|
+
>
|
|
116
|
+
<Box sx={styles.popover}>
|
|
117
|
+
<Typography>{localTime}</Typography>
|
|
118
|
+
</Box>
|
|
119
|
+
</Popover>
|
|
120
|
+
</StyledTableCell>
|
|
121
|
+
<StyledTableCell
|
|
122
|
+
align={props.heading[2].align as TableCellProps["align"]}
|
|
123
|
+
width={props.heading[2].width}
|
|
124
|
+
>
|
|
125
|
+
<StyledIconButton onClick={handleRedirect}>
|
|
126
|
+
<RemoveRedEye />
|
|
127
|
+
</StyledIconButton>
|
|
128
|
+
</StyledTableCell>
|
|
129
|
+
</StyledTableRow>
|
|
130
|
+
);
|
|
132
131
|
};
|
|
133
132
|
|
|
134
133
|
const getStyles = (theme: Theme) => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
return {
|
|
135
|
+
timeCell: {
|
|
136
|
+
cursor: "default",
|
|
137
|
+
},
|
|
138
|
+
popover: {
|
|
139
|
+
padding: theme.spacing(1),
|
|
140
|
+
},
|
|
141
|
+
};
|
|
143
142
|
};
|
|
144
143
|
|
|
145
144
|
export default DashboardListRow;
|