udp-react-enterprise-component-library 26.2.0-beta.3 → 26.2.0-beta.5
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/dist/.tsbuildinfo +1 -1
- package/dist/index.mjs +47 -47
- package/dist/udp/fileImportMapping/FileImportConfigCard.d.ts.map +1 -1
- package/dist/udp/fileImportMapping/FileImportConfigCard.js +9 -9
- package/dist/udp/fileImportMapping/FileImportConfigCard.js.map +1 -1
- package/dist/udp/fileImportMapping/FileImportConfigCard.mjs +20 -16
- package/dist/udp/fileImportMapping/FileImportConfigCard.mjs.map +1 -1
- package/dist/udp/fileImportMapping/FileImportMappingWizard.d.ts.map +1 -1
- package/dist/udp/fileImportMapping/FileImportMappingWizard.js +34 -45
- package/dist/udp/fileImportMapping/FileImportMappingWizard.js.map +1 -1
- package/dist/udp/fileImportMapping/FileImportMappingWizard.mjs +430 -260
- package/dist/udp/fileImportMapping/FileImportMappingWizard.mjs.map +1 -1
- package/dist/udp/fileImportMapping/ImportDataFromFileMapping.d.ts.map +1 -1
- package/dist/udp/fileImportMapping/ImportDataFromFileMapping.js +14 -15
- package/dist/udp/fileImportMapping/ImportDataFromFileMapping.js.map +1 -1
- package/dist/udp/fileImportMapping/ImportDataFromFileMapping.mjs +164 -158
- package/dist/udp/fileImportMapping/ImportDataFromFileMapping.mjs.map +1 -1
- package/dist/udp/lookups/LookupCreationSheet.mjs +4 -4
- package/package.json +2 -2
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { Form } from "../../utilities/form/Form.mjs";
|
|
2
2
|
import { Field } from "../../utilities/form/Field.mjs";
|
|
3
|
-
import { FluentButton } from "../../UI/inputs/buttons/FluentButton.mjs";
|
|
4
|
-
import { SubmitButton } from "../../utilities/form/SubmitButton.mjs";
|
|
5
|
-
import { FormButtons } from "../../utilities/form/FormButtons.mjs";
|
|
6
3
|
import { ConfigService } from "../../configService/index.mjs";
|
|
7
4
|
import { useHandleAxiosSnackbar } from "../../utilities/apiHelpers.mjs";
|
|
8
5
|
import { useUser } from "../../utilities/auth/useUser.mjs";
|
|
9
6
|
import { apiMutate } from "../../utilities/useAxiosMutate.mjs";
|
|
10
|
-
import { FluentIcon } from "../../utilities/iconLibrary/FluentIcon.mjs";
|
|
11
7
|
import { getSanitizedName } from "../../utilities/entities/entityUtilities.mjs";
|
|
12
8
|
import { useAxiosGet } from "../../utilities/useAxiosGet.mjs";
|
|
13
9
|
import { usePromotedMethodEntity } from "../../hooks/usePromotedMethodEntity.mjs";
|
|
14
10
|
import { executeQueryAdHoc } from "../utilities/methodUtils.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
11
|
+
import { UdpButton } from "../../UI/fluent-web-components/UdpButton.mjs";
|
|
12
|
+
import { UdpAutocomplete } from "../../UI/fluent-web-components/UdpAutocomplete.mjs";
|
|
13
|
+
import { UdpText } from "../../UI/fluent-web-components/UdpText.mjs";
|
|
14
|
+
import { UdpCard } from "../../UI/fluent-web-components/UdpCard.mjs";
|
|
15
|
+
import { UdpFileInput } from "../../UI/fluent-web-components/UdpFileInput.mjs";
|
|
20
16
|
import { AmbientStepper } from "../../UI/inputs/menus/AmbientStepper/AmbientStepper.mjs";
|
|
17
|
+
import { UdpDivider } from "../../UI/fluent-web-components/UdpDivider.mjs";
|
|
18
|
+
import { UdpDropdown } from "../../UI/fluent-web-components/UdpDropdown.mjs";
|
|
19
|
+
import { UdpIcon } from "../../UI/fluent-web-components/UdpIcon.mjs";
|
|
20
|
+
import { UdpTextInput } from "../../UI/fluent-web-components/UdpTextInput.mjs";
|
|
21
21
|
import { handleExcelFileUpload, handleJsonFileUpload, handleTextFileUpload } from "./fileUtils.mjs";
|
|
22
22
|
import { FileImportConfigCard } from "./FileImportConfigCard.mjs";
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
import { ChromeBackMirroredIcon } from "@fluentui/react-icons";
|
|
23
|
+
import { c } from "react-compiler-runtime";
|
|
24
|
+
import React, { useEffect, useState } from "react";
|
|
26
25
|
//#region src/udp/fileImportMapping/FileImportMappingWizard.jsx
|
|
27
26
|
const FileImportMappingWizard = (props) => {
|
|
27
|
+
const $ = c(70);
|
|
28
28
|
const { refetchMappings, setNewFileMappingSidesheetOpen, verifyRequiredFields } = props;
|
|
29
29
|
const user = useUser();
|
|
30
30
|
const [importHeaderData, setImportHeaderData] = useState();
|
|
@@ -32,278 +32,448 @@ const FileImportMappingWizard = (props) => {
|
|
|
32
32
|
const [selectedDomain, setSelectedDomain] = useState();
|
|
33
33
|
const [selectedFileType, setSelectedFileType] = useState();
|
|
34
34
|
const [fileObject, setFileObject] = useState();
|
|
35
|
-
|
|
35
|
+
let t0;
|
|
36
|
+
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
37
|
+
t0 = [];
|
|
38
|
+
$[0] = t0;
|
|
39
|
+
} else t0 = $[0];
|
|
40
|
+
const [fileItems, setFileItems] = useState(t0);
|
|
41
|
+
let t1;
|
|
42
|
+
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43
|
+
t1 = {};
|
|
44
|
+
$[1] = t1;
|
|
45
|
+
} else t1 = $[1];
|
|
46
|
+
const [fileImportMappingObject, setFileImportMappingObject] = useState(t1);
|
|
36
47
|
const [activeStep, setActiveStep] = useState(0);
|
|
37
48
|
const [showIndexNumbers, setShowIndexNumbers] = useState(false);
|
|
38
49
|
const [errorText, setErrorText] = useState("");
|
|
39
50
|
const { handleErrorSnackbar, handleSuccessSnackbar } = useHandleAxiosSnackbar();
|
|
40
|
-
const executeCreateFileMapping =
|
|
51
|
+
const executeCreateFileMapping = _temp;
|
|
41
52
|
const { data: udpObjectEntity } = usePromotedMethodEntity("UdpObjectInfo", true);
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
102
|
-
|
|
53
|
+
let t2;
|
|
54
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
55
|
+
t2 = {};
|
|
56
|
+
$[2] = t2;
|
|
57
|
+
} else t2 = $[2];
|
|
58
|
+
const [t3] = useAxiosGet(ConfigService.productV1ApiUrl, "UdpFileImportType", t2, false);
|
|
59
|
+
const { data: allowedFileTypesData } = t3;
|
|
60
|
+
let t4;
|
|
61
|
+
if ($[3] !== udpObjectEntity?.unityBaseSearchMethod?.apiMethodId || $[4] !== user?.id) {
|
|
62
|
+
t4 = async () => {
|
|
63
|
+
if (udpObjectEntity?.unityBaseSearchMethod?.apiMethodId && user?.id) {
|
|
64
|
+
const sapUserRes = await executeQueryAdHoc({ data: {
|
|
65
|
+
eagerLoad: true,
|
|
66
|
+
pageSize: 200,
|
|
67
|
+
filterElements: []
|
|
68
|
+
} }, udpObjectEntity?.unityBaseSearchMethod?.apiMethodId);
|
|
69
|
+
if (sapUserRes?.data?.pageList.length > 0) setUdpObjectList(sapUserRes?.data?.pageList);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
$[3] = udpObjectEntity?.unityBaseSearchMethod?.apiMethodId;
|
|
73
|
+
$[4] = user?.id;
|
|
74
|
+
$[5] = t4;
|
|
75
|
+
} else t4 = $[5];
|
|
76
|
+
const searchUdpObjectData = t4;
|
|
77
|
+
const filterCatalogObjectList = udpObjectList;
|
|
78
|
+
const getNameFormattedOptionLabel = _temp2;
|
|
79
|
+
let t5;
|
|
80
|
+
if ($[6] !== fileObject || $[7] !== selectedFileType.extension) {
|
|
81
|
+
t5 = async (properties) => {
|
|
82
|
+
let result;
|
|
83
|
+
if (selectedFileType.extension === ".csv" || selectedFileType.extension === ".txt") result = await handleTextFileUpload(fileObject, properties);
|
|
84
|
+
else if (selectedFileType.extension === ".xlsx") result = await handleExcelFileUpload(fileObject, properties);
|
|
85
|
+
else if (selectedFileType.extension === ".json") result = await handleJsonFileUpload(fileObject, properties);
|
|
86
|
+
setImportHeaderData(result?.headers);
|
|
87
|
+
};
|
|
88
|
+
$[6] = fileObject;
|
|
89
|
+
$[7] = selectedFileType.extension;
|
|
90
|
+
$[8] = t5;
|
|
91
|
+
} else t5 = $[8];
|
|
92
|
+
const handleFileUpload = t5;
|
|
93
|
+
let t6;
|
|
94
|
+
let t7;
|
|
95
|
+
if ($[9] !== searchUdpObjectData) {
|
|
96
|
+
t6 = () => {
|
|
97
|
+
searchUdpObjectData();
|
|
98
|
+
};
|
|
99
|
+
t7 = [searchUdpObjectData];
|
|
100
|
+
$[9] = searchUdpObjectData;
|
|
101
|
+
$[10] = t6;
|
|
102
|
+
$[11] = t7;
|
|
103
|
+
} else {
|
|
104
|
+
t6 = $[10];
|
|
105
|
+
t7 = $[11];
|
|
106
|
+
}
|
|
107
|
+
useEffect(t6, t7);
|
|
108
|
+
let t8;
|
|
109
|
+
if ($[12] !== fileImportMappingObject?.mapping || $[13] !== fileImportMappingObject?.properties || $[14] !== handleErrorSnackbar || $[15] !== handleSuccessSnackbar || $[16] !== refetchMappings || $[17] !== selectedDomain?.name || $[18] !== selectedFileType.id || $[19] !== setNewFileMappingSidesheetOpen) {
|
|
110
|
+
t8 = async (values) => {
|
|
111
|
+
if ((await executeCreateFileMapping({
|
|
112
|
+
name: values.name,
|
|
113
|
+
objectInfoSanitizedName: getSanitizedName(selectedDomain?.name),
|
|
114
|
+
fileImportType: selectedFileType?.id,
|
|
115
|
+
mapping: JSON.stringify(fileImportMappingObject?.mapping),
|
|
116
|
+
properties: JSON.stringify(fileImportMappingObject?.properties)
|
|
117
|
+
}).catch((res) => {
|
|
118
|
+
handleErrorSnackbar(res);
|
|
119
|
+
}))?.status === 201) {
|
|
120
|
+
handleSuccessSnackbar("Created Mapping");
|
|
121
|
+
refetchMappings();
|
|
122
|
+
setNewFileMappingSidesheetOpen(false);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
$[12] = fileImportMappingObject?.mapping;
|
|
126
|
+
$[13] = fileImportMappingObject?.properties;
|
|
127
|
+
$[14] = handleErrorSnackbar;
|
|
128
|
+
$[15] = handleSuccessSnackbar;
|
|
129
|
+
$[16] = refetchMappings;
|
|
130
|
+
$[17] = selectedDomain?.name;
|
|
131
|
+
$[18] = selectedFileType.id;
|
|
132
|
+
$[19] = setNewFileMappingSidesheetOpen;
|
|
133
|
+
$[20] = t8;
|
|
134
|
+
} else t8 = $[20];
|
|
135
|
+
const handleCreateNewFieldMapping = t8;
|
|
136
|
+
let t9;
|
|
137
|
+
if ($[21] !== importHeaderData || $[22] !== selectedDomain?.objectFieldInfo || $[23] !== showIndexNumbers || $[24] !== verifyRequiredFields) {
|
|
138
|
+
t9 = (values_0) => {
|
|
139
|
+
let valid = true;
|
|
140
|
+
selectedDomain?.objectFieldInfo?.forEach((option_1) => {
|
|
141
|
+
if (!option_1.dataType.endsWith("?") && !option_1.isPrimaryKey && !option_1.udpType) {
|
|
142
|
+
if (!Object.entries(values_0).some((obj) => obj[1].businessObjectKey === option_1.businessObjectKey)) {
|
|
143
|
+
if (verifyRequiredFields) valid = false;
|
|
144
|
+
}
|
|
103
145
|
}
|
|
146
|
+
});
|
|
147
|
+
if (!valid) {
|
|
148
|
+
setErrorText("All required Udp fields must have a mapping");
|
|
149
|
+
return;
|
|
104
150
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const filteredMappings = Object.entries(values_0).filter(([key, value]) => value !== null).reduce((acc, [key_0, value_0]) => {
|
|
111
|
-
acc[key_0] = value_0;
|
|
112
|
-
return acc;
|
|
113
|
-
}, {});
|
|
114
|
-
const mappedFieldIndexes = Object.keys(filteredMappings).map((key_1) => parseInt(key_1.split("udpFieldMapping")[1], 10));
|
|
115
|
-
const fieldMappings = Object.values(filteredMappings).map((selectedUdpField, index) => {
|
|
116
|
-
return {
|
|
151
|
+
const filteredMappings = Object.entries(values_0).filter(_temp3).reduce(_temp4, {});
|
|
152
|
+
const mappedFieldIndexes = Object.keys(filteredMappings).map(_temp5);
|
|
153
|
+
const fieldMappings = Object.values(filteredMappings).map((selectedUdpField, index) => ({
|
|
117
154
|
udpField: selectedUdpField.name,
|
|
118
155
|
importFileField: !showIndexNumbers ? importHeaderData[mappedFieldIndexes[index]] : null,
|
|
119
156
|
headerIndex: !showIndexNumbers ? -1 : mappedFieldIndexes[index]
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
setFileImportMappingObject((prev) => {
|
|
123
|
-
return {
|
|
157
|
+
}));
|
|
158
|
+
setFileImportMappingObject((prev) => ({
|
|
124
159
|
...prev,
|
|
125
160
|
mapping: fieldMappings
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
161
|
+
}));
|
|
162
|
+
setActiveStep(_temp6);
|
|
163
|
+
};
|
|
164
|
+
$[21] = importHeaderData;
|
|
165
|
+
$[22] = selectedDomain?.objectFieldInfo;
|
|
166
|
+
$[23] = showIndexNumbers;
|
|
167
|
+
$[24] = verifyRequiredFields;
|
|
168
|
+
$[25] = t9;
|
|
169
|
+
} else t9 = $[25];
|
|
170
|
+
const handleUpdateFieldMapping = t9;
|
|
171
|
+
let t10;
|
|
172
|
+
if ($[26] !== handleFileUpload) {
|
|
173
|
+
t10 = (values_1) => {
|
|
174
|
+
setFileImportMappingObject((prev_1) => {
|
|
175
|
+
const properties_0 = {};
|
|
176
|
+
Object.keys(values_1).forEach((propKey) => properties_0[propKey] = "value" in values_1[propKey] ? values_1[propKey]?.value : values_1[propKey]);
|
|
177
|
+
return {
|
|
178
|
+
...prev_1,
|
|
179
|
+
properties: properties_0
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
if ("includesHeader" in values_1 && values_1?.includesHeader.value === false) setShowIndexNumbers(true);
|
|
183
|
+
handleFileUpload(values_1);
|
|
184
|
+
setActiveStep(_temp7);
|
|
185
|
+
};
|
|
186
|
+
$[26] = handleFileUpload;
|
|
187
|
+
$[27] = t10;
|
|
188
|
+
} else t10 = $[27];
|
|
189
|
+
const handleUpdateFileProperties = t10;
|
|
190
|
+
const getUdpFieldOptionLabel = _temp8;
|
|
191
|
+
let t11;
|
|
192
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
193
|
+
t11 = (e) => {
|
|
194
|
+
const items = e.target.value;
|
|
195
|
+
setFileItems(items);
|
|
196
|
+
setFileObject(items.find(_temp9)?.file);
|
|
197
|
+
};
|
|
198
|
+
$[28] = t11;
|
|
199
|
+
} else t11 = $[28];
|
|
200
|
+
const handleAddFileToUpload = t11;
|
|
201
|
+
let t12;
|
|
202
|
+
bb0: {
|
|
203
|
+
if (selectedFileType) {
|
|
204
|
+
let t13;
|
|
205
|
+
if ($[29] !== selectedFileType.properties) {
|
|
206
|
+
t13 = JSON.parse(selectedFileType?.properties);
|
|
207
|
+
$[29] = selectedFileType.properties;
|
|
208
|
+
$[30] = t13;
|
|
209
|
+
} else t13 = $[30];
|
|
210
|
+
t12 = t13;
|
|
211
|
+
break bb0;
|
|
212
|
+
}
|
|
213
|
+
t12 = void 0;
|
|
214
|
+
}
|
|
215
|
+
const formattedFileTypeProperties = t12;
|
|
216
|
+
let t13;
|
|
217
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
218
|
+
t13 = { marginBottom: 20 };
|
|
219
|
+
$[31] = t13;
|
|
220
|
+
} else t13 = $[31];
|
|
221
|
+
let t14;
|
|
222
|
+
if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
|
|
223
|
+
t14 = [
|
|
156
224
|
"File",
|
|
157
225
|
"Domain",
|
|
158
226
|
"Field Mappings",
|
|
159
227
|
"Review"
|
|
160
|
-
]
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
228
|
+
];
|
|
229
|
+
$[32] = t14;
|
|
230
|
+
} else t14 = $[32];
|
|
231
|
+
let t15;
|
|
232
|
+
if ($[33] !== activeStep) {
|
|
233
|
+
t15 = /* @__PURE__ */ React.createElement("div", { style: t13 }, /* @__PURE__ */ React.createElement(AmbientStepper, {
|
|
234
|
+
activeStep,
|
|
235
|
+
steps: t14,
|
|
236
|
+
orientation: "vertical"
|
|
237
|
+
}));
|
|
238
|
+
$[33] = activeStep;
|
|
239
|
+
$[34] = t15;
|
|
240
|
+
} else t15 = $[34];
|
|
241
|
+
let t16;
|
|
242
|
+
if ($[35] !== activeStep || $[36] !== allowedFileTypesData || $[37] !== fileItems || $[38] !== fileObject || $[39] !== formattedFileTypeProperties || $[40] !== handleUpdateFileProperties || $[41] !== selectedFileType) {
|
|
243
|
+
t16 = activeStep === 0 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UdpDropdown, {
|
|
244
|
+
name: "fileImportType",
|
|
245
|
+
label: "File Type",
|
|
246
|
+
onChange: (e_0) => setSelectedFileType(e_0.target.value),
|
|
247
|
+
options: allowedFileTypesData || [],
|
|
248
|
+
optionLabel: "name",
|
|
249
|
+
optionValue: "id",
|
|
250
|
+
value: selectedFileType,
|
|
251
|
+
required: true
|
|
252
|
+
}), selectedFileType && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 5 } }, /* @__PURE__ */ React.createElement(UdpFileInput, {
|
|
253
|
+
value: fileItems,
|
|
254
|
+
onChange: handleAddFileToUpload,
|
|
255
|
+
accept: ".csv,.txt,.xlsx,.json",
|
|
256
|
+
maxFiles: 1
|
|
257
|
+
})), /* @__PURE__ */ React.createElement(Form, {
|
|
258
|
+
id: "fileProperties",
|
|
259
|
+
onSubmit: handleUpdateFileProperties
|
|
260
|
+
}, formattedFileTypeProperties?.map(_temp0), /* @__PURE__ */ React.createElement(UdpButton, {
|
|
261
|
+
appearance: "secondary",
|
|
262
|
+
type: "submit",
|
|
263
|
+
form: "fileProperties",
|
|
264
|
+
disabled: !fileObject
|
|
265
|
+
}, "Next")));
|
|
266
|
+
$[35] = activeStep;
|
|
267
|
+
$[36] = allowedFileTypesData;
|
|
268
|
+
$[37] = fileItems;
|
|
269
|
+
$[38] = fileObject;
|
|
270
|
+
$[39] = formattedFileTypeProperties;
|
|
271
|
+
$[40] = handleUpdateFileProperties;
|
|
272
|
+
$[41] = selectedFileType;
|
|
273
|
+
$[42] = t16;
|
|
274
|
+
} else t16 = $[42];
|
|
275
|
+
let t17;
|
|
276
|
+
if ($[43] !== activeStep || $[44] !== filterCatalogObjectList || $[45] !== selectedDomain) {
|
|
277
|
+
t17 = activeStep === 1 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(UdpAutocomplete, {
|
|
278
|
+
name: "domain",
|
|
279
|
+
label: "Domain",
|
|
280
|
+
onChange: (e_1) => setSelectedDomain(e_1.target.value),
|
|
281
|
+
options: filterCatalogObjectList,
|
|
282
|
+
optionLabel: getNameFormattedOptionLabel,
|
|
283
|
+
optionValue: "id",
|
|
284
|
+
value: selectedDomain,
|
|
285
|
+
required: true
|
|
286
|
+
}), /* @__PURE__ */ React.createElement("div", { style: {
|
|
287
|
+
float: "right",
|
|
288
|
+
display: "flex",
|
|
289
|
+
gap: 8,
|
|
290
|
+
marginTop: 8
|
|
291
|
+
} }, /* @__PURE__ */ React.createElement(UdpButton, {
|
|
292
|
+
onClick: () => setActiveStep(_temp1),
|
|
293
|
+
disabled: activeStep === 0
|
|
294
|
+
}, "Prev"), /* @__PURE__ */ React.createElement(UdpButton, {
|
|
295
|
+
appearance: "secondary",
|
|
296
|
+
onClick: () => setActiveStep(_temp10),
|
|
297
|
+
disabled: !selectedDomain
|
|
298
|
+
}, "Next")));
|
|
299
|
+
$[43] = activeStep;
|
|
300
|
+
$[44] = filterCatalogObjectList;
|
|
301
|
+
$[45] = selectedDomain;
|
|
302
|
+
$[46] = t17;
|
|
303
|
+
} else t17 = $[46];
|
|
304
|
+
let t18;
|
|
305
|
+
if ($[47] !== activeStep || $[48] !== errorText || $[49] !== handleUpdateFieldMapping || $[50] !== importHeaderData || $[51] !== selectedDomain?.objectFieldInfo || $[52] !== showIndexNumbers) {
|
|
306
|
+
t18 = activeStep === 2 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { style: {
|
|
307
|
+
display: "flex",
|
|
308
|
+
flexDirection: "row",
|
|
309
|
+
justifyContent: "space-between",
|
|
310
|
+
paddingTop: 20
|
|
311
|
+
} }, /* @__PURE__ */ React.createElement(UdpText, { variant: "caption1Strong" }, showIndexNumbers ? "Column index's" : "File Headers"), /* @__PURE__ */ React.createElement(UdpText, { variant: "caption1Strong" }, "UDP Fields")), /* @__PURE__ */ React.createElement(UdpDivider, { style: { margin: "5px 0px" } }), /* @__PURE__ */ React.createElement(Form, {
|
|
312
|
+
id: "fieldMappings",
|
|
313
|
+
onSubmit: handleUpdateFieldMapping
|
|
314
|
+
}, importHeaderData?.map((field, index_0) => /* @__PURE__ */ React.createElement("div", { key: index_0 }, /* @__PURE__ */ React.createElement("div", { style: {
|
|
315
|
+
display: "flex",
|
|
316
|
+
flexDirection: "row",
|
|
317
|
+
alignItems: "center",
|
|
318
|
+
gap: 10
|
|
319
|
+
} }, /* @__PURE__ */ React.createElement(UdpText, { style: { width: "40%" } }, showIndexNumbers ? "index " + index_0 : field), /* @__PURE__ */ React.createElement(UdpIcon, {
|
|
320
|
+
style: { width: "10%" },
|
|
321
|
+
name: "arrow-right"
|
|
322
|
+
}), /* @__PURE__ */ React.createElement("div", { style: { flex: 2 } }, /* @__PURE__ */ React.createElement(Field, {
|
|
323
|
+
component: UdpDropdown,
|
|
324
|
+
multiple: false,
|
|
325
|
+
name: `udpFieldMapping${index_0}`,
|
|
326
|
+
options: selectedDomain?.objectFieldInfo,
|
|
327
|
+
optionLabel: getUdpFieldOptionLabel,
|
|
328
|
+
optionValue: "businessObjectKey",
|
|
329
|
+
includeErrorPadding: false,
|
|
330
|
+
clearable: true
|
|
331
|
+
}))), /* @__PURE__ */ React.createElement(UdpDivider, { style: { margin: "5px 0px" } }))), /* @__PURE__ */ React.createElement("div", { style: {
|
|
332
|
+
paddingTop: 20,
|
|
333
|
+
textAlign: "right",
|
|
334
|
+
color: "red"
|
|
335
|
+
} }, errorText), /* @__PURE__ */ React.createElement("div", { style: {
|
|
336
|
+
display: "flex",
|
|
337
|
+
justifyContent: "flex-start",
|
|
338
|
+
gap: 8,
|
|
339
|
+
paddingTop: 16
|
|
340
|
+
} }, /* @__PURE__ */ React.createElement(UdpButton, {
|
|
341
|
+
onClick: () => setActiveStep(_temp11),
|
|
342
|
+
disabled: activeStep === 0
|
|
343
|
+
}, "Prev"), /* @__PURE__ */ React.createElement(UdpButton, {
|
|
344
|
+
appearance: "secondary",
|
|
345
|
+
type: "submit",
|
|
346
|
+
form: "fieldMappings"
|
|
347
|
+
}, "Next"))));
|
|
348
|
+
$[47] = activeStep;
|
|
349
|
+
$[48] = errorText;
|
|
350
|
+
$[49] = handleUpdateFieldMapping;
|
|
351
|
+
$[50] = importHeaderData;
|
|
352
|
+
$[51] = selectedDomain?.objectFieldInfo;
|
|
353
|
+
$[52] = showIndexNumbers;
|
|
354
|
+
$[53] = t18;
|
|
355
|
+
} else t18 = $[53];
|
|
356
|
+
let t19;
|
|
357
|
+
if ($[54] !== activeStep || $[55] !== handleCreateNewFieldMapping) {
|
|
358
|
+
t19 = activeStep === 3 && /* @__PURE__ */ React.createElement(Form, {
|
|
359
|
+
id: "createMapping",
|
|
360
|
+
onSubmit: handleCreateNewFieldMapping
|
|
361
|
+
}, /* @__PURE__ */ React.createElement(Field, {
|
|
362
|
+
component: UdpTextInput,
|
|
363
|
+
name: "name",
|
|
364
|
+
label: "Mapping Name"
|
|
365
|
+
}), /* @__PURE__ */ React.createElement("div", { style: {
|
|
366
|
+
display: "flex",
|
|
367
|
+
justifyContent: "flex-start",
|
|
368
|
+
gap: 8,
|
|
369
|
+
paddingTop: 16
|
|
370
|
+
} }, /* @__PURE__ */ React.createElement(UdpButton, {
|
|
371
|
+
onClick: () => setActiveStep(_temp12),
|
|
372
|
+
disabled: activeStep === 0
|
|
373
|
+
}, "Prev"), /* @__PURE__ */ React.createElement(UdpButton, {
|
|
374
|
+
appearance: "primary",
|
|
375
|
+
type: "submit",
|
|
376
|
+
form: "createMapping"
|
|
377
|
+
}, "Create Mapping")));
|
|
378
|
+
$[54] = activeStep;
|
|
379
|
+
$[55] = handleCreateNewFieldMapping;
|
|
380
|
+
$[56] = t19;
|
|
381
|
+
} else t19 = $[56];
|
|
382
|
+
let t20;
|
|
383
|
+
if ($[57] !== t15 || $[58] !== t16 || $[59] !== t17 || $[60] !== t18 || $[61] !== t19) {
|
|
384
|
+
t20 = /* @__PURE__ */ React.createElement(UdpCard, { width: "100%" }, t15, t16, t17, t18, t19);
|
|
385
|
+
$[57] = t15;
|
|
386
|
+
$[58] = t16;
|
|
387
|
+
$[59] = t17;
|
|
388
|
+
$[60] = t18;
|
|
389
|
+
$[61] = t19;
|
|
390
|
+
$[62] = t20;
|
|
391
|
+
} else t20 = $[62];
|
|
392
|
+
let t21;
|
|
393
|
+
if ($[63] !== fileImportMappingObject?.mapping || $[64] !== fileImportMappingObject?.properties || $[65] !== selectedDomain?.name) {
|
|
394
|
+
t21 = fileImportMappingObject?.mapping && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 10 } }, /* @__PURE__ */ React.createElement(FileImportConfigCard, {
|
|
395
|
+
fileMappingRecord: {
|
|
396
|
+
mapping: fileImportMappingObject?.mapping,
|
|
397
|
+
properties: fileImportMappingObject?.properties
|
|
398
|
+
},
|
|
399
|
+
domain: selectedDomain?.name.replace(/([A-Z])/g, " $1").trim()
|
|
400
|
+
}));
|
|
401
|
+
$[63] = fileImportMappingObject?.mapping;
|
|
402
|
+
$[64] = fileImportMappingObject?.properties;
|
|
403
|
+
$[65] = selectedDomain?.name;
|
|
404
|
+
$[66] = t21;
|
|
405
|
+
} else t21 = $[66];
|
|
406
|
+
let t22;
|
|
407
|
+
if ($[67] !== t20 || $[68] !== t21) {
|
|
408
|
+
t22 = /* @__PURE__ */ React.createElement(React.Fragment, null, t20, t21);
|
|
409
|
+
$[67] = t20;
|
|
410
|
+
$[68] = t21;
|
|
411
|
+
$[69] = t22;
|
|
412
|
+
} else t22 = $[69];
|
|
413
|
+
return t22;
|
|
414
|
+
};
|
|
415
|
+
async function _temp(data) {
|
|
416
|
+
return apiMutate(ConfigService.productV1ApiUrl, "UdpFileImportMapping", { method: "post" }, { data });
|
|
417
|
+
}
|
|
418
|
+
function _temp2(option) {
|
|
419
|
+
return option?.name.replace(/([A-Z])/g, " $1").trim();
|
|
420
|
+
}
|
|
421
|
+
function _temp3(t0) {
|
|
422
|
+
const [, value] = t0;
|
|
423
|
+
return value !== null;
|
|
424
|
+
}
|
|
425
|
+
function _temp4(acc, t0) {
|
|
426
|
+
const [key_0, value_0] = t0;
|
|
427
|
+
acc[key_0] = value_0;
|
|
428
|
+
return acc;
|
|
429
|
+
}
|
|
430
|
+
function _temp5(key_1) {
|
|
431
|
+
return parseInt(key_1.split("udpFieldMapping")[1], 10);
|
|
432
|
+
}
|
|
433
|
+
function _temp6(prev_0) {
|
|
434
|
+
return prev_0 + 1;
|
|
435
|
+
}
|
|
436
|
+
function _temp7(prev_2) {
|
|
437
|
+
return prev_2 + 1;
|
|
438
|
+
}
|
|
439
|
+
function _temp8(option_2) {
|
|
440
|
+
if (!option_2.dataType.endsWith("?") && !option_2.isPrimaryKey && !option_2.udpType) return `${option_2.name.replace(/([A-Z])/g, " $1").trim()}*`;
|
|
441
|
+
return `${option_2.name} - ${option_2.dataType}`;
|
|
442
|
+
}
|
|
443
|
+
function _temp9(item) {
|
|
444
|
+
return item.kind === "pending";
|
|
445
|
+
}
|
|
446
|
+
function _temp0(property) {
|
|
447
|
+
return property?.options ? /* @__PURE__ */ React.createElement(Field, {
|
|
448
|
+
key: property.propertyName,
|
|
449
|
+
component: UdpDropdown,
|
|
450
|
+
multiple: false,
|
|
185
451
|
name: property.propertyName,
|
|
186
452
|
label: property.label,
|
|
187
453
|
options: property.options,
|
|
188
|
-
|
|
189
|
-
|
|
454
|
+
optionLabel: "name",
|
|
455
|
+
optionValue: "value",
|
|
190
456
|
required: property?.required
|
|
191
457
|
}) : /* @__PURE__ */ React.createElement(Field, {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
id: property.propertyName,
|
|
458
|
+
key: property.propertyName,
|
|
459
|
+
component: UdpTextInput,
|
|
195
460
|
name: property.propertyName,
|
|
196
461
|
label: property.label,
|
|
197
|
-
size: "small",
|
|
198
|
-
getOptionLabelFunction: getNameOptionLabel,
|
|
199
462
|
required: property?.required
|
|
200
|
-
})
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
onChange: (val_0) => setSelectedDomain(val_0),
|
|
215
|
-
options: filterCatalogObjectList,
|
|
216
|
-
size: "small",
|
|
217
|
-
getOptionLabelFunction: getNameFormattedOptionLabel,
|
|
218
|
-
value: selectedDomain,
|
|
219
|
-
required: true
|
|
220
|
-
}), /* @__PURE__ */ React.createElement("div", { style: {
|
|
221
|
-
float: "right",
|
|
222
|
-
display: "flex",
|
|
223
|
-
gap: 8,
|
|
224
|
-
marginTop: 8
|
|
225
|
-
} }, /* @__PURE__ */ React.createElement(FluentButton, {
|
|
226
|
-
variant: "contained",
|
|
227
|
-
onClick: () => setActiveStep((prev_3) => prev_3 - 1),
|
|
228
|
-
disabled: activeStep === 0
|
|
229
|
-
}, "Prev"), /* @__PURE__ */ React.createElement(FluentButton, {
|
|
230
|
-
variant: "contained",
|
|
231
|
-
onClick: () => setActiveStep((prev_4) => prev_4 + 1),
|
|
232
|
-
color: "secondary",
|
|
233
|
-
disabled: !selectedDomain
|
|
234
|
-
}, "Next"))), activeStep === 2 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("div", { style: {
|
|
235
|
-
display: "flex",
|
|
236
|
-
flexDirection: "row",
|
|
237
|
-
justifyContent: "space-between",
|
|
238
|
-
paddingTop: 20
|
|
239
|
-
} }, /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, showIndexNumbers ? "Column index's" : "File Headers"), /* @__PURE__ */ React.createElement(Typography, { variant: "caption" }, "UDP Fields")), /* @__PURE__ */ React.createElement(Divider$1, { style: { margin: "5px 0px" } }), /* @__PURE__ */ React.createElement(Form, {
|
|
240
|
-
onSubmit: handleUpdateFieldMapping,
|
|
241
|
-
style: { marginTop: -20 }
|
|
242
|
-
}, importHeaderData?.map((field, index_0) => /* @__PURE__ */ React.createElement("div", { style: { height: 42 } }, /* @__PURE__ */ React.createElement("div", { style: {
|
|
243
|
-
display: "flex",
|
|
244
|
-
flexDirection: "row",
|
|
245
|
-
gap: 10
|
|
246
|
-
} }, /* @__PURE__ */ React.createElement(Typography, { style: {
|
|
247
|
-
marginTop: 25,
|
|
248
|
-
width: "50%"
|
|
249
|
-
} }, showIndexNumbers ? "index " + index_0 : field), /* @__PURE__ */ React.createElement(FluentIcon, {
|
|
250
|
-
style: {
|
|
251
|
-
marginTop: 28,
|
|
252
|
-
width: "10%"
|
|
253
|
-
},
|
|
254
|
-
component: ChromeBackMirroredIcon
|
|
255
|
-
}), /* @__PURE__ */ React.createElement(Field, {
|
|
256
|
-
style: { height: 30 },
|
|
257
|
-
component: AmbientAutoComplete,
|
|
258
|
-
isMultiple: false,
|
|
259
|
-
id: `udpFieldMapping${index_0}`,
|
|
260
|
-
name: `udpFieldMapping${index_0}`,
|
|
261
|
-
options: selectedDomain?.objectFieldInfo,
|
|
262
|
-
size: "small",
|
|
263
|
-
getOptionLabelFunction: getUdpFieldOptionLabel
|
|
264
|
-
})), /* @__PURE__ */ React.createElement(Divider$1, { style: { margin: "5px 0px" } }))), /* @__PURE__ */ React.createElement("div", { style: {
|
|
265
|
-
paddingTop: 20,
|
|
266
|
-
textAlign: "right",
|
|
267
|
-
color: "red"
|
|
268
|
-
} }, errorText), /* @__PURE__ */ React.createElement(FormButtons, { style: {
|
|
269
|
-
display: "flex",
|
|
270
|
-
float: "right",
|
|
271
|
-
paddingTop: 16,
|
|
272
|
-
marginRight: -16
|
|
273
|
-
} }, /* @__PURE__ */ React.createElement(FluentButton, {
|
|
274
|
-
variant: "contained",
|
|
275
|
-
onClick: () => setActiveStep((prev_5) => prev_5 - 1),
|
|
276
|
-
disabled: activeStep === 0
|
|
277
|
-
}, "Prev"), /* @__PURE__ */ React.createElement(SubmitButton, {
|
|
278
|
-
variant: "contained",
|
|
279
|
-
color: "secondary",
|
|
280
|
-
disablePristine: false
|
|
281
|
-
}, "Next")))), activeStep === 3 && /* @__PURE__ */ React.createElement(Form, { onSubmit: handleCreateNewFieldMapping }, /* @__PURE__ */ React.createElement(Field, {
|
|
282
|
-
component: AmbientTextField,
|
|
283
|
-
id: `name`,
|
|
284
|
-
name: `name`,
|
|
285
|
-
label: "Mapping Name",
|
|
286
|
-
size: "small"
|
|
287
|
-
}), /* @__PURE__ */ React.createElement(FormButtons, { style: {
|
|
288
|
-
display: "flex",
|
|
289
|
-
float: "right",
|
|
290
|
-
marginRight: -16
|
|
291
|
-
} }, /* @__PURE__ */ React.createElement(FluentButton, {
|
|
292
|
-
variant: "contained",
|
|
293
|
-
onClick: () => setActiveStep((prev_6) => prev_6 - 1),
|
|
294
|
-
disabled: activeStep === 0
|
|
295
|
-
}, "Prev"), /* @__PURE__ */ React.createElement(SubmitButton, {
|
|
296
|
-
variant: "contained",
|
|
297
|
-
color: "secondary",
|
|
298
|
-
disablePristine: false
|
|
299
|
-
}, "Create Mapping")))), fileImportMappingObject?.mapping && /* @__PURE__ */ React.createElement("div", { style: { marginTop: 10 } }, /* @__PURE__ */ React.createElement(FileImportConfigCard, {
|
|
300
|
-
fileMappingRecord: {
|
|
301
|
-
mapping: fileImportMappingObject?.mapping,
|
|
302
|
-
properties: fileImportMappingObject?.properties
|
|
303
|
-
},
|
|
304
|
-
domain: selectedDomain?.name.replace(/([A-Z])/g, " $1").trim()
|
|
305
|
-
})));
|
|
306
|
-
};
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
function _temp1(prev_3) {
|
|
466
|
+
return prev_3 - 1;
|
|
467
|
+
}
|
|
468
|
+
function _temp10(prev_4) {
|
|
469
|
+
return prev_4 + 1;
|
|
470
|
+
}
|
|
471
|
+
function _temp11(prev_5) {
|
|
472
|
+
return prev_5 - 1;
|
|
473
|
+
}
|
|
474
|
+
function _temp12(prev_6) {
|
|
475
|
+
return prev_6 - 1;
|
|
476
|
+
}
|
|
307
477
|
//#endregion
|
|
308
478
|
export { FileImportMappingWizard as default };
|
|
309
479
|
|