@evenicanpm/admin-integrate 1.1.0 → 1.2.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.
Files changed (101) hide show
  1. package/documents/ProcessSchedule/fragments.ts +24 -0
  2. package/documents/ProcessSchedule/read.ts +12 -0
  3. package/documents/ProcessScheduleGroup/fragments.ts +29 -0
  4. package/documents/ProcessScheduleGroup/read.ts +12 -0
  5. package/documents/ScheduledProcess/fragments.ts +24 -0
  6. package/documents/ScheduledProcess/list.ts +27 -0
  7. package/package.json +21 -17
  8. package/src/api/dashboard/queries/get-process-executions.query.ts +33 -36
  9. package/src/api/dashboard/queries/get-process-executions.server.ts +4 -4
  10. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +45 -0
  11. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +14 -0
  12. package/src/api/scheduler/queries/get-process-schedule.query.ts +45 -0
  13. package/src/api/scheduler/queries/get-process-schedule.server.ts +14 -0
  14. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +45 -0
  15. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +11 -0
  16. package/src/api/scheduler/queries/index.ts +3 -0
  17. package/src/components/breadcrumbs/breadcrumbs.tsx +23 -26
  18. package/src/components/breadcrumbs/index.ts +1 -1
  19. package/src/components/breadcrumbs/types.tsx +4 -0
  20. package/src/components/button/outlined-icon-button.tsx +26 -38
  21. package/src/components/core/date-time-popover.tsx +32 -0
  22. package/src/components/core/edited-typography.tsx +20 -0
  23. package/src/components/core/index.ts +3 -0
  24. package/src/components/core/loading.tsx +6 -6
  25. package/src/components/core/title-edit.tsx +122 -0
  26. package/src/components/dashboard-list/dashboard-list-row.tsx +114 -115
  27. package/src/components/dashboard-list/dashboard-list.tsx +119 -119
  28. package/src/components/data-table/table-header.tsx +85 -81
  29. package/src/components/data-table/table-pagination.tsx +27 -27
  30. package/src/components/data-table/table-row.tsx +14 -14
  31. package/src/components/data-table/table-skeleton.tsx +34 -34
  32. package/src/components/execution/execution-filter.ts +22 -22
  33. package/src/components/execution/execution-status-icon.tsx +16 -17
  34. package/src/components/execution/execution-tag.tsx +81 -80
  35. package/src/components/footer/footer.tsx +34 -34
  36. package/src/components/header/dashboard-list-header.tsx +64 -63
  37. package/src/components/header/execution-details-header.tsx +102 -129
  38. package/src/components/header/header.tsx +27 -27
  39. package/src/components/header/index.ts +1 -0
  40. package/src/components/header/integration-details-header.tsx +99 -0
  41. package/src/components/icons/up-down.tsx +15 -15
  42. package/src/components/integration-view/edges/default-edge.tsx +18 -17
  43. package/src/components/integration-view/elk-layout-options.ts +26 -26
  44. package/src/components/integration-view/elk-types.ts +16 -12
  45. package/src/components/integration-view/flow-types.tsx +5 -5
  46. package/src/components/integration-view/integration-view.tsx +132 -130
  47. package/src/components/integration-view/nodes/base-node.tsx +50 -0
  48. package/src/components/integration-view/nodes/connection-node.tsx +8 -8
  49. package/src/components/integration-view/nodes/entry-node.tsx +8 -8
  50. package/src/components/integration-view/nodes/group-node.tsx +47 -6
  51. package/src/components/integration-view/nodes/task-node.tsx +58 -13
  52. package/src/components/integration-view/temp-data/initialElements.tsx +224 -0
  53. package/src/components/integration-view/types.ts +6 -6
  54. package/src/components/layouts/main-layout.tsx +13 -13
  55. package/src/components/layouts/root-container.tsx +25 -25
  56. package/src/components/link-cards/link-card.tsx +23 -23
  57. package/src/components/link-cards/styles.ts +15 -15
  58. package/src/components/list-filter/date-filter.tsx +41 -45
  59. package/src/components/list-filter/date-range-filter.tsx +78 -77
  60. package/src/components/list-filter/list-filter-types.ts +38 -38
  61. package/src/components/list-filter/list-filter.tsx +363 -354
  62. package/src/components/list-filter/multi-select-filter.tsx +94 -95
  63. package/src/components/list-filter/select-filter.tsx +67 -64
  64. package/src/components/scheduler/day-selector.tsx +174 -0
  65. package/src/components/scheduler/day-tag.tsx +73 -0
  66. package/src/components/scheduler/index.ts +4 -0
  67. package/src/components/scheduler/schedule-filter.ts +25 -0
  68. package/src/components/scheduler/schedule-icon.tsx +87 -0
  69. package/src/components/scheduler/scheduler-types.ts +40 -0
  70. package/src/hooks/use-breadcrumbs.ts +31 -31
  71. package/src/hooks/use-recurrence.tsx +13 -0
  72. package/src/hooks/use-timestamp.tsx +21 -21
  73. package/src/pages/dashboard/dashboard-link-cards.tsx +99 -99
  74. package/src/pages/dashboard/dashboard-list-sections.tsx +130 -125
  75. package/src/pages/dashboard/dashboard.tsx +6 -6
  76. package/src/pages/execution-details/execution-details.tsx +23 -29
  77. package/src/pages/executions/executions-list/executions-list-row.tsx +101 -104
  78. package/src/pages/executions/executions-list/executions-list-table.tsx +45 -53
  79. package/src/pages/executions/executions-list/executions-list.tsx +219 -212
  80. package/src/pages/executions/executions.tsx +67 -72
  81. package/src/pages/integrations/integrations.tsx +17 -25
  82. package/src/pages/scheduler/schedule-drawer/edited/edited-types.ts +17 -0
  83. package/src/pages/scheduler/schedule-drawer/edited/index.ts +1 -0
  84. package/src/pages/scheduler/schedule-drawer/index.ts +1 -0
  85. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +227 -0
  86. package/src/pages/scheduler/schedule-drawer/schedule-details-main.tsx +292 -0
  87. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +77 -0
  88. package/src/pages/scheduler/schedule-drawer/schedule-details-skeleton.tsx +64 -0
  89. package/src/pages/scheduler/schedule-drawer/schedule-details.tsx +42 -0
  90. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +72 -0
  91. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +103 -0
  92. package/src/pages/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +94 -0
  93. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +101 -0
  94. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +93 -0
  95. package/src/pages/scheduler/scheduler.tsx +106 -30
  96. package/src/pages/scheduler/schedules-list/index.ts +1 -0
  97. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +235 -0
  98. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +74 -0
  99. package/src/pages/scheduler/schedules-list/schedules-list.tsx +280 -0
  100. package/tsconfig.json +29 -26
  101. package/src/components/integration-view/temp-data/initialElements.ts +0 -238
