@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.
Files changed (114) hide show
  1. package/documents/Process/fragments.ts +13 -0
  2. package/documents/Process/list.ts +27 -0
  3. package/documents/ProcessSchedule/fragments.ts +24 -0
  4. package/documents/ProcessSchedule/read.ts +12 -0
  5. package/documents/ProcessScheduleGroup/fragments.ts +29 -0
  6. package/documents/ProcessScheduleGroup/read.ts +12 -0
  7. package/documents/ScheduledProcess/fragments.ts +24 -0
  8. package/documents/ScheduledProcess/list.ts +27 -0
  9. package/package.json +21 -17
  10. package/src/api/Integrations/queries/get-process.query.ts +48 -0
  11. package/src/api/Integrations/queries/get-process.server.ts +9 -0
  12. package/src/api/Integrations/queries/index.ts +1 -0
  13. package/src/api/dashboard/queries/get-process-executions.query.ts +33 -36
  14. package/src/api/dashboard/queries/get-process-executions.server.ts +4 -4
  15. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +45 -0
  16. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +14 -0
  17. package/src/api/scheduler/queries/get-process-schedule.query.ts +45 -0
  18. package/src/api/scheduler/queries/get-process-schedule.server.ts +14 -0
  19. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +45 -0
  20. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +11 -0
  21. package/src/api/scheduler/queries/index.ts +3 -0
  22. package/src/components/breadcrumbs/breadcrumbs.tsx +23 -26
  23. package/src/components/breadcrumbs/index.ts +1 -1
  24. package/src/components/breadcrumbs/types.tsx +4 -0
  25. package/src/components/button/outlined-icon-button.tsx +26 -38
  26. package/src/components/core/date-time-popover.tsx +32 -0
  27. package/src/components/core/edited-typography.tsx +20 -0
  28. package/src/components/core/index.ts +3 -0
  29. package/src/components/core/loading.tsx +6 -6
  30. package/src/components/core/title-edit.tsx +122 -0
  31. package/src/components/dashboard-list/dashboard-list-row.tsx +114 -115
  32. package/src/components/dashboard-list/dashboard-list.tsx +119 -119
  33. package/src/components/data-table/table-header.tsx +85 -81
  34. package/src/components/data-table/table-pagination.tsx +27 -27
  35. package/src/components/data-table/table-row.tsx +14 -14
  36. package/src/components/data-table/table-skeleton.tsx +34 -34
  37. package/src/components/execution/execution-filter.ts +22 -22
  38. package/src/components/execution/execution-status-icon.tsx +16 -17
  39. package/src/components/execution/execution-tag.tsx +81 -80
  40. package/src/components/footer/footer.tsx +34 -34
  41. package/src/components/header/dashboard-list-header.tsx +64 -63
  42. package/src/components/header/execution-details-header.tsx +102 -129
  43. package/src/components/header/header.tsx +27 -27
  44. package/src/components/header/index.ts +1 -0
  45. package/src/components/header/integration-details-header.tsx +99 -0
  46. package/src/components/icons/up-down.tsx +15 -15
  47. package/src/components/integration-list/index.ts +2 -0
  48. package/src/components/integration-list/integration-filter.ts +21 -0
  49. package/src/components/integration-list/integration-status-icon.tsx +33 -0
  50. package/src/components/integration-list/integration-tag.tsx +77 -0
  51. package/src/components/integration-view/edges/default-edge.tsx +18 -17
  52. package/src/components/integration-view/elk-layout-options.ts +26 -26
  53. package/src/components/integration-view/elk-types.ts +16 -12
  54. package/src/components/integration-view/flow-types.tsx +5 -5
  55. package/src/components/integration-view/integration-view.tsx +132 -130
  56. package/src/components/integration-view/nodes/base-node.tsx +50 -0
  57. package/src/components/integration-view/nodes/connection-node.tsx +8 -8
  58. package/src/components/integration-view/nodes/entry-node.tsx +8 -8
  59. package/src/components/integration-view/nodes/group-node.tsx +47 -6
  60. package/src/components/integration-view/nodes/task-node.tsx +58 -13
  61. package/src/components/integration-view/temp-data/initialElements.tsx +224 -0
  62. package/src/components/integration-view/types.ts +6 -6
  63. package/src/components/layouts/main-layout.tsx +13 -13
  64. package/src/components/layouts/root-container.tsx +25 -25
  65. package/src/components/link-cards/link-card.tsx +23 -23
  66. package/src/components/link-cards/styles.ts +15 -15
  67. package/src/components/list-filter/date-filter.tsx +41 -45
  68. package/src/components/list-filter/date-range-filter.tsx +78 -77
  69. package/src/components/list-filter/list-filter-types.ts +38 -38
  70. package/src/components/list-filter/list-filter.tsx +363 -354
  71. package/src/components/list-filter/multi-select-filter.tsx +94 -95
  72. package/src/components/list-filter/select-filter.tsx +67 -64
  73. package/src/components/scheduler/day-selector.tsx +174 -0
  74. package/src/components/scheduler/day-tag.tsx +73 -0
  75. package/src/components/scheduler/index.ts +4 -0
  76. package/src/components/scheduler/schedule-filter.ts +25 -0
  77. package/src/components/scheduler/schedule-icon.tsx +87 -0
  78. package/src/components/scheduler/scheduler-types.ts +40 -0
  79. package/src/hooks/use-breadcrumbs.ts +31 -31
  80. package/src/hooks/use-recurrence.tsx +13 -0
  81. package/src/hooks/use-timestamp.tsx +21 -21
  82. package/src/pages/dashboard/dashboard-link-cards.tsx +99 -99
  83. package/src/pages/dashboard/dashboard-list-sections.tsx +130 -125
  84. package/src/pages/dashboard/dashboard.tsx +6 -6
  85. package/src/pages/execution-details/execution-details.tsx +23 -29
  86. package/src/pages/executions/executions-list/executions-list-row.tsx +101 -104
  87. package/src/pages/executions/executions-list/executions-list-table.tsx +45 -53
  88. package/src/pages/executions/executions-list/executions-list.tsx +219 -212
  89. package/src/pages/executions/executions.tsx +67 -72
  90. package/src/pages/integrations/integration-list/index.ts +1 -0
  91. package/src/pages/integrations/integration-list/integration-list-row.tsx +147 -0
  92. package/src/pages/integrations/integration-list/integration-list-table.tsx +78 -0
  93. package/src/pages/integrations/integration-list/integration-list.tsx +262 -0
  94. package/src/pages/integrations/integrations.tsx +83 -28
  95. package/src/pages/scheduler/schedule-drawer/edited/edited-types.ts +17 -0
  96. package/src/pages/scheduler/schedule-drawer/edited/index.ts +1 -0
  97. package/src/pages/scheduler/schedule-drawer/index.ts +1 -0
  98. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +227 -0
  99. package/src/pages/scheduler/schedule-drawer/schedule-details-main.tsx +292 -0
  100. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +77 -0
  101. package/src/pages/scheduler/schedule-drawer/schedule-details-skeleton.tsx +64 -0
  102. package/src/pages/scheduler/schedule-drawer/schedule-details.tsx +42 -0
  103. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +72 -0
  104. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +103 -0
  105. package/src/pages/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +94 -0
  106. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +101 -0
  107. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +93 -0
  108. package/src/pages/scheduler/scheduler.tsx +106 -30
  109. package/src/pages/scheduler/schedules-list/index.ts +1 -0
  110. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +235 -0
  111. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +74 -0
  112. package/src/pages/scheduler/schedules-list/schedules-list.tsx +280 -0
  113. package/tsconfig.json +29 -26
  114. package/src/components/integration-view/temp-data/initialElements.ts +0 -238
