@evenicanpm/admin-integrate 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (209) 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 +22 -0
  5. package/documents/Process/fragments.ts +22 -0
  6. package/documents/Process/get-process-details.ts +73 -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/ProcessScheduleGroup/read.ts +43 -0
  15. package/documents/ProcessTask/fragments.ts +285 -0
  16. package/documents/ProcessTask/read.ts +12 -0
  17. package/documents/ProcessTemplate/fragments.ts +69 -0
  18. package/documents/ProcessTemplate/list.ts +67 -0
  19. package/documents/ProcessTemplate/read.ts +12 -0
  20. package/documents/RunProcess/run.ts +11 -0
  21. package/package.json +4 -3
  22. package/src/api/Integrations/queries/get-process.query.ts +12 -12
  23. package/src/api/Integrations/queries/get-process.server.ts +7 -2
  24. package/src/api/dashboard/queries/get-process-executions.query.ts +6 -3
  25. package/src/api/dashboard/queries/get-process-executions.server.ts +1 -1
  26. package/src/api/execution-details/queries/get-process-execution-details.query.ts +46 -0
  27. package/src/api/execution-details/queries/get-process-execution-details.server.ts +11 -0
  28. package/src/api/execution-details/queries/get-process-executions-by-process.query.ts +48 -0
  29. package/src/api/execution-details/queries/get-process-executions-by-process.server.ts +11 -0
  30. package/src/api/execution-details/queries/index.ts +2 -0
  31. package/src/api/process/mutations/copy-process.mutation.ts +48 -0
  32. package/src/api/process/mutations/copy-process.server.ts +14 -0
  33. package/src/api/process/mutations/index.ts +2 -0
  34. package/src/api/process/mutations/run-process.mutation.ts +41 -0
  35. package/src/api/process/mutations/run-process.server.ts +14 -0
  36. package/src/api/process/queries/get-process-by-id.query.ts +85 -0
  37. package/src/api/process/queries/get-process-by-id.server.ts +20 -0
  38. package/src/api/process/queries/index.ts +4 -0
  39. package/src/api/process-config/mutation/index.ts +2 -0
  40. package/src/api/process-config/mutation/process-config-import.mutation.ts +33 -0
  41. package/src/api/process-config/mutation/process-config-import.server.ts +14 -0
  42. package/src/api/process-config/mutation/process-config-merge.mutation.ts +33 -0
  43. package/src/api/process-config/mutation/process-config-merge.server.ts +14 -0
  44. package/src/api/process-task/queries/get-process-task-by-id.query.ts +45 -0
  45. package/src/api/process-task/queries/get-process-task-by-id.server.ts +9 -0
  46. package/src/api/process-task/queries/index.ts +1 -0
  47. package/src/api/scheduler/mutation/create-process-schedule-group-details.mutation.ts +47 -0
  48. package/src/api/scheduler/mutation/create-process-schedule-group-details.server.ts +14 -0
  49. package/src/api/scheduler/mutation/index.ts +2 -0
  50. package/src/api/scheduler/mutation/update-process-schedule-group-details.mutation.ts +47 -0
  51. package/src/api/scheduler/mutation/update-process-schedule-group-details.server.ts +14 -0
  52. package/src/api/scheduler/queries/get-non-scheduled-processes.query.ts +48 -0
  53. package/src/api/scheduler/queries/get-non-scheduled-processes.server.ts +11 -0
  54. package/src/api/scheduler/queries/get-process-schedule-group-details.query.ts +6 -3
  55. package/src/api/scheduler/queries/get-process-schedule-group-details.server.ts +3 -3
  56. package/src/api/scheduler/queries/get-process-schedule.query.ts +6 -3
  57. package/src/api/scheduler/queries/get-process-schedule.server.ts +3 -3
  58. package/src/api/scheduler/queries/get-scheduled-processes.query.ts +6 -3
  59. package/src/api/scheduler/queries/get-scheduled-processes.server.ts +1 -1
  60. package/src/api/scheduler/queries/index.ts +3 -2
  61. package/src/api/templates/queries/get-process-template-groups.query.ts +48 -0
  62. package/src/api/templates/queries/get-process-template-groups.server.ts +11 -0
  63. package/src/api/templates/queries/get-process-template-records.query.ts +48 -0
  64. package/src/api/templates/queries/get-process-template-records.server.ts +11 -0
  65. package/src/api/templates/queries/get-process-template.query.ts +48 -0
  66. package/src/api/templates/queries/get-process-template.server.ts +9 -0
  67. package/src/api/templates/queries/get-process-templates.query.ts +45 -0
  68. package/src/api/templates/queries/get-process-templates.server.ts +9 -0
  69. package/src/api/templates/queries/index.ts +5 -0
  70. package/src/api/templates/queries/template-input-search.query.ts +34 -0
  71. package/src/api/templates/queries/template-input-search.server.ts +35 -0
  72. package/src/api/templates/queries/types.ts +28 -0
  73. package/src/components/breadcrumbs/breadcrumbs.tsx +32 -5
  74. package/src/components/button/outlined-icon-button.tsx +2 -2
  75. package/src/components/core/date-time-popover.tsx +11 -4
  76. package/src/components/core/drawer-buttons.tsx +52 -0
  77. package/src/components/core/edited-typography.tsx +1 -1
  78. package/src/components/core/index.ts +4 -2
  79. package/src/components/core/loading.tsx +1 -1
  80. package/src/components/core/status-tag.tsx +97 -0
  81. package/src/components/core/title-edit.tsx +18 -11
  82. package/src/components/dashboard-list/dashboard-list-row.tsx +22 -29
  83. package/src/components/dashboard-list/dashboard-list.tsx +19 -15
  84. package/src/components/data-table/table-header.tsx +5 -7
  85. package/src/components/data-table/table-pagination.tsx +1 -1
  86. package/src/components/data-table/table-row.tsx +1 -1
  87. package/src/components/data-table/table-skeleton.tsx +9 -4
  88. package/src/components/execution/execution-filter.ts +1 -1
  89. package/src/components/execution/execution-status-icon.tsx +7 -7
  90. package/src/components/execution/execution-tag.tsx +12 -77
  91. package/src/components/execution/index.ts +1 -1
  92. package/src/components/execution-history-drawer/execution-history-drawer.tsx +203 -0
  93. package/src/components/execution-history-drawer/executions-card.tsx +85 -0
  94. package/src/components/execution-history-drawer/index.ts +1 -0
  95. package/src/components/footer/footer.tsx +10 -6
  96. package/src/components/header/dashboard-list-header.tsx +12 -7
  97. package/src/components/header/execution-details-header.tsx +35 -26
  98. package/src/components/header/header.tsx +10 -3
  99. package/src/components/header/index.ts +1 -1
  100. package/src/components/header/integration-details-header.tsx +104 -45
  101. package/src/components/integration-list/index.ts +2 -1
  102. package/src/components/integration-list/integration-filter.ts +1 -1
  103. package/src/components/integration-list/integration-status-icon.tsx +7 -8
  104. package/src/components/integration-list/integration-tag.tsx +6 -50
  105. package/src/components/integration-list/list/integration-list-row.tsx +161 -0
  106. package/src/components/integration-list/list/integration-list-table.tsx +62 -0
  107. package/src/{pages/integrations/integration-list → components/integration-list/list}/integration-list.tsx +47 -51
  108. package/src/components/integration-view/animated-svg.tsx +31 -0
  109. package/src/components/integration-view/edges/default-edge.tsx +1 -1
  110. package/src/components/integration-view/elk-layout-options.ts +2 -2
  111. package/src/components/integration-view/elk-types.ts +35 -6
  112. package/src/components/integration-view/flow-types.tsx +10 -0
  113. package/src/components/integration-view/integration-view.tsx +990 -55
  114. package/src/components/integration-view/nodes/empty-node.tsx +65 -0
  115. package/src/components/integration-view/nodes/entry-node.tsx +98 -4
  116. package/src/components/integration-view/nodes/execution-entry-node.tsx +107 -0
  117. package/src/components/integration-view/nodes/execution-task-node.tsx +88 -0
  118. package/src/components/integration-view/nodes/group-node.tsx +19 -13
  119. package/src/components/integration-view/nodes/row-node.tsx +19 -0
  120. package/src/components/integration-view/nodes/task-node.tsx +14 -8
  121. package/src/components/integration-view/task-icon.tsx +193 -0
  122. package/src/components/integration-view/temp-data/initialElements.tsx +36 -32
  123. package/src/components/integration-view/types.ts +2 -2
  124. package/src/components/layouts/main-layout.tsx +2 -3
  125. package/src/components/layouts/root-container.tsx +3 -6
  126. package/src/components/link-cards/link-card.tsx +15 -4
  127. package/src/components/link-cards/styles.ts +1 -1
  128. package/src/components/list-filter/date-filter.tsx +4 -3
  129. package/src/components/list-filter/date-range-filter.tsx +11 -5
  130. package/src/components/list-filter/index.ts +1 -1
  131. package/src/components/list-filter/list-filter.tsx +30 -25
  132. package/src/components/list-filter/multi-select-filter.tsx +11 -10
  133. package/src/components/list-filter/select-filter.tsx +13 -8
  134. package/src/components/scheduler/day-selector.tsx +29 -15
  135. package/src/components/scheduler/day-tag.tsx +14 -51
  136. package/src/components/scheduler/index.ts +2 -1
  137. package/src/components/scheduler/schedule-drawer/details-reducer.ts +217 -0
  138. package/src/components/scheduler/schedule-drawer/schedule-details-integrations.tsx +503 -0
  139. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-main.tsx +136 -99
  140. package/src/components/scheduler/schedule-drawer/schedule-details-name.tsx +94 -0
  141. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details-skeleton.tsx +1 -2
  142. package/src/{pages → components}/scheduler/schedule-drawer/schedule-details.tsx +9 -13
  143. package/src/components/scheduler/schedule-drawer/schedule-drawer-group.tsx +218 -0
  144. package/src/{pages → components}/scheduler/schedule-drawer/schedule-drawer-legacy.tsx +6 -25
  145. package/src/components/scheduler/schedule-drawer/schedule-drawer.tsx +116 -0
  146. package/src/components/scheduler/schedule-drawer/sortable-integration-row.tsx +130 -0
  147. package/src/components/scheduler/schedule-filter.ts +1 -1
  148. package/src/components/scheduler/schedule-icon.tsx +5 -6
  149. package/src/components/scheduler/schedule-integration-icon.tsx +31 -0
  150. package/src/components/templates/index.ts +1 -0
  151. package/src/components/templates/inputs/index.tsx +1351 -0
  152. package/src/components/templates/template-filter.ts +5 -0
  153. package/src/components/templates/templates-list/index.ts +1 -0
  154. package/src/components/templates/templates-list/templates-list-row.tsx +55 -0
  155. package/src/components/templates/templates-list/templates-list-table.tsx +58 -0
  156. package/src/components/templates/templates-list/templates-list.tsx +253 -0
  157. package/src/components/templates/types.tsx +75 -0
  158. package/src/components/templates/wizard.tsx +689 -0
  159. package/src/hooks/use-breadcrumbs.ts +1 -1
  160. package/src/hooks/use-recurrence.tsx +1 -2
  161. package/src/pages/dashboard/dashboard-link-cards.tsx +8 -11
  162. package/src/pages/dashboard/dashboard-list-sections.tsx +7 -9
  163. package/src/pages/dashboard/dashboard.tsx +1 -2
  164. package/src/pages/execution-details/execution-details.tsx +211 -14
  165. package/src/pages/execution-details/task-execution-details.tsx +160 -0
  166. package/src/pages/execution-details/task-execution-drawer.tsx +54 -0
  167. package/src/pages/executions/executions-list/executions-list-row.tsx +21 -27
  168. package/src/pages/executions/executions-list/executions-list-table.tsx +28 -35
  169. package/src/pages/executions/executions-list/executions-list.tsx +24 -18
  170. package/src/pages/executions/executions.tsx +11 -15
  171. package/src/pages/integration-create/index.ts +1 -0
  172. package/src/pages/integration-create/integration-create.tsx +174 -0
  173. package/src/pages/integration-create/pre-creation-step.tsx +12 -0
  174. package/src/pages/integration-create/select-step.tsx +105 -0
  175. package/src/pages/integration-create/template-list-step.tsx +77 -0
  176. package/src/pages/integration-create/wizard-step.tsx +50 -0
  177. package/src/pages/integration-details/import-process/copy-tasks-list.tsx +265 -0
  178. package/src/pages/integration-details/import-process/copy-tasks-row.tsx +77 -0
  179. package/src/pages/integration-details/import-process/import-confirm.tsx +61 -0
  180. package/src/pages/integration-details/import-process/import-drawer.tsx +48 -0
  181. package/src/pages/integration-details/import-process/import-process-reducer.ts +90 -0
  182. package/src/pages/integration-details/import-process/import-process.tsx +149 -0
  183. package/src/pages/integration-details/index.ts +1 -0
  184. package/src/pages/integration-details/integration-details.tsx +221 -0
  185. package/src/pages/integration-details/task-drawer/add-task.tsx +120 -0
  186. package/src/pages/integration-details/task-drawer/edit-task.tsx +175 -0
  187. package/src/pages/integration-details/task-drawer/task-drawer.tsx +139 -0
  188. package/src/pages/integration-details/task-drawer/task-reducer.ts +73 -0
  189. package/src/pages/integrations/integrations.tsx +11 -14
  190. package/src/pages/scheduler/scheduler.tsx +12 -24
  191. package/src/pages/scheduler/schedules-list/schedules-list-row.tsx +27 -37
  192. package/src/pages/scheduler/schedules-list/schedules-list-table.tsx +27 -42
  193. package/src/pages/scheduler/schedules-list/schedules-list.tsx +48 -21
  194. package/src/utils/date-functions.ts +69 -0
  195. package/src/utils/slugify.ts +3 -0
  196. package/tsconfig.json +12 -4
  197. package/src/hooks/use-timestamp.tsx +0 -25
  198. package/src/pages/integrations/integration-list/integration-list-row.tsx +0 -147
  199. package/src/pages/integrations/integration-list/integration-list-table.tsx +0 -78
  200. package/src/pages/scheduler/schedule-drawer/schedule-details-integrations.tsx +0 -227
  201. package/src/pages/scheduler/schedule-drawer/schedule-details-name.tsx +0 -77
  202. package/src/pages/scheduler/schedule-drawer/schedule-drawer-buttons.tsx +0 -72
  203. package/src/pages/scheduler/schedule-drawer/schedule-drawer-group.tsx +0 -103
  204. package/src/pages/scheduler/schedule-drawer/schedule-drawer.tsx +0 -101
  205. package/src/pages/scheduler/schedule-drawer/sortable-integration-row.tsx +0 -93
  206. /package/src/{pages/integrations/integration-list → components/integration-list/list}/index.ts +0 -0
  207. /package/src/{pages → components}/scheduler/schedule-drawer/edited/edited-types.ts +0 -0
  208. /package/src/{pages → components}/scheduler/schedule-drawer/edited/index.ts +0 -0
  209. /package/src/{pages → components}/scheduler/schedule-drawer/index.ts +0 -0