@@ -10,100 +10,104 @@ import { ExpandLess, ExpandMore } from "@mui/icons-material";
10
10
 
11
11
  // STYLED COMPONENTS
12
12
  const StyledTableCell = styled(TableCell)(({ theme }) => ({
13
- fontWeight: 500,
14
- padding: "16px 20px",
15
- color: theme.palette.grey[900],
13
+ fontWeight: 500,
14
+ padding: "16px 20px",
15
+ color: theme.palette.grey[900],
16
16
  }));
17
17
 
18
18
  // ==============================================================
19
19
  export type Head = {
20
- id: string;
21
- label: string;
22
- align: string;
23
- width: string;
24
- sortable?: boolean;
20
+ id: string;
21
+ label: string;
22
+ align: string;
23
+ width?: string;
24
+ sortable?: boolean;
25
25
  };
26
26
  interface Props {
27
- heading: Head[];
28
- orderBy: string;
29
- order: "asc" | "desc";
30
- onRequestSort?: (id: string) => void; // if provided, make list sortable by column
31
- rowSx?: SxProps;
27
+ heading: Head[];
28
+ orderBy: string;
29
+ order: "asc" | "desc";
30
+ onRequestSort?: (id: string) => void; // if provided, make list sortable by column
31
+ rowSx?: SxProps;
32
32
  }
33
33
  // ==============================================================
34
34
 
