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