@@ -1,11 +1,11 @@
1
- import { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "../elk-types";
2
-
3
1
  import StorageIcon from "@mui/icons-material/Storage";
4
2
  import TableChartIcon from "@mui/icons-material/TableChart";
5
- import SystemUpdateAltIcon from "@mui/icons-material/SystemUpdateAlt";
3
+ import { Box } from "@mui/material";
6
4
 
7
5
  import { MarkerType } from "@xyflow/react";
8
- import { Box } from "@mui/material";
6
+ import type { ElkExtendedEdgeWithFlow, ElkNodeWithFlow } from "../elk-types";
7
+
8
+ //import { timerIcon, triggerIcon } from "../icons";
9
9
 
10
10
  const pullIcon = () => {
11
11
  return (
@@ -35,22 +35,15 @@ const chartIcon = () => {
35
35
  alignItems: "center",
36
36
  justifyContent: "center",
37
37
  borderRadius: "5px",
38
- bgcolor: "paste.100",
38
+ bgcolor: "#EADDFF", // Purple not implemented in the theme
39
39
  borderWidth: 1,
40
40
  borderStyle: "solid",
41
- borderColor: "paste.600",
41
+ borderColor: "#6750A4", // Purple not implemented in the theme
42
42
  padding: "2px",
43
43
  }}
44
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" }} />
45
+ <TableChartIcon sx={{ color: "#6750A4" }} />{" "}
46
+ {/* Purple not implemented in the theme */}
54
47
  </Box>
55
48
  );
56
49
  };