35
35
  export default function TableHeader({
36
- order,
37
- heading,
38
- orderBy,
39
- onRequestSort,
40
- rowSx,
36
+ order,
37
+ heading,
38
+ orderBy,
39
+ onRequestSort,
40
+ rowSx,
41
41
  }: Props) {
42
- const theme = useTheme();
43
- const styles = getStyles(theme);
42
+ const theme = useTheme();
43
+ const styles = getStyles(theme);
44
44
 
45
- return (
46
- <TableHead sx={{ backgroundColor: "grey.200" }}>
47
- <TableRow sx={rowSx}>
48
- {heading.map((headCell) => (
49
- <StyledTableCell
50
- key={headCell.id}
51
- align={headCell.align as TableCellProps["align"]}
52
- sortDirection={orderBy === headCell.id ? order : false}
53
- width={headCell.width}
54
- >
55
- {onRequestSort && headCell.sortable ? (
56
- <TableSortLabel
57
- active={orderBy === headCell.id}
58
- onClick={() => onRequestSort(headCell.id)}
59
- direction={orderBy === headCell.id ? order : "asc"}
60
- sx={styles.sortLabel}
61
- IconComponent={() =>
62
- order === "desc" && orderBy === headCell.id ? (
63
- <ExpandMore
64
- sx={{
65
- ...styles.sortIcon,
66
- visibility:
67
- orderBy === headCell.id ? "visible" : "hidden",
68
- }}
69
- />
70
- ) : (
71
- <ExpandLess
72
- sx={{
73
- ...styles.sortIcon,
74
- visibility:
75
- orderBy === headCell.id ? "visible" : "hidden",
76
- }}
77
- />
78
- )
79
- }
80
- >
81
- {headCell.label}
82
- </TableSortLabel>
83
- ) : (
84
- headCell.label
85
- )}
86
- </StyledTableCell>
87
- ))}
88
- </TableRow>
89
- </TableHead>
90
- );
45
+ return (
46
+ <TableHead sx={{ backgroundColor: "grey.200" }}>
47
+ <TableRow sx={rowSx}>
48
+ {heading.map((headCell) => (
49
+ <StyledTableCell
50
+ key={headCell.id}
51
+ align={headCell.align as TableCellProps["align"]}
52
+ sortDirection={orderBy === headCell.id ? order : false}
53
+ width={headCell.width}
54
+ sx={styles.cell}
55
+ >
56
+ {onRequestSort && headCell.sortable ? (
57
+ <TableSortLabel
58
+ active={orderBy === headCell.id}
59
+ onClick={() => onRequestSort(headCell.id)}
60
+ direction={orderBy === headCell.id ? order : "asc"}
61
+ sx={styles.sortLabel}
62
+ IconComponent={() =>
63
+ order === "desc" && orderBy === headCell.id ? (
64
+ <ExpandMore
65
+ sx={{
66
+ ...styles.sortIcon,
67
+ visibility:
68
+ orderBy === headCell.id ? "visible" : "hidden",
69
+ }}
70
+ />
71
+ ) : (
72
+ <ExpandLess
73
+ sx={{
74
+ ...styles.sortIcon,
75
+ visibility:
76
+ orderBy === headCell.id ? "visible" : "hidden",
77
+ }}
78
+ />
79
+ )
80
+ }
81
+ >
82
+ {headCell.label}
83
+ </TableSortLabel>
84
+ ) : (
85
+ headCell.label
86
+ )}
87
+ </StyledTableCell>
88
+ ))}
89
+ </TableRow>
90
+ </TableHead>
91
+ );
91
92
  }
92
93
 
93
94
  const getStyles = (theme: Theme) => {
94
- return {
95
- sortLabel: {
96
- "&:hover": {
97
- color: "info.main",
98
- "& .MuiSvgIcon-root": {
99
- color: "info.main",
100
- visibility: "visible",
101
- },
102
- },
103
- },
104
- sortIcon: {
105
- marginLeft: theme.spacing(1),
106
- color: "grey.800",
107
- },
108
- };
95
+ return {
96
+ sortLabel: {
97
+ "&:hover": {
98
+ color: "info.main",
99
+ "& .MuiSvgIcon-root": {
100
+ color: "info.main",
101
+ visibility: "visible",
102
+ },
103
+ },
104
+ },
105
+ sortIcon: {
106
+ marginLeft: theme.spacing(1),
107
+ color: "grey.800",
108
+ },
109
+ cell: {
110
+ borderWidth: theme.spacing(0),
111
+ },
112
+ };
109
113
  };