@@ -0,0 +1,224 @@
1
+ import { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "../elk-types";
2
+
3
+ import StorageIcon from "@mui/icons-material/Storage";
4
+ import TableChartIcon from "@mui/icons-material/TableChart";
5
+ import SystemUpdateAltIcon from "@mui/icons-material/SystemUpdateAlt";
6
+
7
+ import { MarkerType } from "@xyflow/react";
8
+ import { Box } from "@mui/material";
9
+
10
+ const pullIcon = () => {
11
+ return (
12
+ <Box
13
+ sx={{
14
+ display: "flex",
15
+ alignItems: "center",
16
+ justifyContent: "center",
17
+ borderRadius: "5px",
18
+ bgcolor: "success.100",
19
+ borderWidth: 1,
20
+ borderStyle: "solid",
21
+ borderColor: "success.600",
22
+ padding: "2px",
23
+ }}
24
+ >
25
+ <StorageIcon sx={{ color: "success.500" }} />
26
+ </Box>
27
+ );
28
+ };
29
+
30
+ const chartIcon = () => {
31
+ return (
32
+ <Box
33
+ sx={{
34
+ display: "flex",
35
+ alignItems: "center",
36
+ justifyContent: "center",
37
+ borderRadius: "5px",
38
+ bgcolor: "paste.100",
39
+ borderWidth: 1,
40
+ borderStyle: "solid",
41
+ borderColor: "paste.600",
42
+ padding: "2px",
43
+ }}
44
+ >
45
+ <TableChartIcon sx={{ color: "paste.600" }} />
46
+ </Box>
47
+ );
48
+ };
49
+
50
+ const inputIcon = () => {
51
+ return (
52
+ <Box>
53
+ <SystemUpdateAltIcon sx={{ color: "grey.600" }} />
54
+ </Box>
55
+ );
56
+ };
57
+
58
+ export const initialNodes: ElkNodeWithFlow[] = [
59
+ {
60
+ id: "1",
61
+ type: "task-node",
62
+ data: { label: "Set Entry Point", icon: inputIcon() },
63
+ width: 450,
64
+ height: 70,
65
+ position: { x: 0, y: 0 },
66
+ layoutOptions: {
67
+ "org.eclipse.elk.priority": "1",
68
+ },
69
+ },
70
+
71
+ {
72
+ id: "2",
73
+ data: { label: "Group 1" },
74
+ position: { x: 0, y: 0 },
75
+ type: "group-node",
76
+ children: [
77
+ {
78
+ id: "2gs",
79
+ data: {
80
+ label: "Pull Data From External MS DB 1",
81
+ icon: pullIcon(),
82
+ isLast: true,
83
+ },
84
+ position: { x: 0, y: 0 },
85
+ type: "task-node",
86
+ width: 450,
87
+ height: 70,
88
+ extent: "parent",
89
+ },
90
+
91
+ {
92
+ id: "2g1",
93
+ data: {
94
+ label: "Stage Data 1",
95
+ icon: chartIcon(),
96
+ },
97
+ position: { x: 0, y: 0 },
98
+ width: 450,
99
+ height: 70,
100
+ type: "task-node",
101
+ extent: "parent",
102
+ },
103
+ {
104
+ id: "2gconnect1",
105
+ position: { x: 0, y: 0 },
106
+ type: "connection-node",
107
+ width: 1,
108
+ height: 1,
109
+ extent: "parent",
110
+ },
111
+ {
112
+ id: "2g3",
113
+ data: {
114
+ label: "Stage Data 2",
115
+ icon: chartIcon(),
116
+ },
117
+ position: { x: 0, y: 0 },
118
+ type: "task-node",
119
+ width: 450,
120
+ height: 70,
121
+ extent: "parent",
122
+ },
123
+ {
124
+ id: "2g4",
125
+ data: {
126
+ label: "Process Data",
127
+ icon: chartIcon(),
128
+ isLast: true,
129
+ },
130
+ position: { x: 0, y: 0 },
131
+ type: "task-node",
132
+ width: 450,
133
+ height: 70,
134
+ extent: "parent",
135
+ },
136
+ {
137
+ id: "2gconnect2",
138
+ position: { x: 0, y: 0 },
139
+ type: "connection-node",
140
+ width: 1,
141
+ height: 1,
142
+ extent: "parent",
143
+ },
144
+ {
145
+ id: "2g2",
146
+ data: {
147
+ label: "Stage Data 3",
148
+ icon: chartIcon(),
149
+ isLast: true,
150
+ },
151
+ position: { x: 0, y: 0 },
152
+ type: "task-node",
153
+ width: 450,
154
+ height: 70,
155
+ extent: "parent",
156
+ },
157
+ ],
158
+ layoutOptions: {
159
+ "org.eclipse.elk.priority": "2",
160
+ },
161
+ },
162
+ ];
163
+
164
+ const markerEnd = {
165
+ type: MarkerType.ArrowClosed,
166
+ width: 20,
167
+ height: 20,
168
+ };
169
+
170
+ export const initialEdges: ElkExtendedEdgeWithFlow[] = [
171
+ { id: "e1-2", sources: ["1"], targets: ["2"], type: "default-edge" },
172
+ {
173
+ id: "2gs-2gc",
174
+ sources: ["2gs"],
175
+ targets: ["2gconnect1"],
176
+ type: "default-edge",
177
+ },
178
+ {
179
+ id: "2gs-2g1",
180
+ sources: ["2gconnect1"],
181
+ targets: ["2g1"],
182
+ type: "default-edge",
183
+ markerEnd: markerEnd,
184
+ },
185
+ {
186
+ id: "2gs-2g2",
187
+ sources: ["2gconnect1"],
188
+ targets: ["2g2"],
189
+ type: "default-edge",
190
+ markerEnd: markerEnd,
191
+ },
192
+ {
193
+ id: "2gs-2g3",
194
+ sources: ["2gconnect1"],
195
+ targets: ["2g3"],
196
+ type: "default-edge",
197
+ markerEnd: markerEnd,
198
+ },
199
+ {
200
+ id: "2g1-2g4",
201
+ sources: ["2g1"],
202
+ targets: ["2gconnect2"],
203
+ type: "default-edge",
204
+ },
205
+ {
206
+ id: "2g2-2g4",
207
+ sources: ["2g2"],
208
+ targets: ["2gconnect2"],
209
+ type: "default-edge",
210
+ },
211
+ {
212
+ id: "2g3-2g4",
213
+ sources: ["2g3"],
214
+ targets: ["2gconnect2"],
215
+ type: "default-edge",
216
+ },
217
+ {
218
+ id: "2gc-2g4",
219
+ sources: ["2gconnect2"],
220
+ targets: ["2g4"],
221
+ type: "default-edge",
222
+ markerEnd: markerEnd,
223
+ },
224
+ ];
@@ -3,10 +3,10 @@ interface ElkOptions {}
3
3
  interface ElkPosition {}
4
4
 
5
5
  interface ElkItem {
6
- id: string;
7
- type: "input";
8
- data: { label: string };
9
- x: number;
10
- y: number;
11
- layoutOptions: ElkOptions;
6
+ id: string;
7
+ type: "input";
8
+ data: { label: string };
9
+ x: number;
10
+ y: number;
11
+ layoutOptions: ElkOptions;
12
12
  }
@@ -7,22 +7,22 @@ import DashboardSidebar from "@evenicanpm/admin-core/components/layouts/main-das
7
7
  import { LayoutProvider } from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-layout-context";
8
8
 
9
9
  // STYLED COMPONENT
10
- const StyledContainer = styled("div")(({ theme }) => ({
11
- margin: 0,
12
- padding: 0,
10
+ const StyledContainer = styled("div")(() => ({
11
+ margin: 0,
12
+ padding: 0,
13
13
  }));
14
14
 
15
15
  export default function MainLayout({
16
- children,
16
+ children,
17
17
  }: {
18
- children: React.ReactNode;
18
+ children: React.ReactNode;
19
19
  }) {
20
- return (
21
- <LayoutProvider>
22
- <DashboardSidebar />
23
- <BodyWrapper>
24
- <StyledContainer>{children}</StyledContainer>
25
- </BodyWrapper>
26
- </LayoutProvider>
27
- );
20
+ return (
21
+ <LayoutProvider>
22
+ <DashboardSidebar />
23
+ <BodyWrapper>
24
+ <StyledContainer>{children}</StyledContainer>
25
+ </BodyWrapper>
26
+ </LayoutProvider>
27
+ );
28
28
  }
@@ -7,37 +7,37 @@ import { SxProps, Breakpoint } from "@mui/system";
7
7
  import { IntegrateFooter } from "@evenicanpm/admin-integrate/components/footer";
8
8
 
9
9
  interface Props {
10
- maxWidth?: false | Breakpoint;
11
- children: React.ReactNode;
12
- sx?: SxProps;
10
+ maxWidth?: false | Breakpoint;
11
+ children: React.ReactNode;
12
+ sx?: SxProps;
13
13
  }
14
14
 
15
15
  export default function RootContainer(props: Props) {
16
- const theme = useTheme();
17
- const styles = getStyles(theme);
16
+ const theme = useTheme();
17
+ const styles = getStyles(theme);
18
18
 
19
- const defaultMaxWidth = "xl";
19
+ const defaultMaxWidth = "xl";
20
20
 
21
- return (
22
- <Container
23
- maxWidth={props.maxWidth !== undefined ? props.maxWidth : defaultMaxWidth}
24
- sx={props.sx}
25
- >
26
- <Box sx={styles.root}>
27
- <Stack spacing={2}>{props.children}</Stack>
28
- <IntegrateFooter />
29
- </Box>
30
- </Container>
31
- );
21
+ return (
22
+ <Container
23
+ maxWidth={props.maxWidth !== undefined ? props.maxWidth : defaultMaxWidth}
24
+ sx={props.sx}
25
+ >
26
+ <Box sx={styles.root}>
27
+ <Stack spacing={2}>{props.children}</Stack>
28
+ <IntegrateFooter />
29
+ </Box>
30
+ </Container>
31
+ );
32
32
  }
33
33
 
34
34
  const getStyles = (theme: Theme) => {
35
- return {
36
- root: {
37
- margin: theme.spacing(3, 4),
38
- display: "flex",
39
- flexDirection: "column",
40
- minHeight: `calc(100vh - ${theme.spacing(20)})`,
41
- },
42
- };
35
+ return {
36
+ root: {
37
+ margin: theme.spacing(3, 4),
38
+ display: "flex",
39
+ flexDirection: "column",
40
+ minHeight: `calc(100vh - ${theme.spacing(20)})`,
41
+ },
42
+ };
43
43
  };
@@ -6,31 +6,31 @@ import { Box, CardActionArea } from "@mui/material";
6
6
 
7
7
  // ============================================================
8
8
  type Props = {
9
- title: string;
10
- description?: string;
11
- url?: string;
12
- children?: React.ReactNode;
9
+ title: string;
10
+ description?: string;
11
+ url?: string;
12
+ children?: React.ReactNode;
13
13
  };
14
14
  // ============================================================
15
15
  export default function LinkCard({ title, description, url, children }: Props) {
16
- const handleRedirect = () => {
17
- if (url) {
18
- redirect(url, RedirectType.push);
19
- }
20
- };
16
+ const handleRedirect = () => {
17
+ if (url) {
18
+ redirect(url, RedirectType.push);
19
+ }
20
+ };
21
21
 
22
- return (
23
- <Box sx={{ height: "100%" }}>
24
- <CardActionArea onClick={handleRedirect} sx={{ height: "100%" }}>
25
- <Wrapper>
26
- {/* Add the icon as a child */}
27
- {children}
28
- <TitleText variant="h5" sx={{ textAlign: "center" }}>
29
- {title}
30
- </TitleText>
31
- <BodyText variant="body1">{description}</BodyText>
32
- </Wrapper>
33
- </CardActionArea>
34
- </Box>
35
- );
22
+ return (
23
+ <Box sx={{ height: "100%" }}>
24
+ <CardActionArea onClick={handleRedirect} sx={{ height: "100%" }}>
25
+ <Wrapper>
26
+ {/* Add the icon as a child */}
27
+ {children}
28
+ <TitleText variant="h5" sx={{ textAlign: "center" }}>
29
+ {title}
30
+ </TitleText>
31
+ <BodyText variant="body1">{description}</BodyText>
32
+ </Wrapper>
33
+ </CardActionArea>
34
+ </Box>
35
+ );
36
36
  }
@@ -5,25 +5,25 @@ import { Card, Typography } from "@mui/material";
5
5
 
6
6
  // STYLED COMPONENTS
7
7
  export const Wrapper = styled(Card)(({ theme }) => ({
8
- display: "flex",
9
- height: "100%",
10
- flexDirection: "column",
11
- alignItems: "center",
12
- justifyContent: "center",
13
- border: `1px solid ${theme.palette.grey[300]}`,
14
- borderRadius: theme.shape.borderRadius,
15
- paddingLeft: theme.spacing(4),
16
- paddingRight: theme.spacing(4),
17
- paddingTop: theme.spacing(3),
18
- paddingBottom: theme.spacing(3),
19
- backgroundColor: theme.palette.common.white,
8
+ display: "flex",
9
+ height: "100%",
10
+ flexDirection: "column",
11
+ alignItems: "center",
12
+ justifyContent: "center",
13
+ border: `1px solid ${theme.palette.grey[300]}`,
14
+ borderRadius: theme.shape.borderRadius,
15
+ paddingLeft: theme.spacing(4),
16
+ paddingRight: theme.spacing(4),
17
+ paddingTop: theme.spacing(3),
18
+ paddingBottom: theme.spacing(3),
19
+ backgroundColor: theme.palette.common.white,
20
20
  }));
21
21
 
22
22
  export const TitleText = styled(Typography)({
23
- textAlign: "center",
23
+ textAlign: "center",
24
24
  });
25
25
 
26
26
  export const BodyText = styled(Typography)(({ theme }) => ({
27
- color: theme.palette.grey[600],
28
- textAlign: "center",
27
+ color: theme.palette.grey[600],
28
+ textAlign: "center",
29
29
  }));
@@ -1,55 +1,51 @@
1
- import { Typography, Theme, useTheme, FormControl } from "@mui/material";
1
+ import { Typography, FormControl } from "@mui/material";
2
2
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
3
3
  import React, { useState } from "react";
4
4
  import { DateFilter, FilterProps } from "./list-filter-types";
5
5
  import { useTranslations } from "next-intl";
6
6
 
7
7
  const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
8
- filter,
9
- onSet,
10
- onError,
11
- current,
8
+ filter,
9
+ onSet,
10
+ onError,
11
+ current,
12
12
  }) => {
13
- const theme = useTheme();
14
- const styles = getStyles(theme);
15
- const t = useTranslations("Integrate.Filter");
16
-
17
- const [value, setValue] = useState(current);
18
- const [error, setError] = useState<string | null>(null);
19
-
20
- const updateValue = (date: null | Date | string) => {
21
- const newValue =
22
- typeof date !== "string" && !isNaN(date?.getTime())
23
- ? date.toISOString()
24
- : null;
25
-
26
- setValue(newValue);
27
- onSet(newValue);
28
- };
29
-
30
- const updateError = (error: string | null) => {
31
- setError(error ? t("invalidDate") : null);
32
- onError(!!error);
33
- };
34
-
35
- return (
36
- <FormControl>
37
- <Typography>{filter.label}</Typography>
38
- <DatePicker
39
- value={value && new Date(value as string)}
40
- onChange={updateValue}
41
- onError={updateError}
42
- slotProps={{
43
- field: { clearable: true },
44
- textField: {
45
- helperText: error,
46
- },
47
- }}
48
- />
49
- </FormControl>
50
- );
13
+ const t = useTranslations("Integrate");
14
+
15
+ const [value, setValue] = useState(current);
16
+ const [error, setError] = useState<string | null>(null);
17
+
18
+ const updateValue = (date: null | Date | string) => {
19
+ const newValue: string | null =
20
+ date !== null && typeof date !== "string" && !isNaN(date?.getTime())
21
+ ? date.toISOString()
22
+ : null;
23
+
24
+ setValue(newValue);
25
+ onSet(newValue);
26
+ };
27
+
28
+ const updateError = (error: string | null) => {
29
+ setError(error ? t("Filter.invalidDate") : null);
30
+ onError(!!error);
31
+ };
32
+
33
+ return (
34
+ <FormControl>
35
+ <Typography>{t(filter.label)}</Typography>
36
+ <DatePicker
37
+ value={value && new Date(value as string)}
38
+ onChange={updateValue}
39
+ onError={updateError}
40
+ slotProps={{
41
+ field: { clearable: true },
42
+ textField: {
43
+ helperText: error,
44
+ },
45
+ }}
46
+ />
47
+ </FormControl>
48
+ );
51
49
  };
52
50
 
53
- const getStyles = (theme: Theme) => ({});
54
-
55
51
  export default DateFilterComponent;