@commercetools-frontend-extensions/import-resources-modal 1.3.14 → 1.3.16
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/{active-drag-drop-area-41ed9b4e.cjs.prod.js → active-drag-drop-area-1990c888.cjs.prod.js} +2 -2
- package/dist/{active-drag-drop-area-0d158ff3.esm.js → active-drag-drop-area-245e26d9.esm.js} +2 -2
- package/dist/{active-drag-drop-area-342ec29f.cjs.dev.js → active-drag-drop-area-a07d4eb3.cjs.dev.js} +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +2 -2
- package/dist/declarations/src/@types/file-upload.d.ts +9 -1
- package/dist/{enabled-drop-area-9db1db62.esm.js → enabled-drop-area-118cf588.esm.js} +2 -2
- package/dist/{enabled-drop-area-481fc8cb.cjs.dev.js → enabled-drop-area-11c61ee2.cjs.dev.js} +2 -2
- package/dist/{enabled-drop-area-be322b30.cjs.prod.js → enabled-drop-area-2c8702cd.cjs.prod.js} +2 -2
- package/dist/{es-934f3c93.cjs.prod.js → es-08b25677.cjs.dev.js} +1 -1
- package/dist/{es-40cea2f4.cjs.dev.js → es-231d6889.cjs.prod.js} +1 -1
- package/dist/{es-b38875bc.esm.js → es-4cfa2244.esm.js} +1 -1
- package/dist/{file-dropped-area-6ae3952f.cjs.prod.js → file-dropped-area-19c71ab9.cjs.prod.js} +2 -2
- package/dist/{file-dropped-area-61f35952.cjs.dev.js → file-dropped-area-59803011.cjs.dev.js} +2 -2
- package/dist/{file-dropped-area-04b18c45.esm.js → file-dropped-area-ef80a054.esm.js} +2 -2
- package/dist/{index-ec8576ff.cjs.prod.js → index-50af68b8.cjs.prod.js} +78 -44
- package/dist/{index-6d3efd4e.esm.js → index-a799ed10.esm.js} +77 -43
- package/dist/{index-ec4f6311.cjs.dev.js → index-aa4cebbf.cjs.dev.js} +78 -44
- package/package.json +1 -1
|
@@ -31,6 +31,7 @@ import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instanc
|
|
|
31
31
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
32
32
|
import Papa from 'papaparse';
|
|
33
33
|
import _reduceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/reduce';
|
|
34
|
+
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
34
35
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
35
36
|
import '@babel/runtime-corejs3/core-js-stable/instance/starts-with';
|
|
36
37
|
import '@babel/runtime-corejs3/core-js-stable/url-search-params';
|
|
@@ -45,7 +46,6 @@ import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
|
45
46
|
import _styled from '@emotion/styled/base';
|
|
46
47
|
import { css } from '@emotion/react';
|
|
47
48
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
48
|
-
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
49
49
|
import DataTable from '@commercetools-uikit/data-table';
|
|
50
50
|
import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
|
|
51
51
|
|
|
@@ -68,7 +68,7 @@ function reducer(state, action) {
|
|
|
68
68
|
if (action.type === 'cancelImport') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
69
69
|
currentStep: 1,
|
|
70
70
|
containerKey: undefined,
|
|
71
|
-
|
|
71
|
+
fileUploadErrors: [],
|
|
72
72
|
uploadFileResponse: undefined,
|
|
73
73
|
droppedFile: undefined,
|
|
74
74
|
dropAreaState: 'disabled',
|
|
@@ -77,7 +77,7 @@ function reducer(state, action) {
|
|
|
77
77
|
if (action.type === 'uploadNewFile') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
78
78
|
currentStep: 1,
|
|
79
79
|
containerKey: undefined,
|
|
80
|
-
|
|
80
|
+
fileUploadErrors: [],
|
|
81
81
|
uploadFileResponse: undefined,
|
|
82
82
|
droppedFile: undefined,
|
|
83
83
|
dropAreaState: 'ready-for-drop',
|
|
@@ -88,9 +88,9 @@ function reducer(state, action) {
|
|
|
88
88
|
droppedFile: action.droppedFile
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
if (action.type === '
|
|
91
|
+
if (action.type === 'setFileUploadErrors') {
|
|
92
92
|
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
93
|
-
|
|
93
|
+
fileUploadErrors: action.fileUploadErrors
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
if (action.type === 'setAbortController') {
|
|
@@ -113,7 +113,7 @@ const initialState = {
|
|
|
113
113
|
abortController: new AbortController(),
|
|
114
114
|
dropAreaState: 'disabled',
|
|
115
115
|
uploadFileResponse: undefined,
|
|
116
|
-
|
|
116
|
+
fileUploadErrors: [],
|
|
117
117
|
resourceType: 'category',
|
|
118
118
|
containerKey: undefined,
|
|
119
119
|
progress: 0
|
|
@@ -335,9 +335,9 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
335
335
|
}));
|
|
336
336
|
});
|
|
337
337
|
};
|
|
338
|
-
const
|
|
338
|
+
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
339
339
|
let idCounter = 1;
|
|
340
|
-
return _mapInstanceProperty(
|
|
340
|
+
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$e(_objectSpread$e({}, uploadFileError), {}, {
|
|
341
341
|
id: String(idCounter++)
|
|
342
342
|
}));
|
|
343
343
|
};
|
|
@@ -386,6 +386,23 @@ function convertFileSizeToKB(sizeInBytes) {
|
|
|
386
386
|
function isAbortError(error) {
|
|
387
387
|
return error instanceof DOMException && error.name === 'AbortError';
|
|
388
388
|
}
|
|
389
|
+
function formatKeys(obj) {
|
|
390
|
+
var _context;
|
|
391
|
+
if (typeof obj !== 'object' || obj === null) return '';
|
|
392
|
+
const keys = _mapInstanceProperty(_context = _Object$keys(obj)).call(_context, key => key.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase());
|
|
393
|
+
if (keys.length === 0) return '';
|
|
394
|
+
if (keys.length === 1) return keys[0];
|
|
395
|
+
return `${_sliceInstanceProperty(keys).call(keys, 0, -1).join(', ')} and ${keys[keys.length - 1]}`;
|
|
396
|
+
}
|
|
397
|
+
function formatErrorCode(code) {
|
|
398
|
+
try {
|
|
399
|
+
const formattedCode = code.replace(/([a-z])([A-Z])/g, '$1 $2').replace(/([A-Z])([A-Z][a-z])/g, '$1 $2').toLowerCase();
|
|
400
|
+
let result = formattedCode.charAt(0).toUpperCase() + _sliceInstanceProperty(formattedCode).call(formattedCode, 1);
|
|
401
|
+
return result;
|
|
402
|
+
} catch (error) {
|
|
403
|
+
return code;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
389
406
|
|
|
390
407
|
const encodeFileNameWithTimestampToContainerKey = fileName => {
|
|
391
408
|
return btoa(_JSON$stringify({
|
|
@@ -559,9 +576,9 @@ const ImportResourcesProvider = props => {
|
|
|
559
576
|
type: 'setAbortController',
|
|
560
577
|
abortController: abortController
|
|
561
578
|
});
|
|
562
|
-
const
|
|
563
|
-
type: '
|
|
564
|
-
|
|
579
|
+
const setFileUploadErrors = fileUploadErrors => dispatch({
|
|
580
|
+
type: 'setFileUploadErrors',
|
|
581
|
+
fileUploadErrors: fileUploadErrors
|
|
565
582
|
});
|
|
566
583
|
const setProgress = progress => dispatch({
|
|
567
584
|
type: 'setProgress',
|
|
@@ -593,7 +610,7 @@ const ImportResourcesProvider = props => {
|
|
|
593
610
|
setDroppedFile,
|
|
594
611
|
setContainerKey,
|
|
595
612
|
setAbortController,
|
|
596
|
-
|
|
613
|
+
setFileUploadErrors,
|
|
597
614
|
setProgress
|
|
598
615
|
}
|
|
599
616
|
},
|
|
@@ -656,13 +673,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
656
673
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5kaXNhYmxlZFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
657
674
|
}
|
|
658
675
|
|
|
659
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
676
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-245e26d9.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
|
|
660
677
|
|
|
661
678
|
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-2c088477.esm.js' /* webpackChunkName: "disabled-drop-area" */));
|
|
662
679
|
|
|
663
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
680
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-118cf588.esm.js' /* webpackChunkName: "enabled-drop-area" */));
|
|
664
681
|
|
|
665
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
682
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-ef80a054.esm.js' /* webpackChunkName: "filed-dropped-area" */));
|
|
666
683
|
|
|
667
684
|
function getDropArea(_ref) {
|
|
668
685
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -791,7 +808,7 @@ var messages$5 = defineMessages({
|
|
|
791
808
|
dropAreaWrongDelimiterDescription: {
|
|
792
809
|
id: 'ImportResourcesModal.wrongDelimiterDescription',
|
|
793
810
|
description: 'Message within the drop area when a CSV file uses an unexpected delimiter',
|
|
794
|
-
defaultMessage: 'The file is using
|
|
811
|
+
defaultMessage: 'The file is using an incorrect delimiter. Please use comma (,) instead.'
|
|
795
812
|
},
|
|
796
813
|
dropAreaNotEnoughRowsTitle: {
|
|
797
814
|
id: 'ImportResourcesModal.dropAreaNotEnoughRowsTitle',
|
|
@@ -808,10 +825,20 @@ var messages$5 = defineMessages({
|
|
|
808
825
|
description: 'Generic notification message when file upload fails',
|
|
809
826
|
defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
|
|
810
827
|
},
|
|
828
|
+
missingRequiredField: {
|
|
829
|
+
id: 'ImportResourcesModal.missingRequiredField',
|
|
830
|
+
description: 'Error message displayed when a required field is missing',
|
|
831
|
+
defaultMessage: 'Missing required field'
|
|
832
|
+
},
|
|
811
833
|
missingKeyError: {
|
|
812
834
|
id: 'ImportResourcesModal.missingKeyError',
|
|
813
835
|
description: 'Error message displayed when the uploaded file is missing the key field',
|
|
814
836
|
defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
|
|
837
|
+
},
|
|
838
|
+
missingRequiredKeys: {
|
|
839
|
+
id: 'ImportResourcesModal.missingRequiredKeys',
|
|
840
|
+
description: 'Error message displayed when the uploaded file is missing required keys',
|
|
841
|
+
defaultMessage: 'Make sure the file contains required keys for the elements including {fieldNames}'
|
|
815
842
|
}
|
|
816
843
|
});
|
|
817
844
|
|
|
@@ -833,9 +860,7 @@ const useUpload = () => {
|
|
|
833
860
|
const delimiterCheck = await checkDelimiter(file);
|
|
834
861
|
if (!delimiterCheck.isValid) errors.push({
|
|
835
862
|
title: intl.formatMessage(messages$5.dropAreaWrongDelimiterTitle),
|
|
836
|
-
description: intl.formatMessage(messages$5.dropAreaWrongDelimiterDescription
|
|
837
|
-
delimiter: delimiterCheck.delimiter
|
|
838
|
-
})
|
|
863
|
+
description: intl.formatMessage(messages$5.dropAreaWrongDelimiterDescription)
|
|
839
864
|
});
|
|
840
865
|
const rowCount = await getRowCount(file);
|
|
841
866
|
if (rowCount < 1) errors.push({
|
|
@@ -855,7 +880,7 @@ const useUpload = () => {
|
|
|
855
880
|
})
|
|
856
881
|
});
|
|
857
882
|
if (errors.length > 0) {
|
|
858
|
-
actions.
|
|
883
|
+
actions.setFileUploadErrors(errors);
|
|
859
884
|
actions.setCurrentStep(3);
|
|
860
885
|
return false;
|
|
861
886
|
}
|
|
@@ -868,12 +893,21 @@ const useUpload = () => {
|
|
|
868
893
|
}
|
|
869
894
|
if (error instanceof HttpError) {
|
|
870
895
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
871
|
-
actions.
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
896
|
+
actions.setFileUploadErrors([{
|
|
897
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
898
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
899
|
+
}]);
|
|
900
|
+
actions.setCurrentStep(3);
|
|
901
|
+
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
902
|
+
const MissingCsvFieldIdentifierError = error.errorData;
|
|
903
|
+
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
904
|
+
actions.setFileUploadErrors([{
|
|
905
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
906
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
907
|
+
fieldNames
|
|
908
|
+
})
|
|
909
|
+
}]);
|
|
910
|
+
actions.setCurrentStep(3);
|
|
877
911
|
} else if (error.errorData?.invalid > 0) {
|
|
878
912
|
actions.setUploadFileResponse(error.errorData);
|
|
879
913
|
actions.setCurrentStep(3);
|
|
@@ -1139,10 +1173,10 @@ var messages$4 = defineMessages({
|
|
|
1139
1173
|
description: 'In Upload file error modal - "Details" column',
|
|
1140
1174
|
defaultMessage: 'Details'
|
|
1141
1175
|
},
|
|
1142
|
-
|
|
1143
|
-
id: 'ImportResourcesModal.
|
|
1176
|
+
uploadErrorDescription: {
|
|
1177
|
+
id: 'ImportResourcesModal.uploadErrorDescription',
|
|
1144
1178
|
description: 'Title when errors detected while uploading file',
|
|
1145
|
-
defaultMessage: 'There are <b>{errorsCount}</b> errors detected while uploading the file <b>{fileName}</b>.'
|
|
1179
|
+
defaultMessage: 'There {errorsCount, plural, one {is <b>{errorsCount}</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file <b>{fileName}</b>.'
|
|
1146
1180
|
},
|
|
1147
1181
|
supportedValuesDocumentation: {
|
|
1148
1182
|
id: 'ImportResourcesModal.supportedValuesDocumentation',
|
|
@@ -1166,7 +1200,7 @@ const getColumns$1 = () => [{
|
|
|
1166
1200
|
key: 'details',
|
|
1167
1201
|
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1168
1202
|
}];
|
|
1169
|
-
const
|
|
1203
|
+
const UploadErrorTable = props => {
|
|
1170
1204
|
var _context;
|
|
1171
1205
|
const pagination = usePaginationState({
|
|
1172
1206
|
perPage: 10
|
|
@@ -1209,13 +1243,13 @@ function itemRenderer$1(item, column) {
|
|
|
1209
1243
|
|
|
1210
1244
|
function ownKeys$9(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1211
1245
|
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1212
|
-
const
|
|
1246
|
+
const UploadErrorsModal = () => {
|
|
1213
1247
|
const intl = useIntl();
|
|
1214
1248
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1215
1249
|
state = _useImportResourcesCo.state,
|
|
1216
1250
|
actions = _useImportResourcesCo.actions,
|
|
1217
1251
|
onClose = _useImportResourcesCo.onClose;
|
|
1218
|
-
const errorsCount = state.
|
|
1252
|
+
const errorsCount = state.fileUploadErrors.length;
|
|
1219
1253
|
return jsx(InfoDialog, {
|
|
1220
1254
|
size: 16,
|
|
1221
1255
|
isOpen: true,
|
|
@@ -1226,7 +1260,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1226
1260
|
scale: "l",
|
|
1227
1261
|
children: [jsx(Masking.Mask, {
|
|
1228
1262
|
children: jsx(Text.Body, {
|
|
1229
|
-
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.
|
|
1263
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadErrorDescription), {}, {
|
|
1230
1264
|
values: {
|
|
1231
1265
|
fileName: state.droppedFile?.name,
|
|
1232
1266
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1234,8 +1268,8 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1234
1268
|
}
|
|
1235
1269
|
})
|
|
1236
1270
|
})
|
|
1237
|
-
}), jsx(
|
|
1238
|
-
rows:
|
|
1271
|
+
}), jsx(UploadErrorTable, {
|
|
1272
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1239
1273
|
}), jsxs(Spacings.Inline, {
|
|
1240
1274
|
scale: "m",
|
|
1241
1275
|
justifyContent: "flex-end",
|
|
@@ -1274,7 +1308,7 @@ const getColumns = () => [{
|
|
|
1274
1308
|
key: 'details',
|
|
1275
1309
|
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1276
1310
|
}];
|
|
1277
|
-
const
|
|
1311
|
+
const UploadRowErrorTable = props => {
|
|
1278
1312
|
var _context;
|
|
1279
1313
|
const pagination = usePaginationState({
|
|
1280
1314
|
perPage: 10
|
|
@@ -1305,7 +1339,7 @@ function itemRenderer(item, column) {
|
|
|
1305
1339
|
case 'errorType':
|
|
1306
1340
|
return jsx(Stamp, {
|
|
1307
1341
|
isCondensed: true,
|
|
1308
|
-
label: item.code,
|
|
1342
|
+
label: formatErrorCode(item.code),
|
|
1309
1343
|
tone: "critical"
|
|
1310
1344
|
});
|
|
1311
1345
|
case 'details':
|
|
@@ -1325,7 +1359,7 @@ function itemRenderer(item, column) {
|
|
|
1325
1359
|
|
|
1326
1360
|
function ownKeys$7(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1327
1361
|
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1328
|
-
const
|
|
1362
|
+
const UploadRowErrorsModal = () => {
|
|
1329
1363
|
const intl = useIntl();
|
|
1330
1364
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1331
1365
|
state = _useImportResourcesCo.state,
|
|
@@ -1345,7 +1379,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1345
1379
|
scale: "xs",
|
|
1346
1380
|
children: [jsx(Masking.Mask, {
|
|
1347
1381
|
children: jsx(Text.Body, {
|
|
1348
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.
|
|
1382
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadErrorDescription), {}, {
|
|
1349
1383
|
values: {
|
|
1350
1384
|
fileName: state.droppedFile?.name,
|
|
1351
1385
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1365,7 +1399,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1365
1399
|
}
|
|
1366
1400
|
})
|
|
1367
1401
|
})]
|
|
1368
|
-
}), jsx(
|
|
1402
|
+
}), jsx(UploadRowErrorTable, {
|
|
1369
1403
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1370
1404
|
}), jsxs(Spacings.Inline, {
|
|
1371
1405
|
scale: "m",
|
|
@@ -1773,8 +1807,8 @@ function getBold(msg) {
|
|
|
1773
1807
|
const UploadResult = () => {
|
|
1774
1808
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1775
1809
|
state = _useImportResourcesCo.state;
|
|
1776
|
-
if (state.
|
|
1777
|
-
if (state.uploadFileResponse?.invalid > 0) return jsx(
|
|
1810
|
+
if (state.fileUploadErrors.length > 0) return jsx(UploadErrorsModal, {});
|
|
1811
|
+
if (state.uploadFileResponse?.invalid > 0) return jsx(UploadRowErrorsModal, {});
|
|
1778
1812
|
return jsx(UploadPreviewModal, {});
|
|
1779
1813
|
};
|
|
1780
1814
|
|
|
@@ -2017,7 +2051,7 @@ const getChunkImport = locale => {
|
|
|
2017
2051
|
case 'de':
|
|
2018
2052
|
return import(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-cd6c45d3.esm.js');
|
|
2019
2053
|
case 'es':
|
|
2020
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2054
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-4cfa2244.esm.js');
|
|
2021
2055
|
case 'fr-FR':
|
|
2022
2056
|
return import(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-9d9081ee.esm.js');
|
|
2023
2057
|
case 'zh-CN':
|