@@ -3,34 +3,34 @@ import styled from "@mui/material/styles/styled";
3
3
 
4
4
  // STYLED COMPONENT
5
5
  const StyledPagination = styled(Pagination)(({ theme }) => ({
6
- "& .MuiPaginationItem-root": {
7
- fontSize: 14,
8
- fontWeight: 500,
9
- color: theme.palette.grey[900],
10
- border: `1px solid transparent`,
11
- },
12
- "& .MuiPaginationItem-page:hover": {
13
- borderRadius: 20,
14
- backgroundColor: "transparent",
15
- color: theme.palette.info.main,
16
- border: `1px solid ${theme.palette.info.main}`,
17
- },
18
- "& .MuiPaginationItem-page.Mui-selected": {
19
- borderRadius: 20,
20
- backgroundColor: "transparent",
21
- color: theme.palette.info.main,
22
- border: `1px solid ${theme.palette.info.main}`,
23
- ":hover": { backgroundColor: "transparent" },
24
- },
25
- "& .MuiPaginationItem-previousNext": {
26
- margin: 10,
27
- borderRadius: 20,
28
- color: theme.palette.info.main,
29
- border: `1px solid ${theme.palette.info.main}`,
30
- "&:hover": { backgroundColor: "transparent" },
31
- },
6
+ "& .MuiPaginationItem-root": {
7
+ fontSize: 14,
8
+ fontWeight: 500,
9
+ color: theme.palette.grey[900],
10
+ border: `1px solid transparent`,
11
+ },
12
+ "& .MuiPaginationItem-page:hover": {
13
+ borderRadius: 20,
14
+ backgroundColor: "transparent",
15
+ color: theme.palette.info.main,
16
+ border: `1px solid ${theme.palette.info.main}`,
17
+ },
18
+ "& .MuiPaginationItem-page.Mui-selected": {
19
+ borderRadius: 20,
20
+ backgroundColor: "transparent",
21
+ color: theme.palette.info.main,
22
+ border: `1px solid ${theme.palette.info.main}`,
23
+ ":hover": { backgroundColor: "transparent" },
24
+ },
25
+ "& .MuiPaginationItem-previousNext": {
26
+ margin: 10,
27
+ borderRadius: 20,
28
+ color: theme.palette.info.main,
29
+ border: `1px solid ${theme.palette.info.main}`,
30
+ "&:hover": { backgroundColor: "transparent" },
31
+ },
32
32
  }));
33
33
 
34
34
  export default function TablePagination(props: PaginationProps) {
35
- return <StyledPagination {...props} />;
35
+ return <StyledPagination {...props} />;
36
36
  }
@@ -2,26 +2,26 @@ import styled from "@mui/material/styles/styled";
2
2
  import { TableRow, TableCell, IconButton } from "@mui/material";
3
3
 
4
4
  const StyledTableCell = styled(TableCell)(({ theme }) => ({
5
- fontSize: 14,
6
- paddingTop: 10,
7
- fontWeight: 500,
8
- paddingBottom: 10,
9
- color: theme.palette.grey[900],
10
- borderBottom: `1px solid ${theme.palette.grey[300]}`,
5
+ fontSize: 14,
6
+ paddingTop: 10,
7
+ fontWeight: 500,
8
+ paddingBottom: 10,
9
+ color: theme.palette.grey[900],
10
+ borderBottom: `1px solid ${theme.palette.grey[300]}`,
11
11
  }));
12
12
 
13
13
  const StyledTableRow = styled(TableRow)({
14
- ":last-child .MuiTableCell-root": { border: 0 },
15
- "&.Mui-selected": {
16
- backgroundColor: "transparent",
17
- ":hover": { backgroundColor: "transparent" },
18
- },
14
+ ":last-child .MuiTableCell-root": { border: 0 },
15
+ "&.Mui-selected": {
16
+ backgroundColor: "transparent",
17
+ ":hover": { backgroundColor: "transparent" },
18
+ },
19
19
  });
