@evenicanpm/admin-integrate 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/documents/ConfigImport/configuration-import.ts +54 -0
  2. package/documents/CopyProcess/copy.ts +25 -0
  3. package/documents/Endpoint/fragments.ts +9 -0
  4. package/documents/Endpoint/list.ts +30 -0
  5. package/documents/Process/fragments.ts +22 -0
  6. package/documents/Process/get-process-details.ts +72 -0
  7. package/documents/Process/list.ts +24 -0
  8. package/documents/ProcessConfig/fragments.ts +116 -0
  9. package/documents/ProcessConfig/read.ts +35 -0
  10. package/documents/ProcessExecution/fragments.ts +12 -0
  11. package/documents/ProcessExecution/list.ts +30 -1
  12. package/documents/ProcessExecutionDetails/fragments.ts +96 -0
  13. package/documents/ProcessExecutionDetails/read.ts +12 -0
  14. package/documents/ProcessExport/read.ts +108 -0
  15. package/documents/ProcessScheduleGroup/read.ts +43 -0
  16. package/documents/ProcessTask/fragments.ts +288 -0
  17. package/documents/ProcessTask/read.ts +12 -0
  18. package/documents/ProcessTemplate/fragments.ts +74 -0
  19. package/documents/ProcessTemplate/list.ts +67 -0
  20. package/documents/ProcessTemplate/read.ts +12 -0
  21. package/documents/RunProcess/run.ts +11 -0
  22. package/package.json +4 -3
  23. package/src/api/Integrations/queries/get-process.query.ts +12 -12
  24. package/src/api/Integrations/queries/get-process.server.ts +7 -2
  25. package/src/api/configuration/queries/configuration-export.query.ts +48 -0
  26. package/src/api/configuration/queries/configuration-export.server.ts +9 -0
  27. package/src/api/configuration/queries/index.ts +1 -0
  28. package/src/api/dashboard/queries/get-process-executions.query.ts +6 -3
  29. package/src/api/dashboard/queries/get-process-executions.server.ts +1 -1
  30. package/src/api/execution-details/queries/get-process-execution-details.query.ts +46 -0
  31. package/src/api/execution-details/queries/get-process-execution-details.server.ts +11 -0
  32. package/src/api/execution-details/queries/get-process-executions-by-process.query.ts +48 -0
  33. package/src/api/execution-details/queries/get-process-executions-by-process.server.ts +11 -0
  34. package/src/api/execution-details/queries/index.ts +2 -0
  35. package/src/api/process/mutations/copy-process.mutation.ts +45 -0
  36. package/src/api/process/mutations/copy-process.server.ts +14 -0
  37. package/src/api/process/mutations/index.ts +2 -0
  38. package/src/api/process/mutations/run-process.mutation.ts +41 -0
  39. package/src/api/process/mutations/run-process.server.ts +14 -0
  40. package/src/api/process/queries/get-process-by-id.query.ts +85 -0
  41. package/src/api/process/queries/get-process-by-id.server.ts +20 -0
  42. package/src/api/process/queries/index.ts +4 -0
  43. package/src/api/process-config/mutation/index.ts +2 -0
  44. package/src/api/process-config/mutation/process-config-import.mutation.ts +42 -0
  45. package/src/api/process-config/mutation/process-config-import.server.ts +14 -0
  46. package/src/api/process-config/mutation/process-config-merge.mutation.ts +33 -0
  47. package/src/api/process-config/mutation/process-config-merge.server.ts +14 -0
  48. package/src/api/process-task/queries/get-process-task-by-id.query.ts +46 -0
  49. package/src/api/process-task/queries/get-process-task-by-id.server.ts +9 -0
  50. package/src/api/process-task/queries/index.ts +1 -0
  51. package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +47 -0
  52. package/src/api/scheduler/mutation/create-process-schedule-group-details.server.ts +14 -0
  53. package/src/api/scheduler/mutation/index.ts +2 -0
  54. package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +47 -0
  55. package/src/api/scheduler/mutation/update-process-schedule-group-details.server.ts +14 -0
  56. package/src/api/scheduler/queries/get-non-scheduled-processes.query.ts +48 -0
  57. package/src/api/scheduler/queries/get-non-scheduled-processes.server.ts +11 -0
  58. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +6 -3
  59. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +3 -3
  60. package/src/api/scheduler/queries/get-process-schedule.query.ts +6 -3
  61. package/src/api/scheduler/queries/get-process-schedule.server.ts +3 -3
  62. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +6 -3
  63. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +1 -1
  64. package/src/api/scheduler/queries/index.ts +3 -2
  65. package/src/api/templates/queries/get-process-template-groups.query.ts +48 -0
  66. package/src/api/templates/queries/get-process-template-groups.server.ts +11 -0
  67. package/src/api/templates/queries/get-process-template-records.query.ts +48 -0
  68. package/src/api/templates/queries/get-process-template-records.server.ts +11 -0
  69. package/src/api/templates/queries/get-process-template.query.ts +48 -0
  70. package/src/api/templates/queries/get-process-template.server.ts +9 -0
  71. package/src/api/templates/queries/get-process-templates.query.ts +45 -0
  72. package/src/api/templates/queries/get-process-templates.server.ts +9 -0
  73. package/src/api/templates/queries/index.ts +5 -0
  74. package/src/api/templates/queries/template-input-search.query.ts +39 -0
  75. package/src/api/templates/queries/template-input-search.server.ts +42 -0
  76. package/src/api/templates/queries/types.ts +34 -0
  77. package/src/components/breadcrumbs/breadcrumbs.tsx +33 -6
  78. package/src/components/button/outlined-icon-button.tsx +2 -2
  79. package/src/components/core/date-time-popover.tsx +12 -5
  80. package/src/components/core/drawer-buttons.tsx +52 -0
  81. package/src/components/core/edited-typography.tsx +2 -2
  82. package/src/components/core/index.ts +4 -2
  83. package/src/components/core/loading.tsx +1 -1
  84. package/src/components/core/status-tag.tsx +97 -0
  85. package/src/components/core/title-edit.tsx +31 -22
  86. package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
  87. package/src/components/dashboard-list/dashboard-list.tsx +20 -16
  88. package/src/components/data-table/table-header.tsx +6 -8
  89. package/src/components/data-table/table-pagination.tsx +1 -1
  90. package/src/components/data-table/table-row.tsx +1 -1
  91. package/src/components/data-table/table-skeleton.tsx +10 -5
  92. package/src/components/execution/execution-filter.ts +1 -1
  93. package/src/components/execution/execution-status-icon.tsx +7 -7
  94. package/src/components/execution/execution-tag.tsx +12 -77
  95. package/src/components/execution/index.ts +1 -1
  96. package/src/components/execution-history-drawer/execution-history-drawer.tsx +202 -0
  97. package/src/components/execution-history-drawer/executions-card.tsx +85 -0
  98. package/src/components/execution-history-drawer/index.ts +1 -0
  99. package/src/components/footer/footer.tsx +10 -6
  100. package/src/components/header/dashboard-list-header.tsx +12 -7
  101. package/src/components/header/execution-details-header.tsx +35 -26
  102. package/src/components/header/header.tsx +10 -3
  103. package/src/components/header/index.ts +1 -1
  104. package/src/components/header/integration-details-header.tsx +108 -45
  105. package/src/components/integration-list/index.ts +2 -1
  106. package/src/components/integration-list/integration-filter.ts +1 -1
  107. package/src/components/integration-list/integration-status-icon.tsx +7 -8
  108. package/src/components/integration-list/integration-tag.tsx +6 -50
  109. package/src/components/integration-list/list/integration-list-row.tsx +161 -0
  110. package/src/components/integration-list/list/integration-list-table.tsx +62 -0
  111. package/src/{pages/integrations/integration-list → components/integration-list/list}/integration-list.tsx +47 -51
  112. package/src/components/integration-view/animated-svg.tsx +31 -0
  113. package/src/components/integration-view/edges/default-edge.tsx +2 -6
  114. package/src/components/integration-view/elk-layout-options.ts +2 -2
  115. package/src/components/integration-view/elk-types.ts +35 -6
  116. package/src/components/integration-view/flow-types.tsx +12 -0
  117. package/src/components/integration-view/integration-view.tsx +562 -56
  118. package/src/components/integration-view/nodes/add-node.tsx +20 -0
  119. package/src/components/integration-view/nodes/empty-node.tsx +65 -0
  120. package/src/components/integration-view/nodes/entry-node.tsx +98 -4
  121. package/src/components/integration-view/nodes/execution-entry-node.tsx +107 -0
  122. package/src/components/integration-view/nodes/execution-task-node.tsx +88 -0
  123. package/src/components/integration-view/nodes/group-node.tsx +33 -13
  124. package/src/components/integration-view/nodes/row-node.tsx +19 -0
  125. package/src/components/integration-view/nodes/task-node.tsx +50 -16
  126. package/src/components/integration-view/task-icon.tsx +193 -0
  127. package/src/components/integration-view/temp-data/initialElements.tsx +34 -32
  128. package/src/components/integration-view/types.ts +2 -2
  129. package/src/components/integration-view/utils/mapping.ts +404 -0
  130. package/src/components/layouts/main-layout.tsx +3 -4
  131. package/src/components/layouts/root-container.tsx +5 -11
  132. package/src/components/link-cards/link-card.tsx +15 -4
  133. package/src/components/link-cards/styles.ts +1 -1
  134. package/src/components/list-filter/date-filter.tsx +7 -4
  135. package/src/components/list-filter/date-range-filter.tsx +15 -7
  136. package/src/components/list-filter/index.ts +1 -1
  137. package/src/components/list-filter/list-filter.tsx +31 -26
  138. package/src/components/list-filter/multi-select-filter.tsx +11 -10
  139. package/src/components/list-filter/select-filter.tsx +23 -12
  140. package/src/components/scheduler/day-selector.tsx +29 -15
  141. package/src/components/scheduler/day-tag.tsx +14 -51
  142. package/src/components/scheduler/index.ts +2 -1
  143. package/src/components/scheduler/schedule-drawer/details-reducer.ts +217 -0
  144. package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +501 -0
  145. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +137 -100
  146. package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +94 -0
  147. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-skeleton.tsx +1 -2
  148. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details.tsx +10 -14
  149. package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +214 -0
  150. package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +7 -26
  151. package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +116 -0
  152. package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +130 -0
  153. package/src/components/scheduler/schedule-filter.ts +1 -1
  154. package/src/components/scheduler/schedule-icon.tsx +5 -6
  155. package/src/components/scheduler/schedule-integration-icon.tsx +31 -0
  156. package/src/components/templates/index.ts +1 -0
  157. package/src/components/templates/inputs/index.tsx +1392 -0
  158. package/src/components/templates/template-filter.ts +5 -0
  159. package/src/components/templates/templates-list/index.ts +1 -0
  160. package/src/components/templates/templates-list/templates-list-row.tsx +55 -0
  161. package/src/components/templates/templates-list/templates-list-table.tsx +58 -0
  162. package/src/components/templates/templates-list/templates-list.tsx +253 -0
  163. package/src/components/templates/types.tsx +76 -0
  164. package/src/components/templates/wizard.tsx +737 -0
  165. package/src/hooks/use-breadcrumbs.ts +1 -1
  166. package/src/hooks/use-recurrence.tsx +1 -2
  167. package/src/pages/dashboard/dashboard-link-cards.tsx +8 -11
  168. package/src/pages/dashboard/dashboard-list-sections.tsx +8 -10
  169. package/src/pages/dashboard/dashboard.tsx +1 -2
  170. package/src/pages/execution-details/execution-details.tsx +212 -14
  171. package/src/pages/execution-details/task-execution-details.tsx +160 -0
  172. package/src/pages/execution-details/task-execution-drawer.tsx +54 -0
  173. package/src/pages/executions/executions-list/executions-list-row.tsx +21 -27
  174. package/src/pages/executions/executions-list/executions-list-table.tsx +29 -36
  175. package/src/pages/executions/executions-list/executions-list.tsx +24 -18
  176. package/src/pages/executions/executions.tsx +11 -15
  177. package/src/pages/integration-create/index.ts +1 -0
  178. package/src/pages/integration-create/integration-create.tsx +216 -0
  179. package/src/pages/integration-create/pre-creation-step.tsx +84 -0
  180. package/src/pages/integration-create/select-step.tsx +105 -0
  181. package/src/pages/integration-create/template-list-step.tsx +77 -0
  182. package/src/pages/integration-create/wizard-step.tsx +51 -0
  183. package/src/pages/integration-details/import-process/copy-tasks-list.tsx +265 -0
  184. package/src/pages/integration-details/import-process/copy-tasks-row.tsx +77 -0
  185. package/src/pages/integration-details/import-process/import-confirm.tsx +61 -0
  186. package/src/pages/integration-details/import-process/import-drawer.tsx +48 -0
  187. package/src/pages/integration-details/import-process/import-process-reducer.ts +90 -0
  188. package/src/pages/integration-details/import-process/import-process.tsx +149 -0
  189. package/src/pages/integration-details/index.ts +1 -0
  190. package/src/pages/integration-details/integration-details.tsx +468 -0
  191. package/src/pages/integration-details/task-drawer/add-task.tsx +172 -0
  192. package/src/pages/integration-details/task-drawer/edit-task.tsx +161 -0
  193. package/src/pages/integration-details/task-drawer/task-drawer.tsx +157 -0
  194. package/src/pages/integration-details/task-drawer/task-reducer.ts +103 -0
  195. package/src/pages/integrations/integrations.tsx +11 -14
  196. package/src/pages/scheduler/scheduler.tsx +12 -24
  197. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +27 -37
  198. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +28 -43
  199. package/src/pages/scheduler/schedules-list/schedules-list.tsx +48 -21
  200. package/src/utils/date-functions.ts +69 -0
  201. package/src/utils/slugify.ts +3 -0
  202. package/tsconfig.json +12 -4
  203. package/src/hooks/use-timestamp.tsx +0 -25
  204. package/src/pages/integrations/integration-list/integration-list-row.tsx +0 -147
  205. package/src/pages/integrations/integration-list/integration-list-table.tsx +0 -78
  206. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +0 -227
  207. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +0 -77
  208. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +0 -72
  209. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +0 -103
  210. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +0 -101
  211. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +0 -93
  212. /package/src/{pages/integrations/integration-list → components/integration-list/list}/index.ts +0 -0
  213. /package/src/{pages → components}/scheduler/schedule-drawer/edited/edited-types.ts +0 -0
  214. /package/src/{pages → components}/scheduler/schedule-drawer/edited/index.ts +0 -0
  215. /package/src/{pages → components}/scheduler/schedule-drawer/index.ts +0 -0