@@ -58,9 +51,15 @@ const inputIcon = () => {
58
51
  export const initialNodes: ElkNodeWithFlow[] = [
59
52
  {
60
53
  id: "1",
61
- type: "task-node",
62
- data: { label: "Set Entry Point", icon: inputIcon() },
63
- width: 450,
54
+ type: "execution-entry-node",
55
+ data: {
56
+ label: "Trigger",
57
+ //icon: timerIcon(),
58
+ label2: "Schedule",
59
+ //icon2: triggerIcon(),
60
+ executionStatus: "400",
61
+ },
62
+ width: 200,
64
63
  height: 70,
65
64
  position: { x: 0, y: 0 },
66
65
  layoutOptions: {
@@ -80,9 +79,10 @@ export const initialNodes: ElkNodeWithFlow[] = [
80
79
  label: "Pull Data From External MS DB 1",
81
80
  icon: pullIcon(),
82
81
  isLast: true,
82
+ executionStatus: "500",
83
83
  },
84
84
  position: { x: 0, y: 0 },
85
- type: "task-node",
85
+ type: "execution-task-node",
86
86
  width: 450,
87
87
  height: 70,
88
88
  extent: "parent",
@@ -93,11 +93,12 @@ export const initialNodes: ElkNodeWithFlow[] = [
93
93
  data: {
94
94
  label: "Stage Data 1",
95
95
  icon: chartIcon(),
96
+ executionStatus: "400",
96
97
  },
97
98
  position: { x: 0, y: 0 },
98
99
  width: 450,
99
100
  height: 70,
100
- type: "task-node",
101
+ type: "execution-task-node",
101
102
  extent: "parent",
102
103
  },
103
104
  {
@@ -113,9 +114,10 @@ export const initialNodes: ElkNodeWithFlow[] = [
113
114
  data: {
114
115
  label: "Stage Data 2",
115
116
  icon: chartIcon(),
117
+ executionStatus: "300",
116
118
  },
117
119
  position: { x: 0, y: 0 },
118
- type: "task-node",
120
+ type: "execution-task-node",
119
121
  width: 450,
120
122
  height: 70,
121
123
  extent: "parent",
@@ -126,9 +128,10 @@ export const initialNodes: ElkNodeWithFlow[] = [
126
128
  label: "Process Data",
127
129
  icon: chartIcon(),
128
130
  isLast: true,
131
+ executionStatus: "400",
129
132
  },
130
133
  position: { x: 0, y: 0 },
131
- type: "task-node",
134
+ type: "execution-task-node",
132
135
  width: 450,
133
136
  height: 70,
134
137
  extent: "parent",
@@ -147,9 +150,10 @@ export const initialNodes: ElkNodeWithFlow[] = [
147
150
  label: "Stage Data 3",
148
151
  icon: chartIcon(),
149
152
  isLast: true,
153
+ executionStatus: "500",
150
154
  },
151
155
  position: { x: 0, y: 0 },
152
- type: "task-node",
156
+ type: "execution-task-node",
153
157
  width: 450,
154
158
  height: 70,
155
159
  extent: "parent",
@@ -173,52 +177,52 @@ export const initialEdges: ElkExtendedEdgeWithFlow[] = [
173
177
  id: "2gs-2gc",
174
178
  sources: ["2gs"],
175
179
  targets: ["2gconnect1"],
176
- type: "default-edge",
180
+ type: "animated-edge",
177
181
  },
178
182
  {
179
183
  id: "2gs-2g1",
180
184
  sources: ["2gconnect1"],
181
185
  targets: ["2g1"],
182
- type: "default-edge",
186
+ type: "animated-edge",
183
187
  markerEnd: markerEnd,
184
188
  },
185
189
  {
186
190
  id: "2gs-2g2",
187
191
  sources: ["2gconnect1"],
188
192
  targets: ["2g2"],
189
- type: "default-edge",
193
+ type: "animated-edge",
190
194
  markerEnd: markerEnd,
191
195
  },
192
196
  {
193
197
  id: "2gs-2g3",
194
198
  sources: ["2gconnect1"],
195
199
  targets: ["2g3"],
196
- type: "default-edge",
200
+ type: "animated-edge",
197
201
  markerEnd: markerEnd,
198
202
  },
199
203
  {
200
204
  id: "2g1-2g4",
201
205
  sources: ["2g1"],
202
206
  targets: ["2gconnect2"],
203
- type: "default-edge",
207
+ type: "animated-edge",
204
208
  },
205
209
  {
206
210
  id: "2g2-2g4",
207
211
  sources: ["2g2"],
208
212
  targets: ["2gconnect2"],
209
- type: "default-edge",
213
+ type: "animated-edge",
210
214
  },
211
215
  {
212
- id: "2g3-2g4",
216
+ id: "2g3->2g4",
213
217
  sources: ["2g3"],
214
218
  targets: ["2gconnect2"],
215
- type: "default-edge",
219
+ type: "animated-edge",
216
220
  },
217
221
  {
218
222
  id: "2gc-2g4",
219
223
  sources: ["2gconnect2"],
220
224
  targets: ["2g4"],
221
- type: "default-edge",
225
+ type: "animated-edge",
222
226
  markerEnd: markerEnd,
223
227
  },
224
228
  ];
@@ -1,6 +1,6 @@
1
- interface ElkOptions {}
1
+ type ElkOptions = {};
2
2
 
3
- interface ElkPosition {}
3
+ type ElkPosition = {};
4
4
 
5
5
  interface ElkItem {
6
6
  id: string;
@@ -1,10 +1,9 @@
1
1
  "use client";
2
- import { styled } from "@mui/material";
3
2
 
4
3
  import BodyWrapper from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-body-wrapper";
5
- import DashboardSidebar from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-sidebar/dashboard-sidebar";
6
-
7
4
  import { LayoutProvider } from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-layout-context";
5
+ import DashboardSidebar from "@evenicanpm/admin-core/components/layouts/main-dashboard/dashboard-sidebar/dashboard-sidebar";
6
+ import { styled } from "@mui/material";
8
7
 
9
8
  // STYLED COMPONENT
10
9
  const StyledContainer = styled("div")(() => ({
@@ -1,10 +1,7 @@
1
- import React from "react";
2
-
3
- import { Theme, useTheme } from "@mui/material";
4
- import { Container, Box, Stack } from "@mui/material";
5
- import { SxProps, Breakpoint } from "@mui/system";
6
-
7
1
  import { IntegrateFooter } from "@evenicanpm/admin-integrate/components/footer";
2
+ import { Box, Container, Stack, type Theme, useTheme } from "@mui/material";
3
+ import type { Breakpoint, SxProps } from "@mui/system";
4
+ import type React from "react";
8
5
 
9
6
  interface Props {
10
7
  maxWidth?: false | Breakpoint;
@@ -1,19 +1,30 @@
1
1
  // STYLED COMPONENTS
2
- import { BodyText, TitleText, Wrapper } from "./styles";
3
- import React from "react";
4
- import { redirect, RedirectType } from "next/navigation";
2
+
5
3
  import { Box, CardActionArea } from "@mui/material";
4
+ import { RedirectType, redirect } from "next/navigation";
5
+ import type React from "react";
6
+ import { BodyText, TitleText, Wrapper } from "./styles";
6
7
 
7
8
  // ============================================================
8
9
  type Props = {
9
10
  title: string;
10
11
  description?: string;
11
12
  url?: string;
13
+ onClick?: () => void;
12
14
  children?: React.ReactNode;
13
15
  };
14
16
  // ============================================================
15
- export default function LinkCard({ title, description, url, children }: Props) {
17
+ export default function LinkCard({
18
+ title,
19
+ description,
20
+ url,
21
+ onClick,
22
+ children,
23
+ }: Props) {
16
24
  const handleRedirect = () => {
25
+ if (onClick) {
26
+ onClick();
27
+ }
17
28
  if (url) {
18
29
  redirect(url, RedirectType.push);
19
30
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
- import styled from "@mui/material/styles/styled";
4
3
  import { Card, Typography } from "@mui/material";
4
+ import styled from "@mui/material/styles/styled";
5
5
 
6
6
  // STYLED COMPONENTS
7
7
  export const Wrapper = styled(Card)(({ theme }) => ({
@@ -1,8 +1,9 @@
1
- import { Typography, FormControl } from "@mui/material";
1
+ import { FormControl, Typography } from "@mui/material";
2
2
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
3
- import React, { useState } from "react";
4
- import { DateFilter, FilterProps } from "./list-filter-types";
5
3
  import { useTranslations } from "next-intl";
4
+ import type React from "react";
5
+ import { useState } from "react";
6
+ import type { DateFilter, FilterProps } from "./list-filter-types";
6
7
 
7
8
  const DateFilterComponent: React.FC<FilterProps<DateFilter>> = ({
8
9
  filter,
@@ -1,9 +1,15 @@
1
- import { Box, Typography, Theme, useTheme, FormControl } from "@mui/material";
2
- import { useTranslations } from "next-intl";
3
-
1
+ import {
2
+ Box,
3
+ FormControl,
4
+ type Theme,
5
+ Typography,
6
+ useTheme,
7
+ } from "@mui/material";
4
8
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
5
- import React, { useState } from "react";
6
- import { DateRangeFilter, FilterProps } from "./list-filter-types";
9
+ import { useTranslations } from "next-intl";
10
+ import type React from "react";
11
+ import { useState } from "react";
12
+ import type { DateRangeFilter, FilterProps } from "./list-filter-types";
7
13
 
8
14
  const DateRangeFilterComponent: React.FC<FilterProps<DateRangeFilter>> = ({
9
15
  filter,
@@ -1,6 +1,6 @@
1
1
  export { default as DateFilter } from "./date-filter";
2
2
  export { default as DateRangeFilter } from "./date-range-filter";
3
3
  export { default as ListFilter } from "./list-filter";
4
+ export * from "./list-filter-types";
4
5
  export { default as MultiSelectFilterComponent } from "./multi-select-filter";
5
6
  export { default as SelectFilterComponent } from "./select-filter";
6
- export * from "./list-filter-types";
@@ -1,42 +1,42 @@
1
1
  "use client";
2
- import { debounce } from "lodash";
3
- import { useTranslations } from "next-intl";
4
- import React, { useEffect, useState } from "react";
5
2
 
6
3
  import {
7
- Search,
8
- FilterAltOutlined,
9
- CloseOutlined,
10
4
  ArrowForwardIos,
5
+ CloseOutlined,
11
6
  Delete,
7
+ FilterAltOutlined,
8
+ Search,
12
9
  } from "@mui/icons-material";
13
10
  import {
11
+ Badge,
14
12
  Box,
15
13
  Button,
14
+ ClickAwayListener,
16
15
  IconButton,
17
- TextField,
18
16
  InputAdornment,
19
- Select,
20
17
  MenuItem,
21
- Theme,
22
- useTheme,
23
18
  Paper,
24
19
  Popper,
25
- Badge,
26
- ClickAwayListener,
20
+ Select,
21
+ TextField,
22
+ type Theme,
23
+ useTheme,
27
24
  } from "@mui/material";
28
- import {
29
- Filters,
25
+ import { debounce } from "lodash";
26
+ import { useTranslations } from "next-intl";
27
+ import type React from "react";
28
+ import { useEffect, useState } from "react";
29
+ import { OutlinedIconButton } from "../button";
30
+ import DateFilterComponent from "./date-filter";
31
+ import DateRangeFilterComponent from "./date-range-filter";
32
+ import type {
33
+ FilterConfig,
30
34
  FilterResult,
35
+ Filters,
31
36
  ListFilterOutput,
32
- FilterConfig,
33
37
  } from "./list-filter-types";
34
-
35
- import { OutlinedIconButton } from "../button";
36
- import SelectFilterComponent from "./select-filter";
37
38
  import MultiSelectFilterComponent from "./multi-select-filter";
38
- import DateFilterComponent from "./date-filter";
39
- import DateRangeFilterComponent from "./date-range-filter";
39
+ import SelectFilterComponent from "./select-filter";
40
40
 
41
41
  interface FilterProps<FilterShape extends Filters> {
42
42
  setFilters: (filterUpdate: ListFilterOutput<FilterShape>) => void;
@@ -74,14 +74,14 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
74
74
  if (filter.type === "select" && filter.value)
75
75
  return {
76
76
  ...values,
77
- // @ts-ignore
77
+ // @ts-expect-error
78
78
  [key]: filter.options.find((o) => o.id === filter.value[0].id),
79
79
  };
80
80
  if (filter.type === "multiSelect" && filter.value)
81
81
  return {
82
82
  ...values,
83
83
  [key]: filter.options.filter((o) =>
84
- // @ts-ignore
84
+ // @ts-expect-error
85
85
  filter.value.find((v) => v.id === o.id),
86
86
  ),
87
87
  };
@@ -217,7 +217,12 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
217
217
  <FilterAltOutlined />
218
218
  </OutlinedIconButton>
219
219
  </Badge>
220
- <Popper open={open} anchorEl={anchorEl} placement="bottom-start">
220
+ <Popper
221
+ sx={{ zIndex: theme.zIndex.drawer + 1 }}
222
+ open={open}
223
+ anchorEl={anchorEl}
224
+ placement="bottom-start"
225
+ >
221
226
  <Paper sx={styles.popOut} elevation={3}>
222
227
  <Box sx={styles.closeRow}>
223
228
  {manualClose ? (
@@ -298,7 +303,7 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
298
303
  startIcon={<Delete />}
299
304
  onClick={handleFilterClear}
300
305
  >
301
- Clear
306
+ {t("clear")}
302
307
  </Button>
303
308
  ) : (
304
309
  ""
@@ -311,7 +316,7 @@ const ListFilter = function ListFilter<FilterShape extends Filters>(
311
316
  disabled={Object.values(filterErrors).some((v) => v)}
312
317
  onClick={handleFilterSet}
313
318
  >
314
- Filter
319
+ {t("filter")}
315
320
  </Button>
316
321
  </Box>
317
322
  </Box>
@@ -1,22 +1,23 @@
1
- import { useTranslations } from "next-intl";
1
+ import { CloseOutlined } from "@mui/icons-material";
2
2
  import {
3
3
  Box,
4
- Typography,
4
+ Chip,
5
+ FormControl,
5
6
  IconButton,
6
7
  InputAdornment,
7
- Select,
8
8
  MenuItem,
9
- Theme,
9
+ Select,
10
+ type Theme,
11
+ Typography,
10
12
  useTheme,
11
- FormControl,
12
- Chip,
13
13
  } from "@mui/material";
14
- import { CloseOutlined } from "@mui/icons-material";
15
- import React, { useState } from "react";
16
- import {
14
+ import { useTranslations } from "next-intl";
15
+ import type React from "react";
16
+ import { useState } from "react";
17
+ import type {
17
18
  FilterOption,
18
- MultiSelectFilter,
19
19
  FilterProps,
20
+ MultiSelectFilter,
20
21
  } from "./list-filter-types";
21
22
 
22
23
  const MultiSelectFilterComponent: React.FC<FilterProps<MultiSelectFilter>> = ({
@@ -1,17 +1,22 @@
1
- import { useTranslations } from "next-intl";
1
+ import { CloseOutlined } from "@mui/icons-material";
2
2
  import {
3
- Typography,
3
+ FormControl,
4
4
  IconButton,
5
5
  InputAdornment,
6
- Select,
7
6
  MenuItem,
8
- Theme,
7
+ Select,
8
+ type Theme,
9
+ Typography,
9
10
  useTheme,
10
- FormControl,
11
11
  } from "@mui/material";
12
- import { CloseOutlined } from "@mui/icons-material";
13
- import React, { useState } from "react";
14
- import { FilterOption, SelectFilter, FilterProps } from "./list-filter-types";
12
+ import { useTranslations } from "next-intl";
13
+ import type React from "react";
14
+ import { useState } from "react";
15
+ import type {
16
+ FilterOption,
17
+ FilterProps,
18
+ SelectFilter,
19
+ } from "./list-filter-types";
15
20
 
16
21
  const SelectFilterComponent: React.FC<FilterProps<SelectFilter>> = ({
17
22
  filter,
@@ -1,10 +1,17 @@
1
- import { useTranslations } from "next-intl";
2
1
  // MUI
3
- import { Theme, useTheme } from "@mui/material";
4
- import { Typography, Box, Stack, ButtonBase } from "@mui/material";
2
+ import {
3
+ Box,
4
+ ButtonBase,
5
+ Stack,
6
+ type SxProps,
7
+ type Theme,
8
+ Typography,
9
+ useTheme,
10
+ } from "@mui/material";
11
+ import { useTranslations } from "next-intl";
5
12
 
6
13
  // Types
7
- import { IsDay } from "./scheduler-types";
14
+ import type { IsDay } from "./scheduler-types";
8
15
 
9
16
  interface Props {
10
17
  days: IsDay;
@@ -16,7 +23,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
16
23
  const t = useTranslations("Integrate.Scheduler.DaySelector");
17
24
 
18
25
  const theme = useTheme();
19
- const styles = getStyles(theme);
26
+ const styles: DaySelectorStyles = getStyles(theme);
20
27
 
21
28
  const handleClick = (field: keyof IsDay) => {
22
29
  if (!props.disabled) {
@@ -34,7 +41,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
34
41
  disableRipple={props.disabled}
35
42
  >
36
43
  <Box
37
- sx={getDayStyle(styles, props.days.isMonday)}
44
+ sx={getDayStyle(styles, props.days?.isMonday)}
38
45
  alignContent="center"
39
46
  textAlign="center"
40
47
  >
@@ -49,7 +56,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
49
56
  disableRipple={props.disabled}
50
57
  >
51
58
  <Box
52
- sx={getDayStyle(styles, props.days.isTuesday)}
59
+ sx={getDayStyle(styles, props.days?.isTuesday)}
53
60
  alignContent="center"
54
61
  textAlign="center"
55
62
  >
@@ -64,7 +71,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
64
71
  disableRipple={props.disabled}
65
72
  >
66
73
  <Box
67
- sx={getDayStyle(styles, props.days.isWednesday)}
74
+ sx={getDayStyle(styles, props.days?.isWednesday)}
68
75
  alignContent="center"
69
76
  textAlign="center"
70
77
  >
@@ -79,7 +86,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
79
86
  disableRipple={props.disabled}
80
87
  >
81
88
  <Box
82
- sx={getDayStyle(styles, props.days.isThursday)}
89
+ sx={getDayStyle(styles, props.days?.isThursday)}
83
90
  alignContent="center"
84
91
  textAlign="center"
85
92
  >
@@ -94,7 +101,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
94
101
  disableRipple={props.disabled}
95
102
  >
96
103
  <Box
97
- sx={getDayStyle(styles, props.days.isFriday)}
104
+ sx={getDayStyle(styles, props.days?.isFriday)}
98
105
  alignContent="center"
99
106
  textAlign="center"
100
107
  >
@@ -109,7 +116,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
109
116
  disableRipple={props.disabled}
110
117
  >
111
118
  <Box
112
- sx={getDayStyle(styles, props.days.isSaturday)}
119
+ sx={getDayStyle(styles, props.days?.isSaturday)}
113
120
  alignContent="center"
114
121
  textAlign="center"
115
122
  >
@@ -124,7 +131,7 @@ const DaySelector: React.FC<Props> = (props: Props) => {
124
131
  disableRipple={props.disabled}
125
132
  >
126
133
  <Box
127
- sx={getDayStyle(styles, props.days.isSunday)}
134
+ sx={getDayStyle(styles, props.days?.isSunday)}
128
135
  alignContent="center"
129
136
  textAlign="center"
130
137
  >
@@ -137,7 +144,14 @@ const DaySelector: React.FC<Props> = (props: Props) => {
137
144
  );
138
145
  };
139
146
 
140
- const getStyles = (theme: Theme) => {
147
+ interface DaySelectorStyles {
148
+ days: SxProps;
149
+ dayOfWeek: SxProps;
150
+ dayOfWeekSelected: SxProps;
151
+ dayInitial: SxProps;
152
+ }
153
+
154
+ const getStyles = (theme: Theme): DaySelectorStyles => {
141
155
  return {
142
156
  days: {
143
157
  marginTop: theme.spacing(0),
@@ -164,9 +178,9 @@ const getStyles = (theme: Theme) => {
164
178
  };
165
179
  };
166
180
 
167
- const getDayStyle = (styles: any, selected: boolean) => {
181
+ const getDayStyle = (styles: DaySelectorStyles, selected: boolean): SxProps => {
168
182
  if (selected) {
169
- return { ...styles.dayOfWeek, ...styles.dayOfWeekSelected };
183
+ return { ...styles.dayOfWeek, ...styles.dayOfWeekSelected } as SxProps;
170
184
  }
171
185
  return styles.dayOfWeek;
172
186
  };