20
20
 
21
21
  const StyledIconButton = styled(IconButton)(({ theme }) => ({
22
- color: theme.palette.grey[600],
23
- "& .MuiSvgIcon-root": { fontSize: 19 },
24
- ":hover": { color: theme.palette.info.main },
22
+ color: theme.palette.grey[600],
23
+ "& .MuiSvgIcon-root": { fontSize: 19 },
24
+ ":hover": { color: theme.palette.info.main },
25
25
  }));
26
26
 
27
27
  export { StyledTableCell, StyledTableRow, StyledIconButton };
@@ -5,41 +5,41 @@ import TableHeader, { Head } from "./table-header";
5
5
  import { StyledTableRow, StyledTableCell } from "./table-row";
6
6
 
7
7
  interface Props {
8
- heading: Head[];
9
- perPage: number;
10
- sx?: SxProps;
11
- rowSx?: SxProps;
8
+ heading: Head[];
9
+ perPage: number;
10
+ sx?: SxProps;
11
+ rowSx?: SxProps;
12
12
  }
13
13
 
14
14
  export default function TableSkeleton(props: Props) {
15
- const rangeArray: number[] = Array.from(
16
- { length: props.perPage },
17
- (_, i) => i,
18
- );
19
- return (
20
- <TableContainer sx={props.sx}>
21
- <Table>
22
- <TableHeader
23
- heading={props.heading}
24
- order="asc"
25
- orderBy=""
26
- onRequestSort={() => {
27
- // do nothing
28
- }}
29
- rowSx={props.rowSx}
30
- />
31
- <TableBody>
32
- {rangeArray.map((i: number) => (
33
- <StyledTableRow key={i} sx={props.rowSx}>
34
- {props.heading.map((heading: Head) => (
35
- <StyledTableCell key={`${i}_${heading.id}`}>
36
- <Skeleton />
37
- </StyledTableCell>
38
- ))}
39
- </StyledTableRow>
40
- ))}
41
- </TableBody>
42
- </Table>
43
- </TableContainer>
44
- );
15
+ const rangeArray: number[] = Array.from(
16
+ { length: props.perPage },
17
+ (_, i) => i,
18
+ );
19
+ return (
20
+ <TableContainer sx={props.sx}>
21
+ <Table>
22
+ <TableHeader
23
+ heading={props.heading}
24
+ order="asc"
25
+ orderBy=""
26
+ onRequestSort={() => {
27
+ // do nothing
28
+ }}
29
+ rowSx={props.rowSx}
30
+ />
31
+ <TableBody>
32
+ {rangeArray.map((i: number) => (
33
+ <StyledTableRow key={i} sx={props.rowSx}>
34
+ {props.heading.map((heading: Head) => (
35
+ <StyledTableCell key={`${i}_${heading.id}`}>
36
+ <Skeleton />
37
+ </StyledTableCell>
38
+ ))}
39
+ </StyledTableRow>
40
+ ))}
41
+ </TableBody>
42
+ </Table>
43
+ </TableContainer>
44
+ );
45
45
  }
@@ -1,30 +1,30 @@
1
1
  import {
2
- DateRangeFilter,
3
- Filters,
4
- MultiSelectFilter,
2
+ DateRangeFilter,
3
+ Filters,
4
+ MultiSelectFilter,
5
5
  } from "@evenicanpm/admin-integrate/components/list-filter/list-filter-types";
6
6
 
7
7
  export interface ExecutionsListFilters extends Filters {
8
- dateRange: DateRangeFilter;
9
- multiSelectFilter: MultiSelectFilter;
8
+ dateRange: DateRangeFilter;
9
+ multiSelectFilter: MultiSelectFilter;
10
10
  }
11
11
 