@@ -0,0 +1,52 @@
1
+ import { OutlinedIconButton } from "@evenicanpm/admin-integrate/components/button";
2
+ import { Clear } from "@mui/icons-material";
3
+ import { Box, Divider, Stack, type Theme, useTheme } from "@mui/material";
4
+
5
+ interface Props {
6
+ handleClose: () => void;
7
+ children?: React.ReactNode; // e.g. add button, save button, etc.
8
+ }
9
+
10
+ export default function DrawerButtons(props: Readonly<Props>) {
11
+ const theme = useTheme();
12
+ const styles = getStyles(theme);
13
+
14
+ return (
15
+ <>
16
+ <Box sx={styles.buttons} display="flex" justifyContent="flex-end">
17
+ {/* <IconButton onClick={props.handleClose}>
18
+ <KeyboardDoubleArrowRightOutlined />
19
+ </IconButton> */}
20
+ <Stack spacing={1} direction="row">
21
+ {props.children}
22
+ <OutlinedIconButton
23
+ onClick={props.handleClose}
24
+ sx={styles.closeButton}
25
+ >
26
+ <Clear />
27
+ </OutlinedIconButton>
28
+ </Stack>
29
+ </Box>
30
+ <Divider sx={styles.divider} />
31
+ </>
32
+ );
33
+ }
34
+
35
+ const getStyles = (theme: Theme) => {
36
+ return {
37
+ buttons: {
38
+ padding: theme.spacing(2),
39
+ backgroundColor: "grey.100",
40
+ },
41
+ closeButton: {
42
+ backgroundColor: "error.main",
43
+ "&:hover": {
44
+ backgroundColor: "error.500",
45
+ },
46
+ color: "white",
47
+ },
48
+ divider: {
49
+ borderColor: "grey.400",
50
+ },
51
+ };
52
+ };
@@ -1,11 +1,11 @@
1
- import { useTranslations } from "next-intl";
2
1
  import { Typography } from "@mui/material";
