@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,22 +1,8 @@
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
- import { DayString } from "./scheduler-types";
8
-
9
- // Styled components
10
- const StyledTagBox = styled(Box)(({ theme }) => ({
11
- padding: theme.spacing(0, 1.5),
12
- border: "solid 1px",
13
- borderRadius: 4,
14
- alignContent: "center",
15
- maxWidth: "fit-content",
16
- }));
17
- const StyledTag = styled(Typography)(() => ({
18
- fontWeight: "bold",
19
- }));
5
+ import type { DayString } from "./scheduler-types";
20
6
 
21
7
  interface Props {
22
8
  day: DayString;
@@ -28,45 +14,22 @@ const DayTag: React.FC<Props> = (props: Props) => {
28
14
 
29
15
  if (props.day === "disabled") {
30
16
  return (
31
- <StyledTagBox
32
- sx={{
33
- backgroundColor: "grey.300",
34
- borderColor: "grey.600",
35
- color: "grey.600",
36
- ...props.sx,
37
- }}
38
- >
39
- <StyledTag color="grey" variant="caption">
40
- {t("Scheduler.disabled")}
41
- </StyledTag>
42
- </StyledTagBox>
17
+ <StatusTag
18
+ type="unavailable"
19
+ text={t("Scheduler.disabled")}
20
+ sx={props.sx}
21
+ />
43
22
  );
44
23
  }
45
24
 
46
25
  return props.day === "everyday" ? (
47
- <StyledTagBox
48
- sx={{
49
- backgroundColor: "success.100",
50
- borderColor: "success.main",
51
- ...props.sx,
52
- }}
53
- >
54
- <StyledTag color="success" variant="caption">
55
- {t("Scheduler.everyday")}
56
- </StyledTag>
57
- </StyledTagBox>
26
+ <StatusTag type="success" text={t("Scheduler.everyday")} sx={props.sx} />
58
27
  ) : (
59
- <StyledTagBox
60
- sx={{
61
- backgroundColor: "info.100",
62
- borderColor: "info.main",
63
- ...props.sx,
64
- }}
65
- >
66
- <StyledTag color="info" variant="caption">
67
- {t(`Scheduler.${props.day}Short`)}
68
- </StyledTag>
69
- </StyledTagBox>
28
+ <StatusTag
29
+ type="info"
30
+ text={t(`Scheduler.${props.day}Short`)}
31
+ sx={props.sx}
32
+ />
70
33
  );
71
34
  };
72
35
 
@@ -1,4 +1,5 @@
1
+ export { default as DaySelector } from "./day-selector";
1
2
  export { default as DayTag } from "./day-tag";
2
3
  export { default as ScheduleIcon } from "./schedule-icon";
3
- export { default as DaySelector } from "./day-selector";
4
+ export { default as ScheduleIntegrationIcon } from "./schedule-integration-icon";
4
5
  export * from "./scheduler-types";
@@ -0,0 +1,217 @@
1
+ import type {
2
+ ProcessScheduleGroupDetailsProcessInput,
3
+ ProcessScheduleGroupDetailsUpdate,
4
+ } from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
5
+ import type { IsDay } from "@evenicanpm/admin-integrate/components/scheduler";
6
+
7
+ export interface DefaultScheduledProcess {
8
+ id: string;
9
+ name: string;
10
+ processIcon: string;
11
+ }
12
+
13
+ export enum DetailsActionType {
14
+ INIT = "INIT",
15
+ CLOSE = "CLOSE",
16
+ EDIT_NAME = "EDIT_NAME",
17
+ TOGGLE_ENABLED = "TOGGLE_ENABLED",
18
+ EDIT_DAYS = "EDIT_DAYS",
19
+ EDIT_START_DATE = "EDIT_START_DATE",
20
+ EDIT_RECURRENCE = "EDIT_RECURRENCE",
21
+ EDIT_INTEGRATIONS = "EDIT_INTEGRATIONS",
22
+ INIT_BLANK = "INIT_BLANK",
23
+ SET_ERRORS = "SET_ERRORS",
24
+ SET_DEFAULT_SCHEDULED_PROCESS = "SET_DEFAULT_SCHEDULED_PROCESS",
25
+ }
26
+
27
+ export interface DetailsAction {
28
+ type: DetailsActionType;
29
+ }
30
+
31
+ export interface InitAction extends DetailsAction {
32
+ details: ProcessScheduleGroupDetailsUpdate;
33
+ }
34
+
35
+ export interface EditNameAction extends DetailsAction {
36
+ name: string;
37
+ }
38
+
39
+ export interface EditDaysAction extends DetailsAction {
40
+ isDay: IsDay;
41
+ }
42
+
43
+ export interface EditStartDateAction extends DetailsAction {
44
+ startDate: string;
45
+ }
46
+
47
+ export interface EditRecurrenceAction extends DetailsAction {
48
+ interval?: number;
49
+ intervalUnitId?: string;
50
+ }
51
+
52
+ export interface EditIntegrationsAction extends DetailsAction {
53
+ processes: ProcessScheduleGroupDetailsProcessInput[];
54
+ }
55
+
56
+ export interface SetErrorsAction extends DetailsAction {
57
+ errors: ErrorsState;
58
+ }
59
+
60
+ export interface SetDefaultScheduledProcessAction extends DetailsAction {
61
+ defaultScheduledProcess: DefaultScheduledProcess;
62
+ }
63
+
64
+ export interface ErrorsState {
65
+ name?: boolean;
66
+ startDate?: boolean;
67
+ interval?: boolean;
68
+ processes?: boolean;
69
+ }
70
+
71
+ export interface DetailsState {
72
+ details: ProcessScheduleGroupDetailsUpdate | null;
73
+ errors?: ErrorsState;
74
+ defaultScheduledProcess?: DefaultScheduledProcess;
75
+ }
76
+
77
+ export function detailsReducer(
78
+ state: DetailsState,
79
+ action: DetailsAction,
80
+ ): DetailsState {
81
+ switch (action.type) {
82
+ case DetailsActionType.INIT: {
83
+ const { details } = action as InitAction;
84
+ return {
85
+ ...state,
86
+ details,
87
+ errors: {
88
+ name: !details.name || details.name === "",
89
+ startDate: !details.startDate,
90
+ interval: !details.interval,
91
+ processes: !details.processes || details.processes.length === 0,
92
+ },
93
+ };
94
+ }
95
+ case DetailsActionType.INIT_BLANK: {
96
+ const blankState: ProcessScheduleGroupDetailsUpdate = {
97
+ id: "",
98
+ name: "",
99
+ code: "",
100
+ isDisabled: false,
101
+ interval: 5,
102
+ intervalUnitId: "1",
103
+ startDate: new Date().toISOString(),
104
+ processes: [],
105
+ };
106
+ return {
107
+ ...state,
108
+ details: blankState,
109
+ errors: {
110
+ name: !blankState.name || blankState.name === "",
111
+ processes: !blankState.processes || blankState.processes.length === 0,
112
+ },
113
+ };
114
+ }
115
+ case DetailsActionType.CLOSE: {
116
+ return { details: null };
117
+ }
118
+ case DetailsActionType.EDIT_NAME: {
119
+ if (!state.details) return state;
120
+
121
+ const { name } = action as EditNameAction;
122
+ const code = name.replaceAll(" ", "_").toLowerCase();
123
+ return {
124
+ ...state,
125
+ details: {
126
+ ...state.details,
127
+ name,
128
+ code,
129
+ },
130
+ };
131
+ }
132
+ case DetailsActionType.TOGGLE_ENABLED: {
133
+ if (!state.details) return state;
134
+
135
+ return {
136
+ ...state,
137
+ details: {
138
+ ...state.details,
139
+ isDisabled: !state.details.isDisabled,
140
+ },
141
+ };
142
+ }
143
+ case DetailsActionType.EDIT_DAYS: {
144
+ if (!state.details) return state;
145
+
146
+ const { isDay } = action as EditDaysAction;
147
+ return {
148
+ ...state,
149
+ details: {
150
+ ...state.details,
151
+ ...isDay,
152
+ },
153
+ };
154
+ }
155
+ case DetailsActionType.EDIT_START_DATE: {
156
+ if (!state.details) return state;
157
+
158
+ const { startDate } = action as EditStartDateAction;
159
+ return {
160
+ ...state,
161
+ details: {
162
+ ...state.details,
163
+ startDate,
164
+ },
165
+ };
166
+ }
167
+ case DetailsActionType.EDIT_RECURRENCE: {
168
+ if (!state.details) return state;
169
+
170
+ const { interval, intervalUnitId } = action as EditRecurrenceAction;
171
+ return {
172
+ ...state,
173
+ details: {
174
+ ...state.details,
175
+ ...(interval !== undefined && { interval }),
176
+ ...(intervalUnitId !== undefined && { intervalUnitId }),
177
+ },
178
+ };
179
+ }
180
+ case DetailsActionType.EDIT_INTEGRATIONS: {
181
+ if (!state.details) return state;
182
+
183
+ const { processes } = action as EditIntegrationsAction;
184
+ return {
185
+ ...state,
186
+ details: {
187
+ ...state.details,
188
+ processes: processes,
189
+ },
190
+ };
191
+ }
192
+ case DetailsActionType.SET_DEFAULT_SCHEDULED_PROCESS: {
193
+ const { defaultScheduledProcess } =
194
+ action as SetDefaultScheduledProcessAction;
195
+ return {
196
+ ...state,
197
+ defaultScheduledProcess: defaultScheduledProcess,
198
+ };
199
+ }
200
+ case DetailsActionType.SET_ERRORS: {
201
+ if (!state.details) return state;
202
+
203
+ const { errors } = action as SetErrorsAction;
204
+ return {
205
+ ...state,
206
+ errors: {
207
+ ...state.errors,
208
+ ...errors,
209
+ },
210
+ };
211
+ }
212
+ default: {
213
+ console.error(`${action.type} is not a valid action for detailsReducer`);
214
+ return state;
215
+ }
216
+ }
217
+ }