12
12
  export const executionListFilters: ExecutionsListFilters = {
13
- dateRange: {
14
- type: "dateRange",
15
- label: "Date Range",
16
- value: null,
17
- },
18
- multiSelectFilter: {
19
- type: "multiSelect",
20
- label: "Execution Status",
21
- value: null,
22
- options: [
23
- { id: 300, value: "Executions.inProgress" },
24
- { id: 400, value: "Executions.complete" },
25
- { id: 450, value: "Executions.warning" },
26
- { id: 500, value: "Executions.failed" },
27
- { id: 999, value: "Executions.unavailable" },
28
- ],
29
- },
13
+ dateRange: {
14
+ type: "dateRange",
15
+ label: "Executions.dateRange",
16
+ value: null,
17
+ },
18
+ multiSelectFilter: {
19
+ type: "multiSelect",
20
+ label: "Executions.executionStatus",
21
+ value: null,
22
+ options: [
23
+ { id: 300, value: "Executions.inProgress" },
24
+ { id: 400, value: "Executions.complete" },
25
+ { id: 450, value: "Executions.warning" },
26
+ { id: 500, value: "Executions.failed" },
27
+ { id: 999, value: "Executions.unavailable" },
28
+ ],
29
+ },
30
30
  };
@@ -1,30 +1,29 @@
1
1
  import React from "react";
2
2
 
3
- import { Box, Typography, SxProps } from "@mui/material";
3
+ import { SxProps } from "@mui/material";
4
4
  import {
5
- RemoveRedEye,
6
- Loop,
7
- CheckCircleOutline,
8
- WarningAmber,
9
- ErrorOutline,
10
- Clear,
5
+ Loop,
6
+ CheckCircleOutline,
7
+ WarningAmber,
8
+ ErrorOutline,
9
+ Clear,
11
10
  } from "@mui/icons-material";
12
11
 
13
12
  interface Props {
14
- executionStatusId: string;
15
- sx?: SxProps;
13
+ executionStatusId: string;
14
+ sx?: SxProps;
16
15
  }
17
16
 
18
17
  const ExecutionStatusIcon: React.FC<Props> = (props: Props) => {
19
- const statusIconMap = {
20
- 300: <Loop color="info" />,
21
- 400: <CheckCircleOutline color="success" />,
22
- 450: <WarningAmber color="warning" />,
23
- 500: <ErrorOutline color="error" />,
24
- 999: <Clear sx={{ color: "grey.600" }} />,
25
- };
18
+ const statusIconMap: { [key: string]: any } = {
19
+ "300": <Loop color="info" />,
20
+ "400": <CheckCircleOutline color="success" />,
21
+ "450": <WarningAmber color="warning" />,
22
+ "500": <ErrorOutline color="error" />,
23
+ "999": <Clear sx={{ color: "grey.600" }} />,
24
+ };
26
25
 
27
- return statusIconMap[props.executionStatusId] || statusIconMap[999];
26
+ return statusIconMap[props.executionStatusId] || statusIconMap["999"];
28
27
  };
29
28
 
30
29
  export default ExecutionStatusIcon;
@@ -6,95 +6,96 @@ import { Box, Typography, SxProps } from "@mui/material";
6
6
 
7
7
  // Styled components
8
8
  const StyledTagBox = styled(Box)(({ theme }) => ({
9
- padding: theme.spacing(0, 1.5),
10
- border: "solid 1px",
11
- borderRadius: 4,
12
- alignContent: "center",
13
- maxWidth: "fit-content",
9
+ padding: theme.spacing(0, 1.5),
10
+ border: "solid 1px",
11
+ borderRadius: 4,
12
+ alignContent: "center",
13
+ maxWidth: "fit-content",
14
+ maxHeight: "fit-content",
14
15
  }));