2
+ import { useTranslations } from "next-intl";
3
3
 
4
4
  interface Props {
5
5
  edited: boolean;
6
6
  }
7
7
 
8
- export default function EditedTypography(props: Props) {
8
+ export default function EditedTypography(props: Readonly<Props>) {
9
9
  const t = useTranslations("Integrate.Scheduler");
10
10
 
11
11
  return (
@@ -1,4 +1,6 @@
1
- export { default as Loading } from "./loading";
2
1
  export { default as DateTimePopover } from "./date-time-popover";
3
- export { default as TitleEdit } from "./title-edit";
2
+ export { default as DrawerButtons } from "./drawer-buttons";
4
3
  export { default as EditedTypography } from "./edited-typography";
4
+ export { default as Loading } from "./loading";
5
+ export { default as StatusTag } from "./status-tag";
6
+ export { default as TitleEdit } from "./title-edit";
@@ -1,6 +1,6 @@
1
- import CircularProgress from "@mui/material/CircularProgress";
2
1
  import FlexRowCenter from "@evenicanpm/admin-core/components/flex-box/flex-row-center";
3
2
  import { useTheme } from "@mui/material";
3
+ import CircularProgress from "@mui/material/CircularProgress";
4
4
 
5
5
  const Loading = () => {
6
6
  const theme = useTheme();
@@ -0,0 +1,97 @@
1
+ import { Box, type SxProps, Typography } from "@mui/material";
2
+ import { styled } from "@mui/material/styles";
3
+
4
+ // Styled components
5
+ const StyledTagBox = styled(Box)(({ theme }) => ({
6
+ padding: theme.spacing(0, 1.5),
7
+ border: "solid 1px",
8
+ borderRadius: 4,
9
+ alignContent: "center",
10
+ maxWidth: "fit-content",
11
+ maxHeight: "fit-content",
12
+ }));
13
+ const StyledTag = styled(Typography)(() => ({
14
+ fontWeight: "bold",
15
+ }));
16
+
17
+ type Status = "info" | "success" | "warning" | "error" | "unavailable";
18
+
19
+ interface Props {
20
+ type: Status;
21
+ text: string;
22
+ sx?: SxProps;
23
+ }
24
+
25
+ export default function StatusTag(props: Props) {
26
+ const statusTagMap: { [key in Status]: React.ReactNode } = {
27
+ info: (
28
+ <StyledTagBox
29
+ sx={{
30
+ backgroundColor: "info.100",
31
+ borderColor: "info.main",
32
+ ...props.sx,
33
+ }}
34
+ >
35
+ <StyledTag color="info" variant="caption">
36
+ {props.text}
37
+ </StyledTag>
38
+ </StyledTagBox>
39
+ ),
40
+ success: (
41
+ <StyledTagBox
42
+ sx={{
43
+ backgroundColor: "success.100",
44
+ borderColor: "success.main",
45
+ ...props.sx,
46
+ }}
47
+ >
48
+ <StyledTag color="success" variant="caption">
49
+ {props.text}
50
+ </StyledTag>
51
+ </StyledTagBox>
52
+ ),
53
+ warning: (
54
+ <StyledTagBox
55
+ sx={{
56
+ backgroundColor: "warning.100",
57
+ borderColor: "orange.700",
58
+ color: "orange.700",
59
+ ...props.sx,
60
+ }}
61
+ >
62
+ <StyledTag color="inherit" variant="caption">
63
+ {props.text}
64
+ </StyledTag>
65
+ </StyledTagBox>
66
+ ),
67
+ error: (
68
+ <StyledTagBox
69
+ sx={{
70
+ backgroundColor: "error.100",
71
+ borderColor: "error.main",
72
+ ...props.sx,
73
+ }}
74
+ >
75
+ <StyledTag color="error" variant="caption">
76
+ {props.text}
77
+ </StyledTag>
78
+ </StyledTagBox>
79
+ ),
80
+ unavailable: (
81
+ <StyledTagBox
82
+ sx={{
83
+ backgroundColor: "grey.300",
84
+ borderColor: "grey.700",
85
+ color: "grey.700",
86
+ ...props.sx,
87
+ }}
88
+ >
89
+ <StyledTag color="inherit" variant="caption">
90
+ {props.text}
91
+ </StyledTag>
92
+ </StyledTagBox>
93
+ ),
94
+ };
95
+
96
+ return statusTagMap[props.type] || statusTagMap["unavailable" as Status];
97
+ }
@@ -1,17 +1,16 @@
1
- import { useState } from "react";
2
-
3
- import { Theme, useTheme } from "@mui/material";
1
+ import { OutlinedIconButton } from "@evenicanpm/admin-integrate/components/button";
2
+ import { Check, Clear, EditOutlined } from "@mui/icons-material";
4
3
  import {
5
4
  Box,
5
+ IconButton,
6
6
  Stack,
7
- Typography,
8
7
  TextField,
9
- IconButton,
10
- TypographyOwnProps,
8
+ type Theme,
9
+ Typography,
10
+ type TypographyOwnProps,
11
+ useTheme,
11
12
  } from "@mui/material";
12
- import { EditOutlined, Clear, Check } from "@mui/icons-material";
13
-
14
- import { OutlinedIconButton } from "@evenicanpm/admin-integrate/components/button";
13
+ import { useEffect, useState } from "react";
15
14
 
16
15
  interface Props {
17
16
  title: string;
@@ -21,7 +20,7 @@ interface Props {
21
20
  variant?: TypographyOwnProps["variant"];
22
21
  }
23
22
 
24
- export default function TitleEdit(props: Props) {
23
+ export default function TitleEdit(props: Readonly<Props>) {
25
24
  const theme = useTheme();
26
25
  const styles = getStyles(theme);
27
26
 
@@ -42,7 +41,11 @@ export default function TitleEdit(props: Props) {
42
41
  };
43
42
 
44
43
  const handleConfirm = () => {
45
- props.onConfirm(input);
44
+ // NOSONAR - regex replacement requires replace, not replaceAll
45
+ // replaceAll - Doesn’t properly handle \s+ logic - Misleading Sonar suggestion
46
+ const trimmed = input.trim().replace(/\s+/g, " ");
47
+ props.onConfirm(trimmed);
48
+ setInput(trimmed);
46
49
  setEditMode(false);
47
50
  };
48
51
 
@@ -52,6 +55,12 @@ export default function TitleEdit(props: Props) {
52
55
  }
53
56
  };
54
57
 
58
+ useEffect(() => {
59
+ if (props.readOnly) {
60
+ handleClose();
61
+ }
62
+ }, [props.readOnly]);
63
+
55
64
  return (
56
65
  <>
57
66
  <Box
@@ -63,11 +72,7 @@ export default function TitleEdit(props: Props) {
63
72
  justifyContent="flex-start"
64
73
  alignItems="center"
65
74
  >
66
- {!editMode ? (
67
- <Typography sx={styles.name} variant={props.variant || "h6"}>
68
- {props.title}
69
- </Typography>
70
- ) : (
75
+ {editMode ? (
71
76
  <TextField
72
77
  sx={styles.input}
73
78
  fullWidth={props.fullWidth}
@@ -77,15 +82,15 @@ export default function TitleEdit(props: Props) {
77
82
  onChange={handleChange}
78
83
  onKeyDown={handleKeyDown}
79
84
  />
85
+ ) : (
86
+ <Typography sx={styles.name} variant={props.variant || "h6"}>
87
+ {props.title}
88
+ </Typography>
80
89
  )}
81
90
  </Box>
82
91
  {!props.readOnly && (
83
92
  <Box display="flex" justifyContent="flex-end" alignItems="center">
84
- {!editMode ? (
85
- <IconButton onClick={handleClickEdit}>
86
- <EditOutlined />
87
- </IconButton>
88
- ) : (
93
+ {editMode ? (
89
94
  <Stack direction="row" spacing={1}>
90
95
  <OutlinedIconButton color="error" onClick={handleClose}>
91
96
  <Clear />
@@ -93,11 +98,15 @@ export default function TitleEdit(props: Props) {
93
98
  <OutlinedIconButton
94
99
  color="success"
95
100
  onClick={handleConfirm}
96
- disabled={input === ""}
101
+ disabled={!/(.|\s)*\S(.|\s)*/.test(input)}
97
102
  >
98
103
  <Check />
99
104
  </OutlinedIconButton>
100
105
  </Stack>
106
+ ) : (
107
+ <IconButton onClick={handleClickEdit}>
108
+ <EditOutlined />
109
+ </IconButton>
101
110
  )}
102
111
  </Box>
103
112
  )}
@@ -1,26 +1,26 @@
1
- import React, { useState } from "react";
2
- import { redirect, RedirectType } from "next/navigation";
3
-
4
- // MUI
5
- import { Theme, useTheme } from "@mui/material";
6
- import { Box, Stack, Typography, Popover } from "@mui/material";
7
- import { RemoveRedEye } from "@mui/icons-material";
8
-
9
- // Custom components
1
+ import { DateTimePopover } from "@evenicanpm/admin-integrate/components/core";
10
2
  import {
3
+ StyledIconButton,
11
4
  StyledTableCell,
12
5
  StyledTableRow,
13
- StyledIconButton,
14
6
  } from "@evenicanpm/admin-integrate/components/data-table/table-row";
15
7
  import { ExecutionStatusIcon } from "@evenicanpm/admin-integrate/components/execution";
16
-
17
- // Hooks
18
- import useTimestamp from "@evenicanpm/admin-integrate/hooks/use-timestamp";
19
-
20
- // Types
21
- import { Item } from "./dashboard-list";
22
- import { Head } from "../data-table/table-header";
23
- import { TableCellProps, SxProps } from "@mui/material";
8
+ import { toDistanceDate } from "@evenicanpm/admin-integrate/utils/date-functions";
9
+ import { RemoveRedEye } from "@mui/icons-material";
10
+ import {
11
+ Box,
12
+ Stack,
13
+ type SxProps,
14
+ type TableCellProps,
15
+ type Theme,
16
+ Typography,
17
+ useTheme,
18
+ } from "@mui/material";
19
+ import { RedirectType, redirect } from "next/navigation";
20
+ import type React from "react";
21
+ import { useState } from "react";
22
+ import type { Head } from "../data-table/table-header";
23
+ import type { Item } from "./dashboard-list";
24
24
 
25
25
  interface Props {
26
26
  item: Item;
@@ -33,10 +33,6 @@ const DashboardListRow: React.FC<Props> = (props: Props) => {
33
33
  const theme = useTheme();
34
34
  const styles = getStyles(theme);
35
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
36
  const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
41
37
  const open = Boolean(anchorEl);
42
38
 
@@ -96,9 +92,10 @@ const DashboardListRow: React.FC<Props> = (props: Props) => {
96
92
  onMouseEnter={handlePopoverOpen}
97
93
  onMouseLeave={handlePopoverClose}
98
94
  >
99
- {time}
95
+ {toDistanceDate(props.item.startDate)}
100
96
  </Typography>
101
- <Popover
97
+ <DateTimePopover
98
+ dateIsoString={props.item.startDate}
102
99
  sx={{ pointerEvents: "none" }}
103
100
  open={open}
104
101
  anchorEl={anchorEl}
@@ -112,11 +109,7 @@ const DashboardListRow: React.FC<Props> = (props: Props) => {
112
109
  }}
113
110
  onClose={handlePopoverClose}
114
111
  disableRestoreFocus
115
- >
116
- <Box sx={styles.popover}>
117
- <Typography>{localTime}</Typography>
118
- </Box>
119
- </Popover>
112
+ />
120
113
  </StyledTableCell>
121
114
  <StyledTableCell
122
115
  align={props.heading[2].align as TableCellProps["align"]}
@@ -1,23 +1,27 @@
1
- import React, { useState, useEffect } from "react";
2
- import { useTranslations } from "next-intl";
3
-
4
1
  // API
5
- import { GetProcessExecutionsQuery } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
6
-
7
- // MUI
8
- import { Card, Table, TableContainer, TableBody, Box } from "@mui/material";
9
- import { Theme, useTheme } from "@mui/material";
10
-
2
+ import type { GetProcessExecutionsQuery } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
11
3
  // Custom components
12
4
  import { FlexBox } from "@evenicanpm/admin-core/components/flex-box";
13
-
5
+ // MUI
6
+ import {
7
+ Box,
8
+ Card,
9
+ Stack,
10
+ Table,
11
+ TableBody,
12
+ TableContainer,
13
+ type Theme,
14
+ Typography,
15
+ useTheme,
16
+ } from "@mui/material";
17
+ import { useTranslations } from "next-intl";
18
+ import type React from "react";
19
+ import { useEffect, useState } from "react";
14
20
  import { TableHeader, TableSkeleton } from "../data-table";
15
- import DashboardListRow from "./dashboard-list-row";
16
- import { DashboardListHeader } from "../header/";
17
-
18
21
  // Types
19
- import { Head } from "../data-table/table-header";
20
- import { Typography, Stack } from "@mui/material";
22
+ import type { Head } from "../data-table/table-header";
23
+ import { DashboardListHeader } from "../header/";
24
+ import DashboardListRow from "./dashboard-list-row";
21
25
 
22
26
  // Returned from processExecutions query
23
27
  export interface Item {
@@ -91,7 +95,7 @@ const DashboardList: React.FC<Props> = (props: Props) => {
91
95
  <TableBody>
92
96
  {items.map((item, index) => (
93
97
  <DashboardListRow
94
- key={index}
98
+ key={`list-row-${index + 1}`}
95
99
  item={item}
96
100
  heading={props.heading}
97
101
  enableBgColor={props.enableBgColor}
@@ -1,12 +1,10 @@
1
- import TableRow from "@mui/material/TableRow";
1
+ import { ExpandLess, ExpandMore } from "@mui/icons-material";
2
+ import { type SxProps, type Theme, useTheme } from "@mui/material";
3
+ import styled from "@mui/material/styles/styled";
4
+ import TableCell, { type TableCellProps } from "@mui/material/TableCell";
2
5
  import TableHead from "@mui/material/TableHead";
6
+ import TableRow from "@mui/material/TableRow";
3
7
  import TableSortLabel from "@mui/material/TableSortLabel";
4
- import TableCell, { TableCellProps } from "@mui/material/TableCell";
5
- import styled from "@mui/material/styles/styled";
6
-
7
- import { SxProps } from "@mui/material";
8
- import { Theme, useTheme } from "@mui/material";
9
- import { ExpandLess, ExpandMore } from "@mui/icons-material";
10
8
 
11
9
  // STYLED COMPONENTS
12
10
  const StyledTableCell = styled(TableCell)(({ theme }) => ({
@@ -38,7 +36,7 @@ export default function TableHeader({
38
36
  orderBy,
39
37
  onRequestSort,
40
38
  rowSx,
41
- }: Props) {
39
+ }: Readonly<Props>) {
42
40
  const theme = useTheme();
43
41
  const styles = getStyles(theme);
44
42
 
@@ -1,4 +1,4 @@
1
- import Pagination, { PaginationProps } from "@mui/material/Pagination";
1
+ import Pagination, { type PaginationProps } from "@mui/material/Pagination";
2
2
  import styled from "@mui/material/styles/styled";
3
3
 
4
4
  // STYLED COMPONENT
@@ -1,5 +1,5 @@
1
+ import { IconButton, TableCell, TableRow } from "@mui/material";
1
2
  import styled from "@mui/material/styles/styled";
2
- import { TableRow, TableCell, IconButton } from "@mui/material";
3
3
 
4
4
  const StyledTableCell = styled(TableCell)(({ theme }) => ({
5
5
  fontSize: 14,
@@ -1,8 +1,13 @@
1
- import { TableContainer, Table, TableBody, Skeleton } from "@mui/material";
2
- import { SxProps } from "@mui/material";
1
+ import {
2
+ Skeleton,
3
+ type SxProps,
4
+ Table,
5
+ TableBody,
6
+ TableContainer,
7
+ } from "@mui/material";
3
8
 
4
- import TableHeader, { Head } from "./table-header";
5
- import { StyledTableRow, StyledTableCell } from "./table-row";
9
+ import TableHeader, { type Head } from "./table-header";
10
+ import { StyledTableCell, StyledTableRow } from "./table-row";
6
11
 
7
12
  interface Props {
8
13
  heading: Head[];
@@ -11,7 +16,7 @@ interface Props {
11
16
  rowSx?: SxProps;
12
17
  }
13
18
 
14
- export default function TableSkeleton(props: Props) {
19
+ export default function TableSkeleton(props: Readonly<Props>) {
15
20
  const rangeArray: number[] = Array.from(
16
21
  { length: props.perPage },
17
22
  (_, i) => i,
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  DateRangeFilter,
3
3
  Filters,
4
4
  MultiSelectFilter,
@@ -1,21 +1,21 @@
1
- import React from "react";
2
-
3
- import { SxProps } from "@mui/material";
4
1
  import {
5
- Loop,
6
2
  CheckCircleOutline,
7
- WarningAmber,
8
- ErrorOutline,
9
3
  Clear,
4
+ ErrorOutline,
5
+ Loop,
6
+ WarningAmber,
10
7
  } from "@mui/icons-material";
11
8
 
9
+ import type { SxProps } from "@mui/material";
10
+ import type React from "react";
11
+
12
12
  interface Props {
13
13
  executionStatusId: string;
14
14
  sx?: SxProps;
15
15
  }
16
16
 
17
17
  const ExecutionStatusIcon: React.FC<Props> = (props: Props) => {
18
- const statusIconMap: { [key: string]: any } = {
18
+ const statusIconMap: { [key: string]: React.ReactNode } = {
19
19
  "300": <Loop color="info" />,
20
20
  "400": <CheckCircleOutline color="success" />,
21
21
  "450": <WarningAmber color="warning" />,
@@ -1,22 +1,7 @@
1
- import React from "react";
1
+ import { StatusTag } from "@evenicanpm/admin-integrate/components/core";
2
+ import type { SxProps } from "@mui/material";
2
3
  import { useTranslations } from "next-intl";
3
4
 
4
- import { styled } from "@mui/material/styles";
5
- import { Box, Typography, SxProps } from "@mui/material";
6
-
7
- // Styled components
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",
14
- maxHeight: "fit-content",
15
- }));
16
- const StyledTag = styled(Typography)(() => ({
17
- fontWeight: "bold",
18
- }));
19
-
20
5
  interface Props {
21
6
  executionStatusId: string;
22
7
  sx?: SxProps;
@@ -25,73 +10,23 @@ interface Props {
25
10
  const ExecutionTag: React.FC<Props> = (props: Props) => {
26
11
  const t = useTranslations("Integrate");
27
12
 
28
- const statusTagMap: { [key: string]: any } = {
13
+ const statusTagMap: { [key: string]: React.ReactNode } = {
29
14
  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>
15
+ <StatusTag type="info" text={t("Executions.inProgress")} sx={props.sx} />
41
16
  ),
42
17
  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>
18
+ <StatusTag type="success" text={t("Executions.complete")} sx={props.sx} />
54
19
  ),
55
20
  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>
21
+ <StatusTag type="warning" text={t("Executions.warning")} sx={props.sx} />
81
22
  ),
23
+ 500: <StatusTag type="error" text={t("Executions.failed")} sx={props.sx} />,
82
24
  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>
25
+ <StatusTag
26
+ type="unavailable"
27
+ text={t("Executions.unavailable")}
28
+ sx={props.sx}
29
+ />
95
30
  ),
96
31
  };
97
32
 
@@ -1,2 +1,2 @@
1
- export { default as ExecutionTag } from "./execution-tag";
2
1
  export { default as ExecutionStatusIcon } from "./execution-status-icon";
2
+ export { default as ExecutionTag } from "./execution-tag";