@evenicanpm/admin-integrate 2.3.1 → 2.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.
- package/.turbo/turbo-biome$colon$format.log +7 -0
- package/CHANGELOG.md +3 -0
- package/documents/Process/get-process-details.ts +0 -2
- package/documents/ProcessConfig/fragments.ts +2 -2
- package/documents/ProcessExport/read.ts +0 -2
- package/documents/ProcessTemplate/fragments.ts +0 -8
- package/package.json +43 -24
- package/src/components/integration-view/edges/default-edge.tsx +2 -1
- package/src/components/integration-view/integration-view.tsx +2 -2
- package/src/components/integration-view/nodes/add-node.tsx +2 -1
- package/src/components/integration-view/nodes/connection-node.tsx +2 -1
- package/src/components/integration-view/nodes/empty-node.tsx +2 -1
- package/src/components/integration-view/nodes/entry-node.tsx +2 -1
- package/src/components/integration-view/nodes/execution-entry-node.tsx +2 -1
- package/src/components/integration-view/nodes/execution-task-node.tsx +2 -1
- package/src/components/integration-view/nodes/group-node.tsx +2 -1
- package/src/components/integration-view/nodes/row-node.tsx +2 -1
- package/src/components/integration-view/nodes/task-node.tsx +2 -1
- package/src/components/list-filter/list-filter.tsx +0 -2
- package/src/components/templatesV2/inputs/FormikPageBody.tsx +0 -1
- package/src/components/templatesV2/inputs/primitives/TextWithQueryInput.tsx +1 -20
- package/src/components/templatesV2/inputs/renderers/renderFormControl.tsx +0 -4
- package/src/components/templatesV2/pageForm.tsx +1 -1
- package/src/components/templatesV2/types.tsx +2 -2
- package/src/components/templatesV2/wizard.tsx +12 -61
- package/src/global.d.ts +3 -0
- package/src/pages/integration-create/integration-create.tsx +33 -41
- package/src/pages/integration-create/pre-creation-step.tsx +1 -1
- package/src/pages/integration-create/template-list-step.tsx +13 -8
- package/src/pages/integration-create/template-options-step.tsx +10 -30
- package/src/pages/integration-create/wizard-step.tsx +1 -15
- package/src/pages/integration-details/integration-details.tsx +13 -42
- package/src/pages/integration-details/task-drawer/add-task.tsx +0 -1
- package/src/pages/integration-details/task-drawer/edit-task.tsx +6 -25
- package/src/pages/integration-details/task-drawer/task-reducer.ts +0 -6
- package/tsconfig.json +6 -20
- package/src/components/templatesV2/utils/parseTemplateValuesFromConfig.ts +0 -311
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ConfigExport,
|
|
3
3
|
ConfigImport,
|
|
4
|
-
|
|
5
|
-
InputMaybe,
|
|
4
|
+
ConfigurationMergeMutationVariables,
|
|
6
5
|
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
7
6
|
import {
|
|
8
7
|
processConfigImport,
|
|
@@ -27,7 +26,6 @@ import SelectStep from "./select-step";
|
|
|
27
26
|
import TemplateListStep, { DirectionType } from "./template-list-step";
|
|
28
27
|
import TemplateOptionsStep from "./template-options-step";
|
|
29
28
|
import WizardStep from "./wizard-step";
|
|
30
|
-
import { TemplateOption } from "./template-options-step";
|
|
31
29
|
|
|
32
30
|
export default function IntegrationCreate() {
|
|
33
31
|
const t = useTranslations("Integrate");
|
|
@@ -61,17 +59,7 @@ export default function IntegrationCreate() {
|
|
|
61
59
|
const [dualSourceThenTarget, setDualSourceThenTarget] = useState(false);
|
|
62
60
|
|
|
63
61
|
useEffect(() => {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
(templateOption === TemplateOption.Source &&
|
|
68
|
-
searchParams.get(DirectionType.Incoming)) ||
|
|
69
|
-
(templateOption === TemplateOption.Target &&
|
|
70
|
-
searchParams.get(DirectionType.Outgoing)) ||
|
|
71
|
-
(templateOption === TemplateOption.SourceAndTarget &&
|
|
72
|
-
searchParams.get(DirectionType.Incoming) &&
|
|
73
|
-
searchParams.get(DirectionType.Outgoing))
|
|
74
|
-
) {
|
|
62
|
+
if (searchParams.get("group")) {
|
|
75
63
|
setStep(INTEGRATION_CREATE_STEPS.wizard);
|
|
76
64
|
}
|
|
77
65
|
}, [searchParams]);
|
|
@@ -105,31 +93,32 @@ export default function IntegrationCreate() {
|
|
|
105
93
|
c.code = code;
|
|
106
94
|
}
|
|
107
95
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
let sourceConfig: InputMaybe<ConfigMerge> | undefined = null;
|
|
111
|
-
let targetConfig: InputMaybe<ConfigMerge> | undefined = null;
|
|
112
|
-
let targetSourcesConfig: InputMaybe<ConfigMerge> | undefined = null;
|
|
96
|
+
console.log("configMergeInput", configMergeInput);
|
|
113
97
|
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
const sourceName = configMergeInput?.input?.config?.find(
|
|
99
|
+
(item) => (item?.source as string)?.toLowerCase() === "source",
|
|
100
|
+
)?.uniqueIdentifier;
|
|
117
101
|
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
102
|
+
if (sourceName) {
|
|
103
|
+
configMergeInput.input.config = configMergeInput.input.config.map(
|
|
104
|
+
(item) => {
|
|
105
|
+
if (item?.queues) {
|
|
106
|
+
return {
|
|
107
|
+
...item,
|
|
108
|
+
queues: `${sourceName}_endpoint`,
|
|
109
|
+
};
|
|
110
|
+
} else {
|
|
111
|
+
return item;
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
);
|
|
127
115
|
}
|
|
128
116
|
|
|
129
117
|
processConfigMergeMutation.mutate(
|
|
130
118
|
{
|
|
131
|
-
|
|
132
|
-
|
|
119
|
+
input:
|
|
120
|
+
removeTemplateConfig(newProcessConfigMerge?.input) ||
|
|
121
|
+
({} as ConfigurationMergeMutationVariables),
|
|
133
122
|
},
|
|
134
123
|
{
|
|
135
124
|
onSuccess: ({ configurationMerge }) => {
|
|
@@ -247,20 +236,23 @@ export default function IntegrationCreate() {
|
|
|
247
236
|
<TemplateListStep
|
|
248
237
|
listStepTitle={t("Templates.SelectSource")}
|
|
249
238
|
directionType={DirectionType.Incoming}
|
|
250
|
-
onSelectTemplate={
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
239
|
+
onSelectTemplate={
|
|
240
|
+
dualSourceThenTarget
|
|
241
|
+
? (id) => {
|
|
242
|
+
const p = new URLSearchParams(searchParams.toString());
|
|
243
|
+
p.set(`${t("Templates.sourceGroup")}`, id);
|
|
244
|
+
p.delete(`${t("Templates.group")}`);
|
|
245
|
+
router.replace(`${pathname}?${p}`);
|
|
246
|
+
setStep(INTEGRATION_CREATE_STEPS.targetTemplateList);
|
|
247
|
+
}
|
|
248
|
+
: undefined
|
|
249
|
+
}
|
|
255
250
|
/>
|
|
256
251
|
)}
|
|
257
252
|
{step === INTEGRATION_CREATE_STEPS.targetTemplateList && (
|
|
258
253
|
<TemplateListStep
|
|
259
254
|
listStepTitle={t("Templates.SelectTarget")}
|
|
260
255
|
directionType={DirectionType.Outgoing}
|
|
261
|
-
// onSelectTemplate={
|
|
262
|
-
// ()=>setStep(INTEGRATION_CREATE_STEPS.wizard)
|
|
263
|
-
// }
|
|
264
256
|
/>
|
|
265
257
|
)}
|
|
266
258
|
{/* </Card> */}
|
|
@@ -50,7 +50,7 @@ export default function PreCreationStep(props: Readonly<Props>) {
|
|
|
50
50
|
processTaskId={undefined}
|
|
51
51
|
onTaskClick={(processTask: ProcessTask) => {
|
|
52
52
|
const endpoint = (props.processConfig?.Endpoints ?? []).find(
|
|
53
|
-
(ep) => ep?.Name === processTask.endpoint,
|
|
53
|
+
(ep) => ep?.Name === processTask.endpoint?.name,
|
|
54
54
|
);
|
|
55
55
|
|
|
56
56
|
let templateConfig: string | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
FilterQueryInput,
|
|
3
|
-
|
|
3
|
+
GetProcessTemplateGroupsQuery,
|
|
4
4
|
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
5
|
-
import {
|
|
5
|
+
import { getProcessTemplateGroups } from "@evenicanpm/admin-integrate/api/templates/queries";
|
|
6
6
|
import type { Head } from "@evenicanpm/admin-integrate/components/data-table/table-header";
|
|
7
7
|
import TemplatesList from "@evenicanpm/admin-integrate/components/templatesV2/templates-list";
|
|
8
8
|
import { Box, Typography, useTheme } from "@mui/material";
|
|
@@ -17,12 +17,12 @@ export enum DirectionType {
|
|
|
17
17
|
|
|
18
18
|
interface Props {
|
|
19
19
|
listStepTitle?: string;
|
|
20
|
-
directionType
|
|
20
|
+
directionType?: DirectionType;
|
|
21
21
|
/** When set, skips default `group` URL handoff (e.g. source pick in dual flow). */
|
|
22
22
|
onSelectTemplate?: (id: string) => void;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export default function TemplateListStep(props
|
|
25
|
+
export default function TemplateListStep(props?: Props) {
|
|
26
26
|
const t = useTranslations("Integrate.Templates");
|
|
27
27
|
|
|
28
28
|
const router = useRouter();
|
|
@@ -62,15 +62,18 @@ export default function TemplateListStep(props: Props) {
|
|
|
62
62
|
skip: 0,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
const { data, isLoading } =
|
|
65
|
+
const { data, isLoading } = getProcessTemplateGroups.useData({
|
|
66
66
|
input: input,
|
|
67
67
|
});
|
|
68
68
|
|
|
69
69
|
const handleRedirect = (id: string) => {
|
|
70
|
+
if (props?.onSelectTemplate) {
|
|
71
|
+
props.onSelectTemplate(id);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
70
74
|
const currentParams = new URLSearchParams(searchParams.toString());
|
|
71
|
-
currentParams.set(
|
|
75
|
+
currentParams.set("group", id);
|
|
72
76
|
router.replace(`${pathname}?${currentParams.toString()}`);
|
|
73
|
-
if (props?.onSelectTemplate) props.onSelectTemplate(id);
|
|
74
77
|
};
|
|
75
78
|
|
|
76
79
|
return (
|
|
@@ -86,11 +89,13 @@ export default function TemplateListStep(props: Props) {
|
|
|
86
89
|
</Box>
|
|
87
90
|
<TemplatesList
|
|
88
91
|
heading={heading}
|
|
89
|
-
data={data as
|
|
92
|
+
data={data as GetProcessTemplateGroupsQuery}
|
|
90
93
|
loading={isLoading}
|
|
94
|
+
// input={{ ...input, directionType: props?.directionType }}
|
|
91
95
|
input={input}
|
|
92
96
|
setInput={setInput}
|
|
93
97
|
handleRedirect={handleRedirect}
|
|
98
|
+
isTemplateGroupsList
|
|
94
99
|
/>
|
|
95
100
|
</Box>
|
|
96
101
|
);
|
|
@@ -12,13 +12,6 @@ import {
|
|
|
12
12
|
import { useTranslations } from "next-intl";
|
|
13
13
|
import type React from "react";
|
|
14
14
|
import { INTEGRATION_CREATE_STEPS } from "./integration-create-steps";
|
|
15
|
-
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
16
|
-
|
|
17
|
-
export enum TemplateOption {
|
|
18
|
-
Source = "source",
|
|
19
|
-
Target = "target",
|
|
20
|
-
SourceAndTarget = "both",
|
|
21
|
-
}
|
|
22
15
|
|
|
23
16
|
interface Props {
|
|
24
17
|
setStep: React.Dispatch<React.SetStateAction<number>>;
|
|
@@ -31,27 +24,14 @@ export default function TemplateOptionsStep(props: Props) {
|
|
|
31
24
|
const theme = useTheme();
|
|
32
25
|
const styles = getStyles(theme);
|
|
33
26
|
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const handleClickOption = (option: TemplateOption) => {
|
|
39
|
-
switch (option) {
|
|
40
|
-
case TemplateOption.SourceAndTarget:
|
|
41
|
-
props.onSourceAndTarget?.();
|
|
42
|
-
props.setStep(INTEGRATION_CREATE_STEPS.sourceTemplateList);
|
|
43
|
-
break;
|
|
44
|
-
case TemplateOption.Source:
|
|
45
|
-
props.setStep(INTEGRATION_CREATE_STEPS.sourceTemplateList);
|
|
46
|
-
break;
|
|
47
|
-
case TemplateOption.Target:
|
|
48
|
-
props.setStep(INTEGRATION_CREATE_STEPS.targetTemplateList);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const currentParams = new URLSearchParams(searchParams.toString());
|
|
52
|
-
currentParams.set("option", option);
|
|
53
|
-
router.replace(`${pathname}?${currentParams.toString()}`);
|
|
27
|
+
const handleClickOption1 = () => {
|
|
28
|
+
props.onSourceAndTarget?.();
|
|
29
|
+
props.setStep(INTEGRATION_CREATE_STEPS.sourceTemplateList);
|
|
54
30
|
};
|
|
31
|
+
const handleClickOption2 = () =>
|
|
32
|
+
props.setStep(INTEGRATION_CREATE_STEPS.sourceTemplateList);
|
|
33
|
+
const handleClickOption3 = () =>
|
|
34
|
+
props.setStep(INTEGRATION_CREATE_STEPS.targetTemplateList);
|
|
55
35
|
|
|
56
36
|
return (
|
|
57
37
|
<Box sx={styles.main}>
|
|
@@ -65,7 +45,7 @@ export default function TemplateOptionsStep(props: Props) {
|
|
|
65
45
|
<LinkCard
|
|
66
46
|
title={t("templateOption1")}
|
|
67
47
|
description={t("templateOption1Description")}
|
|
68
|
-
onClick={
|
|
48
|
+
onClick={handleClickOption1}
|
|
69
49
|
>
|
|
70
50
|
<Box
|
|
71
51
|
sx={{
|
|
@@ -82,7 +62,7 @@ export default function TemplateOptionsStep(props: Props) {
|
|
|
82
62
|
<LinkCard
|
|
83
63
|
title={t("templateOption2")}
|
|
84
64
|
description={t("templateOption2Description")}
|
|
85
|
-
onClick={
|
|
65
|
+
onClick={handleClickOption2}
|
|
86
66
|
>
|
|
87
67
|
<Box
|
|
88
68
|
sx={{
|
|
@@ -99,7 +79,7 @@ export default function TemplateOptionsStep(props: Props) {
|
|
|
99
79
|
<LinkCard
|
|
100
80
|
title={t("templateOption3")}
|
|
101
81
|
description={t("templateOption3Description")}
|
|
102
|
-
onClick={
|
|
82
|
+
onClick={handleClickOption3}
|
|
103
83
|
>
|
|
104
84
|
<Box
|
|
105
85
|
sx={{
|
|
@@ -8,8 +8,6 @@ import { Box } from "@mui/material";
|
|
|
8
8
|
import { usePathname, useRouter, useSearchParams } from "next/navigation";
|
|
9
9
|
import { INTEGRATION_CREATE_STEPS } from "./integration-create-steps";
|
|
10
10
|
|
|
11
|
-
import { DirectionType } from "./template-list-step";
|
|
12
|
-
|
|
13
11
|
const metadata = {
|
|
14
12
|
name: "",
|
|
15
13
|
code: "",
|
|
@@ -39,26 +37,14 @@ export default function WizardStep(props: Readonly<Props>) {
|
|
|
39
37
|
router.replace(pathname);
|
|
40
38
|
};
|
|
41
39
|
|
|
42
|
-
console.log(
|
|
43
|
-
"SEARHCPARAMS",
|
|
44
|
-
searchParams.get(DirectionType.Incoming)?.toString(),
|
|
45
|
-
);
|
|
46
|
-
console.log(
|
|
47
|
-
"SEARHCPARAMS",
|
|
48
|
-
searchParams.get(DirectionType.Outgoing)?.toString(),
|
|
49
|
-
);
|
|
50
|
-
|
|
51
40
|
return (
|
|
52
41
|
<Box>
|
|
53
42
|
<Wizard
|
|
54
43
|
metadata={metadata}
|
|
55
|
-
|
|
56
|
-
sourceTemplateId={searchParams.get(DirectionType.Incoming)?.toString()}
|
|
57
|
-
targetTemplateId={searchParams.get(DirectionType.Outgoing)?.toString()}
|
|
44
|
+
processTemplateGroupId={searchParams.get("group")?.toString()}
|
|
58
45
|
handleBack={handleBack}
|
|
59
46
|
handleFinish={handleFinish}
|
|
60
47
|
setProcessConfigMerge={props.setProcessConfigMerge}
|
|
61
|
-
config={{}}
|
|
62
48
|
isCreateMode
|
|
63
49
|
/>
|
|
64
50
|
</Box>
|
|
@@ -3,6 +3,7 @@ import type {
|
|
|
3
3
|
ConfigImport,
|
|
4
4
|
ConfigurationExportQuery,
|
|
5
5
|
GetProcessByIdQuery,
|
|
6
|
+
ProcessTask,
|
|
6
7
|
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
7
8
|
import { getProcessById } from "@evenicanpm/admin-integrate/api/process/queries";
|
|
8
9
|
import { buildProcessByIdQueryKey } from "@evenicanpm/admin-integrate/api/process/queries/get-process-by-id.query";
|
|
@@ -298,7 +299,7 @@ export default function IntegrationDetails() {
|
|
|
298
299
|
type: TaskActionType.OPEN_ADD,
|
|
299
300
|
sort: data.sort,
|
|
300
301
|
parallelProcessingGroup: data.paralellelProcessingGroup,
|
|
301
|
-
} as EditAction);
|
|
302
|
+
} as unknown as EditAction);
|
|
302
303
|
};
|
|
303
304
|
|
|
304
305
|
useEffect(() => {
|
|
@@ -404,62 +405,32 @@ export default function IntegrationDetails() {
|
|
|
404
405
|
.configurationExport as ConfigExport)
|
|
405
406
|
}
|
|
406
407
|
variant="process"
|
|
407
|
-
onTaskClick={(processTask:
|
|
408
|
+
onTaskClick={(processTask: ProcessTask) => {
|
|
408
409
|
const endpoint = (
|
|
409
410
|
config ??
|
|
410
411
|
(configFromApi as ConfigurationExportQuery).configurationExport
|
|
411
412
|
)?.Endpoints?.find(
|
|
412
|
-
(ep) => !!ep && ep.Name === processTask.endpoint,
|
|
413
|
+
(ep) => !!ep && ep.Name === processTask.endpoint?.name,
|
|
413
414
|
);
|
|
414
415
|
|
|
415
|
-
let
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
?.configurationExport,
|
|
423
|
-
),
|
|
424
|
-
)
|
|
425
|
-
: null;
|
|
426
|
-
|
|
427
|
-
if (filteredConfig?.Processes?.[0]) {
|
|
428
|
-
filteredConfig.Processes[0].ProcessTasks =
|
|
429
|
-
filteredConfig.Processes[0].ProcessTasks?.filter(
|
|
430
|
-
(task) =>
|
|
431
|
-
!!task &&
|
|
432
|
-
Number.parseInt(task.ProcessTaskId ?? "") ===
|
|
433
|
-
Number.parseInt(processTask.id),
|
|
434
|
-
) || [];
|
|
435
|
-
|
|
436
|
-
filteredConfig.Endpoints =
|
|
437
|
-
filteredConfig.Endpoints?.filter(
|
|
438
|
-
(ep) => !!ep && ep.Name === processTask.endpoint,
|
|
439
|
-
) || [];
|
|
440
|
-
|
|
441
|
-
if ((filteredConfig.Endpoints?.length ?? 0) > 0 && endpoint) {
|
|
442
|
-
filteredConfig.Entities =
|
|
443
|
-
filteredConfig.Entities?.filter(
|
|
444
|
-
(entity) =>
|
|
445
|
-
!!entity &&
|
|
446
|
-
entity.Name === filteredConfig?.Endpoints?.[0]?.Entity,
|
|
447
|
-
) || [];
|
|
416
|
+
let templateConfig: string | undefined;
|
|
417
|
+
|
|
418
|
+
if (endpoint) {
|
|
419
|
+
if (typeof endpoint.TemplateConfig === "string") {
|
|
420
|
+
templateConfig = endpoint.TemplateConfig;
|
|
421
|
+
} else if (typeof endpoint.TemplateConfig === "object") {
|
|
422
|
+
templateConfig = JSON.stringify(endpoint.TemplateConfig);
|
|
448
423
|
}
|
|
449
424
|
}
|
|
450
425
|
|
|
451
|
-
console.log("filtered down Config", filteredConfig);
|
|
452
|
-
|
|
453
426
|
dispatchTaskState({
|
|
454
427
|
type: TaskActionType.OPEN_EDIT,
|
|
455
428
|
processTaskId: processTask.id,
|
|
456
|
-
|
|
457
|
-
config: filteredConfig,
|
|
429
|
+
templateConfig: templateConfig,
|
|
458
430
|
sort: processTask.sort,
|
|
459
431
|
parallelProcessingGroup: processTask.parallelProcessingGroup,
|
|
460
|
-
processTemplateId:
|
|
432
|
+
processTemplateId: endpoint?.ProcessTemplateId,
|
|
461
433
|
name: processTask.name,
|
|
462
|
-
directionTypeId: processTask.directionTypeId,
|
|
463
434
|
} as EditAction);
|
|
464
435
|
}}
|
|
465
436
|
drawerOpen={taskState.open}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
ConfigExport,
|
|
3
3
|
ConfigurationMergeMutation,
|
|
4
|
+
ConfigurationMergeMutationVariables,
|
|
4
5
|
} from "@evenicanpm/admin-core/api/e4/graphqlRequestSdk";
|
|
5
6
|
import { processConfigMerge } from "@evenicanpm/admin-integrate/api/process-config/mutation";
|
|
6
7
|
import { TitleEdit } from "@evenicanpm/admin-integrate/components/core";
|
|
@@ -62,21 +63,12 @@ export default function EditTask(props: Readonly<Props>) {
|
|
|
62
63
|
|
|
63
64
|
useEffect(() => {
|
|
64
65
|
if (processConfigMergeInput) {
|
|
65
|
-
const input =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
};
|
|
66
|
+
const input =
|
|
67
|
+
removeTemplateConfig(processConfigMergeInput?.input) ||
|
|
68
|
+
({} as ConfigurationMergeMutationVariables);
|
|
69
69
|
processConfigMergeMutation.mutate(
|
|
70
70
|
{
|
|
71
|
-
|
|
72
|
-
input: {
|
|
73
|
-
sourceConfig:
|
|
74
|
-
props.taskState.directionTypeId === 0 ? input?.config[0] : null,
|
|
75
|
-
targetConfig:
|
|
76
|
-
props.taskState.directionTypeId === 1 ? input?.config[1] : null,
|
|
77
|
-
targetSourcesConfig:
|
|
78
|
-
props.taskState.directionTypeId === 1 ? input?.config[0] : null,
|
|
79
|
-
} as any,
|
|
71
|
+
input: input,
|
|
80
72
|
},
|
|
81
73
|
{
|
|
82
74
|
onSuccess: async (data: ConfigurationMergeMutation) => {
|
|
@@ -151,24 +143,13 @@ export default function EditTask(props: Readonly<Props>) {
|
|
|
151
143
|
setProcessConfigMerge={setProcessConfigMergeInput}
|
|
152
144
|
handleBack={handleBack}
|
|
153
145
|
handleFinish={handleFinish}
|
|
154
|
-
|
|
146
|
+
templateConfig={props.taskState.templateConfig}
|
|
155
147
|
processTemplateId={props.taskState.processTemplateId as string}
|
|
156
148
|
isEditMode
|
|
157
149
|
isCreateMode={false}
|
|
158
150
|
disableBackToTemplates
|
|
159
151
|
readOnly={!props.editable}
|
|
160
152
|
sharedCount={(count: number) => setSharedCount(count)}
|
|
161
|
-
sourceTemplateId={
|
|
162
|
-
(props.taskState.directionTypeId as number) == 0
|
|
163
|
-
? props.taskState.processTemplateId
|
|
164
|
-
: undefined
|
|
165
|
-
}
|
|
166
|
-
targetTemplateId={
|
|
167
|
-
(props.taskState.directionTypeId as number) == 1
|
|
168
|
-
? props.taskState.processTemplateId
|
|
169
|
-
: undefined
|
|
170
|
-
}
|
|
171
|
-
config={{ json: props.taskState.config as Record<string, unknown> }}
|
|
172
153
|
/>
|
|
173
154
|
)}
|
|
174
155
|
{props.taskState.step === 1 && (
|
|
@@ -23,8 +23,6 @@ export interface EditAction extends TaskAction {
|
|
|
23
23
|
parallelProcessingGroup?: number;
|
|
24
24
|
processTemplateId?: string;
|
|
25
25
|
name?: string;
|
|
26
|
-
directionTypeId?: number;
|
|
27
|
-
config?: object;
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
export interface TaskState {
|
|
@@ -37,8 +35,6 @@ export interface TaskState {
|
|
|
37
35
|
parallelProcessingGroup?: number;
|
|
38
36
|
processTemplateId?: string;
|
|
39
37
|
name?: string;
|
|
40
|
-
directionTypeId?: number;
|
|
41
|
-
config?: object | null;
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
export function taskReducer(state: TaskState, action: TaskAction): TaskState {
|
|
@@ -73,8 +69,6 @@ export function taskReducer(state: TaskState, action: TaskAction): TaskState {
|
|
|
73
69
|
parallelProcessingGroup: (action as EditAction).parallelProcessingGroup,
|
|
74
70
|
processTemplateId: (action as EditAction).processTemplateId,
|
|
75
71
|
name: (action as EditAction).name,
|
|
76
|
-
directionTypeId: (action as EditAction).directionTypeId,
|
|
77
|
-
config: (action as EditAction).config,
|
|
78
72
|
};
|
|
79
73
|
}
|
|
80
74
|
case TaskActionType.INCREMENT_STEP: {
|
package/tsconfig.json
CHANGED
|
@@ -12,27 +12,13 @@
|
|
|
12
12
|
"outDir": "./dist",
|
|
13
13
|
"jsx": "preserve",
|
|
14
14
|
"baseUrl": "./",
|
|
15
|
-
"typeRoots": ["../../../../admin/node_modules/@types"],
|
|
16
15
|
"paths": {
|
|
17
|
-
"
|
|
18
|
-
"@/
|
|
19
|
-
|
|
20
|
-
],
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
],
|
|
24
|
-
"@/api/*": [
|
|
25
|
-
"../../../../admin/node_modules/@evenicanpm/admin-integrate/src/api/*"
|
|
26
|
-
],
|
|
27
|
-
"@/components/*": [
|
|
28
|
-
"../../../../admin/node_modules/@evenicanpm/admin-integrate/src/components/*"
|
|
29
|
-
],
|
|
30
|
-
"@evenicanpm/admin-core/*": [
|
|
31
|
-
"../../../../admin/node_modules/@evenicanpm/admin-core/src/*"
|
|
32
|
-
],
|
|
33
|
-
"@evenicanpm/admin-integrate/*": [
|
|
34
|
-
"../../../../admin/node_modules/@evenicanpm/admin-integrate/src/*"
|
|
35
|
-
]
|
|
16
|
+
"@/lib/*": ["src/lib/*"],
|
|
17
|
+
"@/auth/*": ["src/auth/*"],
|
|
18
|
+
"@/api/*": ["src/api/*"],
|
|
19
|
+
"@/components/*": ["src/components/*"],
|
|
20
|
+
"@evenicanpm/admin-core/*": ["../admin-core/src/*"],
|
|
21
|
+
"@evenicanpm/admin-integrate/*": ["src/*"]
|
|
36
22
|
}
|
|
37
23
|
},
|
|
38
24
|
"include": ["src"]
|