15
- const StyledTag = styled(Typography)(({ theme }) => ({
16
- fontWeight: "bold",
16
+ const StyledTag = styled(Typography)(() => ({
17
+ fontWeight: "bold",
17
18
  }));
18
19
 
19
20
  interface Props {
20
- executionStatusId: string;
21
- sx?: SxProps;
21
+ executionStatusId: string;
22
+ sx?: SxProps;
22
23
  }
23
24
 
24
25
  const ExecutionTag: React.FC<Props> = (props: Props) => {
25
- const t = useTranslations("Integrate");
26
+ const t = useTranslations("Integrate");
26
27
 
27
- const statusTagMap = {
28
- 300: (
29
- <StyledTagBox
30
- sx={{
31
- backgroundColor: "info.100",
32
- borderColor: "info.main",
33
- ...props.sx,
34
- }}
35
- >
36
- <StyledTag color="info" variant="caption">
37
- {t("Executions.inProgress")}
38
- </StyledTag>
39
- </StyledTagBox>
40
- ),
41
- 400: (
42
- <StyledTagBox
43
- sx={{
44
- backgroundColor: "success.100",
45
- borderColor: "success.main",
46
- ...props.sx,
47
- }}
48
- >
49
- <StyledTag color="success" variant="caption">
50
- {t("Executions.complete")}
51
- </StyledTag>
52
- </StyledTagBox>
53
- ),
54
- 450: (
55
- <StyledTagBox
56
- sx={{
57
- backgroundColor: "warning.100",
58
- borderColor: "orange.700",
59
- color: "orange.700",
60
- ...props.sx,
61
- }}
62
- >
63
- <StyledTag color="inherit" variant="caption">
64
- {t("Executions.warning")}
65
- </StyledTag>
66
- </StyledTagBox>
67
- ),
68
- 500: (
69
- <StyledTagBox
70
- sx={{
71
- backgroundColor: "error.100",
72
- borderColor: "error.main",
73
- ...props.sx,
74
- }}
75
- >
76
- <StyledTag color="error" variant="caption">
77
- {t("Executions.failed")}
78
- </StyledTag>
79
- </StyledTagBox>
80
- ),
81
- 999: (
82
- <StyledTagBox
83
- sx={{
84
- backgroundColor: "grey.300",
85
- borderColor: "grey.600",
86
- color: "grey.600",
87
- ...props.sx,
88
- }}
89
- >
90
- <StyledTag color="inherit" variant="caption">
91
- {t("Executions.unavailable")}
92
- </StyledTag>
93
- </StyledTagBox>
94
- ),
95
- };
28
+ const statusTagMap: { [key: string]: any } = {
29
+ 300: (
30
+ <StyledTagBox
31
+ sx={{
32
+ backgroundColor: "info.100",
33
+ borderColor: "info.main",
34
+ ...props.sx,
35
+ }}
36
+ >
37
+ <StyledTag color="info" variant="caption">
38
+ {t("Executions.inProgress")}
39
+ </StyledTag>
40
+ </StyledTagBox>
41
+ ),
42
+ 400: (
43
+ <StyledTagBox
44
+ sx={{
45
+ backgroundColor: "success.100",
46
+ borderColor: "success.main",
47
+ ...props.sx,
48
+ }}
49
+ >
50
+ <StyledTag color="success" variant="caption">
51
+ {t("Executions.complete")}
52
+ </StyledTag>
53
+ </StyledTagBox>
54
+ ),
55
+ 450: (
56
+ <StyledTagBox
57
+ sx={{
58
+ backgroundColor: "warning.100",
59
+ borderColor: "orange.700",
60
+ color: "orange.700",
61
+ ...props.sx,
62
+ }}
63
+ >
64
+ <StyledTag color="inherit" variant="caption">
65
+ {t("Executions.warning")}
66
+ </StyledTag>
67
+ </StyledTagBox>
68
+ ),
69
+ 500: (
70
+ <StyledTagBox
71
+ sx={{
72
+ backgroundColor: "error.100",
73
+ borderColor: "error.main",
74
+ ...props.sx,
75
+ }}
76
+ >
77
+ <StyledTag color="error" variant="caption">
78
+ {t("Executions.failed")}
79
+ </StyledTag>
80
+ </StyledTagBox>
81
+ ),
82
+ 999: (
83
+ <StyledTagBox
84
+ sx={{
85
+ backgroundColor: "grey.300",
86
+ borderColor: "grey.600",
87
+ color: "grey.600",
88
+ ...props.sx,
89
+ }}
90
+ >
91
+ <StyledTag color="inherit" variant="caption">
92
+ {t("Executions.unavailable")}
93
+ </StyledTag>
94
+ </StyledTagBox>
95
+ ),
96
+ };
96
97
 
97
- return statusTagMap[props.executionStatusId] || statusTagMap[999];
98
+ return statusTagMap[props.executionStatusId] || statusTagMap[999];
98
99
  };
99
100
 
100
101
  export default ExecutionTag;