@commercetools-frontend-extensions/import-resources-modal 1.3.13 → 1.3.14
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-67588c22.esm.js → active-drag-drop-area-0d158ff3.esm.js} +1 -1
- package/dist/{active-drag-drop-area-2105994c.cjs.dev.js → active-drag-drop-area-342ec29f.cjs.dev.js} +1 -1
- package/dist/{active-drag-drop-area-11f2cde9.cjs.prod.js → active-drag-drop-area-41ed9b4e.cjs.prod.js} +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +1 -1
- package/dist/{enabled-drop-area-fbda1cbb.cjs.dev.js → enabled-drop-area-481fc8cb.cjs.dev.js} +1 -1
- package/dist/{enabled-drop-area-93f8c01f.esm.js → enabled-drop-area-9db1db62.esm.js} +1 -1
- package/dist/{enabled-drop-area-f36e516f.cjs.prod.js → enabled-drop-area-be322b30.cjs.prod.js} +1 -1
- package/dist/{es-d3119d27.cjs.prod.js → es-40cea2f4.cjs.dev.js} +8 -0
- package/dist/{es-57633f1e.cjs.dev.js → es-934f3c93.cjs.prod.js} +8 -0
- package/dist/{es-7843d8d8.esm.js → es-b38875bc.esm.js} +8 -0
- package/dist/{file-dropped-area-39ef5224.esm.js → file-dropped-area-04b18c45.esm.js} +1 -1
- package/dist/{file-dropped-area-9468bb2e.cjs.dev.js → file-dropped-area-61f35952.cjs.dev.js} +1 -1
- package/dist/{file-dropped-area-73e015f2.cjs.prod.js → file-dropped-area-6ae3952f.cjs.prod.js} +1 -1
- package/dist/{index-9b9b2650.esm.js → index-6d3efd4e.esm.js} +149 -102
- package/dist/{index-decbade4.cjs.dev.js → index-ec4f6311.cjs.dev.js} +148 -101
- package/dist/{index-07a3b260.cjs.prod.js → index-ec8576ff.cjs.prod.js} +148 -101
- package/package.json +6 -6
|
@@ -38,7 +38,7 @@ import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
|
38
38
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
39
39
|
import { FormDialog, InfoDialog, PageContentNarrow, ConfirmationDialog } from '@commercetools-frontend/application-components';
|
|
40
40
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
41
|
-
import { customProperties, Constraints, Spacings, Grid, designTokens, Text, usePaginationState, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, Link, Card, CheckBoldIcon, EyeCrossedIcon, ProgressBar, RadioInput } from '@commercetools-frontend/ui-kit';
|
|
41
|
+
import { customProperties, Constraints, Spacings, Grid, designTokens, Text, usePaginationState, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, Link, Card, CheckBoldIcon, EyeCrossedIcon, ProgressBar, RadioInput, ContentNotification } from '@commercetools-frontend/ui-kit';
|
|
42
42
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
43
43
|
import { useDropzone } from 'react-dropzone';
|
|
44
44
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
@@ -49,23 +49,23 @@ import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instan
|
|
|
49
49
|
import DataTable from '@commercetools-uikit/data-table';
|
|
50
50
|
import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
|
|
51
51
|
|
|
52
|
-
function ownKeys$
|
|
53
|
-
function _objectSpread$
|
|
52
|
+
function ownKeys$g(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; }
|
|
53
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$g(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$g(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
54
54
|
function reducer(state, action) {
|
|
55
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
55
|
+
if (action.type === 'setCurrentStep') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
56
56
|
currentStep: action.currentStep,
|
|
57
57
|
progress: 0
|
|
58
58
|
});
|
|
59
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
59
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
60
60
|
uploadFileResponse: action.uploadFileResponse
|
|
61
61
|
});
|
|
62
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
62
|
+
if (action.type === 'setResourceType') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
63
63
|
resourceType: action.resourceType
|
|
64
64
|
});
|
|
65
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
65
|
+
if (action.type === 'setContainerKey') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
66
66
|
containerKey: action.containerKey
|
|
67
67
|
});
|
|
68
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
68
|
+
if (action.type === 'cancelImport') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
69
69
|
currentStep: 1,
|
|
70
70
|
containerKey: undefined,
|
|
71
71
|
fileUploadClientSideErrors: [],
|
|
@@ -74,7 +74,7 @@ function reducer(state, action) {
|
|
|
74
74
|
dropAreaState: 'disabled',
|
|
75
75
|
progress: 0
|
|
76
76
|
});
|
|
77
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
77
|
+
if (action.type === 'uploadNewFile') return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
78
78
|
currentStep: 1,
|
|
79
79
|
containerKey: undefined,
|
|
80
80
|
fileUploadClientSideErrors: [],
|
|
@@ -84,22 +84,22 @@ function reducer(state, action) {
|
|
|
84
84
|
progress: 0
|
|
85
85
|
});
|
|
86
86
|
if (action.type === 'setDroppedFile') {
|
|
87
|
-
return _objectSpread$
|
|
87
|
+
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
88
88
|
droppedFile: action.droppedFile
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
if (action.type === 'setFileUploadClientSideErrors') {
|
|
92
|
-
return _objectSpread$
|
|
92
|
+
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
93
93
|
fileUploadClientSideErrors: action.fileUploadClientSideErrors
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
if (action.type === 'setAbortController') {
|
|
97
|
-
return _objectSpread$
|
|
97
|
+
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
98
98
|
abortController: action.abortController
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
if (action.type === 'setProgress') {
|
|
102
|
-
return _objectSpread$
|
|
102
|
+
return _objectSpread$g(_objectSpread$g({}, state), {}, {
|
|
103
103
|
progress: action.progress
|
|
104
104
|
});
|
|
105
105
|
}
|
|
@@ -165,8 +165,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
165
165
|
return _createClass(HttpError);
|
|
166
166
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
167
167
|
|
|
168
|
-
function ownKeys$
|
|
169
|
-
function _objectSpread$
|
|
168
|
+
function ownKeys$f(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; }
|
|
169
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$f(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$f(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
170
170
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
171
171
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
172
172
|
};
|
|
@@ -178,7 +178,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
178
178
|
onSuccess = _ref2.onSuccess,
|
|
179
179
|
onError = _ref2.onError;
|
|
180
180
|
const options = createHttpClientOptions({
|
|
181
|
-
headers: _objectSpread$
|
|
181
|
+
headers: _objectSpread$f({
|
|
182
182
|
'Content-Type': 'application/json'
|
|
183
183
|
}, config?.headers)
|
|
184
184
|
});
|
|
@@ -279,8 +279,10 @@ const RESOURCE_TYPE_DOCUMENTATION_LINKS = {
|
|
|
279
279
|
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 'https://docs.commercetools.com/merchant-center/import-product-types#supported-headers-and-values'
|
|
280
280
|
};
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
|
|
282
|
+
const CT__API_DOCS_URL = 'https://docs.commercetools.com/api/';
|
|
283
|
+
|
|
284
|
+
function ownKeys$e(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; }
|
|
285
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$e(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$e(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
284
286
|
/**
|
|
285
287
|
* This function checks if the provided `expectedDelimiter` is used consistently in the first 10 lines of a CSV file.
|
|
286
288
|
* Returns a Promise that resolves to an object containing a boolean `isValid` property and the detected delimiter `delimiter`.
|
|
@@ -335,7 +337,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
335
337
|
};
|
|
336
338
|
const mapUploadFileClientSideErrorsToUploadFileErrorRows = uploadFileClientSideErrors => {
|
|
337
339
|
let idCounter = 1;
|
|
338
|
-
return _mapInstanceProperty(uploadFileClientSideErrors).call(uploadFileClientSideErrors, uploadFileClientSideError => _objectSpread$
|
|
340
|
+
return _mapInstanceProperty(uploadFileClientSideErrors).call(uploadFileClientSideErrors, uploadFileClientSideError => _objectSpread$e(_objectSpread$e({}, uploadFileClientSideError), {}, {
|
|
339
341
|
id: String(idCounter++)
|
|
340
342
|
}));
|
|
341
343
|
};
|
|
@@ -463,8 +465,8 @@ function uploadFileForImport(_ref) {
|
|
|
463
465
|
});
|
|
464
466
|
}
|
|
465
467
|
|
|
466
|
-
function ownKeys$
|
|
467
|
-
function _objectSpread$
|
|
468
|
+
function ownKeys$d(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; }
|
|
469
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$d(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$d(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
468
470
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
469
471
|
return asyncDispatch(actions.post({
|
|
470
472
|
mcApiProxyTarget: MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -473,7 +475,7 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
473
475
|
accept: 'application/json',
|
|
474
476
|
'Content-Type': 'application/json'
|
|
475
477
|
},
|
|
476
|
-
payload: _JSON$stringify(_objectSpread$
|
|
478
|
+
payload: _JSON$stringify(_objectSpread$d(_objectSpread$d({}, importContainerDraft), {}, {
|
|
477
479
|
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
478
480
|
}))
|
|
479
481
|
}));
|
|
@@ -512,8 +514,8 @@ function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
|
512
514
|
throw new Error('Invalid response');
|
|
513
515
|
}
|
|
514
516
|
|
|
515
|
-
function ownKeys$
|
|
516
|
-
function _objectSpread$
|
|
517
|
+
function ownKeys$c(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; }
|
|
518
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$c(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$c(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
517
519
|
const ImportResourcesContext = /*#__PURE__*/React.createContext();
|
|
518
520
|
const ImportResourcesProvider = props => {
|
|
519
521
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
@@ -521,7 +523,7 @@ const ImportResourcesProvider = props => {
|
|
|
521
523
|
})),
|
|
522
524
|
projectKey = _useApplicationContex.projectKey;
|
|
523
525
|
const asyncDispatch = useAsyncDispatch();
|
|
524
|
-
const _React$useReducer = React.useReducer(reducer, _objectSpread$
|
|
526
|
+
const _React$useReducer = React.useReducer(reducer, _objectSpread$c(_objectSpread$c({}, initialState), {}, {
|
|
525
527
|
resourceType: props.resourceTypes[0]
|
|
526
528
|
})),
|
|
527
529
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -654,13 +656,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
654
656
|
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== */");
|
|
655
657
|
}
|
|
656
658
|
|
|
657
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
659
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-0d158ff3.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
|
|
658
660
|
|
|
659
661
|
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-2c088477.esm.js' /* webpackChunkName: "disabled-drop-area" */));
|
|
660
662
|
|
|
661
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
663
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-9db1db62.esm.js' /* webpackChunkName: "enabled-drop-area" */));
|
|
662
664
|
|
|
663
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
665
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-04b18c45.esm.js' /* webpackChunkName: "filed-dropped-area" */));
|
|
664
666
|
|
|
665
667
|
function getDropArea(_ref) {
|
|
666
668
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -698,7 +700,7 @@ function getDropAreaState(flags) {
|
|
|
698
700
|
return 'ready-for-drop';
|
|
699
701
|
}
|
|
700
702
|
|
|
701
|
-
var messages$
|
|
703
|
+
var messages$6 = defineMessages({
|
|
702
704
|
dragAndDropCSV: {
|
|
703
705
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
704
706
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -763,7 +765,7 @@ function useImportResourcesContext() {
|
|
|
763
765
|
return context;
|
|
764
766
|
}
|
|
765
767
|
|
|
766
|
-
var messages$
|
|
768
|
+
var messages$5 = defineMessages({
|
|
767
769
|
fileSizeExceededTitle: {
|
|
768
770
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
769
771
|
defaultMessage: 'File size exceeded'
|
|
@@ -830,25 +832,25 @@ const useUpload = () => {
|
|
|
830
832
|
const errors = [];
|
|
831
833
|
const delimiterCheck = await checkDelimiter(file);
|
|
832
834
|
if (!delimiterCheck.isValid) errors.push({
|
|
833
|
-
title: intl.formatMessage(messages$
|
|
834
|
-
description: intl.formatMessage(messages$
|
|
835
|
+
title: intl.formatMessage(messages$5.dropAreaWrongDelimiterTitle),
|
|
836
|
+
description: intl.formatMessage(messages$5.dropAreaWrongDelimiterDescription, {
|
|
835
837
|
delimiter: delimiterCheck.delimiter
|
|
836
838
|
})
|
|
837
839
|
});
|
|
838
840
|
const rowCount = await getRowCount(file);
|
|
839
841
|
if (rowCount < 1) errors.push({
|
|
840
|
-
title: intl.formatMessage(messages$
|
|
841
|
-
description: intl.formatMessage(messages$
|
|
842
|
+
title: intl.formatMessage(messages$5.dropAreaNotEnoughRowsTitle),
|
|
843
|
+
description: intl.formatMessage(messages$5.dropAreaNotEnoughRowsDescription)
|
|
842
844
|
});
|
|
843
845
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
844
|
-
title: intl.formatMessage(messages$
|
|
845
|
-
description: intl.formatMessage(messages$
|
|
846
|
+
title: intl.formatMessage(messages$5.fileSizeExceededTitle),
|
|
847
|
+
description: intl.formatMessage(messages$5.fileSizeExceededDescription, {
|
|
846
848
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
847
849
|
})
|
|
848
850
|
});
|
|
849
851
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
850
|
-
title: intl.formatMessage(messages$
|
|
851
|
-
description: intl.formatMessage(messages$
|
|
852
|
+
title: intl.formatMessage(messages$5.rowLimitExceededTitle),
|
|
853
|
+
description: intl.formatMessage(messages$5.rowLimitExceededDescription, {
|
|
852
854
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
853
855
|
})
|
|
854
856
|
});
|
|
@@ -870,7 +872,7 @@ const useUpload = () => {
|
|
|
870
872
|
showNotification({
|
|
871
873
|
kind: 'error',
|
|
872
874
|
domain: DOMAINS.PAGE,
|
|
873
|
-
text: intl.formatMessage(messages$
|
|
875
|
+
text: intl.formatMessage(messages$5.missingKeyError)
|
|
874
876
|
});
|
|
875
877
|
} else if (error.errorData?.invalid > 0) {
|
|
876
878
|
actions.setUploadFileResponse(error.errorData);
|
|
@@ -880,7 +882,7 @@ const useUpload = () => {
|
|
|
880
882
|
showNotification({
|
|
881
883
|
kind: 'error',
|
|
882
884
|
domain: DOMAINS.PAGE,
|
|
883
|
-
text: intl.formatMessage(messages$
|
|
885
|
+
text: intl.formatMessage(messages$5.unexpectedError)
|
|
884
886
|
});
|
|
885
887
|
}
|
|
886
888
|
} else {
|
|
@@ -942,8 +944,8 @@ const useUpload = () => {
|
|
|
942
944
|
};
|
|
943
945
|
};
|
|
944
946
|
|
|
945
|
-
function ownKeys$
|
|
946
|
-
function _objectSpread$
|
|
947
|
+
function ownKeys$b(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; }
|
|
948
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys$b(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$b(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
947
949
|
const FileDropArea = () => {
|
|
948
950
|
const intl = useIntl();
|
|
949
951
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -973,7 +975,7 @@ const FileDropArea = () => {
|
|
|
973
975
|
showNotification({
|
|
974
976
|
kind: 'error',
|
|
975
977
|
domain: DOMAINS.PAGE,
|
|
976
|
-
text: intl.formatMessage(messages$
|
|
978
|
+
text: intl.formatMessage(messages$6.tooManyFilesError)
|
|
977
979
|
});
|
|
978
980
|
return;
|
|
979
981
|
}
|
|
@@ -981,13 +983,13 @@ const FileDropArea = () => {
|
|
|
981
983
|
showNotification({
|
|
982
984
|
kind: 'error',
|
|
983
985
|
domain: DOMAINS.PAGE,
|
|
984
|
-
text: intl.formatMessage(messages$
|
|
986
|
+
text: intl.formatMessage(messages$6.fileFormatNotSupported)
|
|
985
987
|
});
|
|
986
988
|
} else {
|
|
987
989
|
showNotification({
|
|
988
990
|
kind: 'error',
|
|
989
991
|
domain: DOMAINS.PAGE,
|
|
990
|
-
text: intl.formatMessage(messages$
|
|
992
|
+
text: intl.formatMessage(messages$6.genericError)
|
|
991
993
|
});
|
|
992
994
|
}
|
|
993
995
|
}
|
|
@@ -1005,11 +1007,11 @@ const FileDropArea = () => {
|
|
|
1005
1007
|
resourceType: 'category',
|
|
1006
1008
|
isFileDropped: Boolean(state.droppedFile)
|
|
1007
1009
|
});
|
|
1008
|
-
return jsxs(DropWrapper, _objectSpread$
|
|
1010
|
+
return jsxs(DropWrapper, _objectSpread$b(_objectSpread$b({
|
|
1009
1011
|
role: "presentation"
|
|
1010
1012
|
}, getRootProps()), {}, {
|
|
1011
1013
|
dropAreaState: dropAreaState,
|
|
1012
|
-
children: [jsx("input", _objectSpread$
|
|
1014
|
+
children: [jsx("input", _objectSpread$b({
|
|
1013
1015
|
"data-testid": "file-input"
|
|
1014
1016
|
}, getInputProps())), jsx(Constraints.Horizontal, {
|
|
1015
1017
|
children: dropArea
|
|
@@ -1094,26 +1096,26 @@ const Upload = () => {
|
|
|
1094
1096
|
}),
|
|
1095
1097
|
children: jsx(Masking.Unmask, {
|
|
1096
1098
|
children: jsxs(Spacings.Stack, {
|
|
1097
|
-
scale: "
|
|
1099
|
+
scale: "m",
|
|
1098
1100
|
children: [isMultipleResourceTypes ? jsxs(Grid, {
|
|
1099
1101
|
gridRowGap: designTokens.spacingL,
|
|
1100
1102
|
gridTemplateColumns: `calc(${designTokens.constraint3} + ${designTokens.spacingL}) auto`,
|
|
1101
1103
|
children: [jsx(Grid.Item, {
|
|
1102
1104
|
children: jsx(Text.Body, {
|
|
1103
1105
|
isBold: true,
|
|
1104
|
-
intlMessage: messages$
|
|
1106
|
+
intlMessage: messages$6.dataType
|
|
1105
1107
|
})
|
|
1106
1108
|
}), jsx(Grid.Item, {
|
|
1107
1109
|
children: jsx(ResourceTypeSelection, {})
|
|
1108
1110
|
}), jsx(Grid.Item, {
|
|
1109
1111
|
children: jsx(Text.Body, {
|
|
1110
1112
|
isBold: true,
|
|
1111
|
-
intlMessage: messages$
|
|
1113
|
+
intlMessage: messages$6.instructions
|
|
1112
1114
|
})
|
|
1113
1115
|
}), jsx(Grid.Item, {
|
|
1114
1116
|
children: jsx(Instructions, {})
|
|
1115
1117
|
})]
|
|
1116
|
-
}) : jsx(Instructions, {}), jsx(Masking.Mask, {
|
|
1118
|
+
}) : jsx(Instructions, {}), jsx(InfoBox, {}), jsx(Masking.Mask, {
|
|
1117
1119
|
children: jsx(FileDropArea, {})
|
|
1118
1120
|
})]
|
|
1119
1121
|
})
|
|
@@ -1121,7 +1123,7 @@ const Upload = () => {
|
|
|
1121
1123
|
});
|
|
1122
1124
|
};
|
|
1123
1125
|
|
|
1124
|
-
var messages$
|
|
1126
|
+
var messages$4 = defineMessages({
|
|
1125
1127
|
row: {
|
|
1126
1128
|
id: 'ImportResourcesModal.row',
|
|
1127
1129
|
description: 'In Upload file error modal - "Row" column',
|
|
@@ -1154,15 +1156,15 @@ var messages$3 = defineMessages({
|
|
|
1154
1156
|
}
|
|
1155
1157
|
});
|
|
1156
1158
|
|
|
1157
|
-
function ownKeys$
|
|
1158
|
-
function _objectSpread$
|
|
1159
|
+
function ownKeys$a(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; }
|
|
1160
|
+
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$a(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$a(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1159
1161
|
const getColumns$1 = () => [{
|
|
1160
1162
|
key: 'errorType',
|
|
1161
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1163
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.errorType)),
|
|
1162
1164
|
width: 'max-content'
|
|
1163
1165
|
}, {
|
|
1164
1166
|
key: 'details',
|
|
1165
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1167
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1166
1168
|
}];
|
|
1167
1169
|
const UploadClientSideErrorTable = props => {
|
|
1168
1170
|
var _context;
|
|
@@ -1205,8 +1207,8 @@ function itemRenderer$1(item, column) {
|
|
|
1205
1207
|
}
|
|
1206
1208
|
}
|
|
1207
1209
|
|
|
1208
|
-
function ownKeys$
|
|
1209
|
-
function _objectSpread$
|
|
1210
|
+
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
|
+
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; }
|
|
1210
1212
|
const UploadClientSideErrorsModal = () => {
|
|
1211
1213
|
const intl = useIntl();
|
|
1212
1214
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1224,7 +1226,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1224
1226
|
scale: "l",
|
|
1225
1227
|
children: [jsx(Masking.Mask, {
|
|
1226
1228
|
children: jsx(Text.Body, {
|
|
1227
|
-
intlMessage: _objectSpread$
|
|
1229
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadingError), {}, {
|
|
1228
1230
|
values: {
|
|
1229
1231
|
fileName: state.droppedFile?.name,
|
|
1230
1232
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1242,7 +1244,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1242
1244
|
onClick: () => onClose()
|
|
1243
1245
|
}), jsx(PrimaryButton, {
|
|
1244
1246
|
iconLeft: jsx(ImportIcon, {}),
|
|
1245
|
-
label: intl.formatMessage(messages$
|
|
1247
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1246
1248
|
onClick: () => actions.uploadNewFile()
|
|
1247
1249
|
})]
|
|
1248
1250
|
})]
|
|
@@ -1258,19 +1260,19 @@ function getBold$3(msg) {
|
|
|
1258
1260
|
});
|
|
1259
1261
|
}
|
|
1260
1262
|
|
|
1261
|
-
function ownKeys$
|
|
1262
|
-
function _objectSpread$
|
|
1263
|
+
function ownKeys$8(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; }
|
|
1264
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$8(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$8(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1263
1265
|
const getColumns = () => [{
|
|
1264
1266
|
key: 'row',
|
|
1265
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1267
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.row)),
|
|
1266
1268
|
width: 'max-content'
|
|
1267
1269
|
}, {
|
|
1268
1270
|
key: 'errorType',
|
|
1269
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1271
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.errorType)),
|
|
1270
1272
|
width: 'max-content'
|
|
1271
1273
|
}, {
|
|
1272
1274
|
key: 'details',
|
|
1273
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1275
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1274
1276
|
}];
|
|
1275
1277
|
const UploadServerSideErrorTable = props => {
|
|
1276
1278
|
var _context;
|
|
@@ -1321,8 +1323,8 @@ function itemRenderer(item, column) {
|
|
|
1321
1323
|
}
|
|
1322
1324
|
}
|
|
1323
1325
|
|
|
1324
|
-
function ownKeys$
|
|
1325
|
-
function _objectSpread$
|
|
1326
|
+
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
|
+
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; }
|
|
1326
1328
|
const UploadServerSideErrorsModal = () => {
|
|
1327
1329
|
const intl = useIntl();
|
|
1328
1330
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1343,7 +1345,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1343
1345
|
scale: "xs",
|
|
1344
1346
|
children: [jsx(Masking.Mask, {
|
|
1345
1347
|
children: jsx(Text.Body, {
|
|
1346
|
-
intlMessage: _objectSpread$
|
|
1348
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadingError), {}, {
|
|
1347
1349
|
values: {
|
|
1348
1350
|
fileName: state.droppedFile?.name,
|
|
1349
1351
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1352,7 +1354,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1352
1354
|
})
|
|
1353
1355
|
})
|
|
1354
1356
|
}), jsx(Text.Body, {
|
|
1355
|
-
intlMessage: _objectSpread$
|
|
1357
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.supportedValuesDocumentation), {}, {
|
|
1356
1358
|
values: {
|
|
1357
1359
|
documentationLink: msg => jsx(Link, {
|
|
1358
1360
|
tone: "secondary",
|
|
@@ -1373,7 +1375,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1373
1375
|
onClick: () => onClose()
|
|
1374
1376
|
}), jsx(PrimaryButton, {
|
|
1375
1377
|
iconLeft: jsx(ImportIcon, {}),
|
|
1376
|
-
label: intl.formatMessage(messages$
|
|
1378
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1377
1379
|
onClick: () => actions.uploadNewFile()
|
|
1378
1380
|
})]
|
|
1379
1381
|
})]
|
|
@@ -1389,7 +1391,7 @@ function getBold$2(msg) {
|
|
|
1389
1391
|
});
|
|
1390
1392
|
}
|
|
1391
1393
|
|
|
1392
|
-
var messages$
|
|
1394
|
+
var messages$3 = defineMessages({
|
|
1393
1395
|
startImportButton: {
|
|
1394
1396
|
id: 'ImportResourcesModal.startImportButton',
|
|
1395
1397
|
description: 'Label for the modal Start import button',
|
|
@@ -1472,8 +1474,8 @@ var messages$2 = defineMessages({
|
|
|
1472
1474
|
}
|
|
1473
1475
|
});
|
|
1474
1476
|
|
|
1475
|
-
function ownKeys$
|
|
1476
|
-
function _objectSpread$
|
|
1477
|
+
function ownKeys$6(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; }
|
|
1478
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1477
1479
|
const truncate = (isExpanded, columns, columnsCount) => {
|
|
1478
1480
|
return isExpanded ? columns.join(' | ') : _sliceInstanceProperty(columns).call(columns, 0, columnsCount).join(' | ') + (columns.length > columnsCount ? '...' : '');
|
|
1479
1481
|
};
|
|
@@ -1502,7 +1504,7 @@ const ColumnList = props => {
|
|
|
1502
1504
|
e.preventDefault();
|
|
1503
1505
|
setIsExpanded(!isExpanded);
|
|
1504
1506
|
},
|
|
1505
|
-
children: isExpanded ? jsx(FormattedMessage, _objectSpread$
|
|
1507
|
+
children: isExpanded ? jsx(FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1506
1508
|
})
|
|
1507
1509
|
})]
|
|
1508
1510
|
})
|
|
@@ -1510,8 +1512,8 @@ const ColumnList = props => {
|
|
|
1510
1512
|
});
|
|
1511
1513
|
};
|
|
1512
1514
|
|
|
1513
|
-
function ownKeys$
|
|
1514
|
-
function _objectSpread$
|
|
1515
|
+
function ownKeys$5(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; }
|
|
1516
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1515
1517
|
function UploadPreviewModal() {
|
|
1516
1518
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1517
1519
|
state = _useImportResourcesCo.state;
|
|
@@ -1526,7 +1528,7 @@ function UploadPreviewModal() {
|
|
|
1526
1528
|
size: 16,
|
|
1527
1529
|
isOpen: true,
|
|
1528
1530
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1529
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1531
|
+
labelPrimary: intl.formatMessage(messages$3.continue),
|
|
1530
1532
|
onSecondaryButtonClick: () => onClose({
|
|
1531
1533
|
shouldDeleteImportContainer: true
|
|
1532
1534
|
}),
|
|
@@ -1545,7 +1547,7 @@ function UploadPreviewModal() {
|
|
|
1545
1547
|
children: jsxs(Spacings.Stack, {
|
|
1546
1548
|
scale: "m",
|
|
1547
1549
|
children: [jsx("div", {}), jsx(Text.Body, {
|
|
1548
|
-
intlMessage: messages$
|
|
1550
|
+
intlMessage: messages$3.previewOfYourImport
|
|
1549
1551
|
}), jsx(Card, {
|
|
1550
1552
|
insetScale: "xl",
|
|
1551
1553
|
children: jsxs(Spacings.Stack, {
|
|
@@ -1555,7 +1557,7 @@ function UploadPreviewModal() {
|
|
|
1555
1557
|
children: [jsx(CheckBoldIcon, {
|
|
1556
1558
|
color: "success"
|
|
1557
1559
|
}), jsx(Text.Body, {
|
|
1558
|
-
intlMessage: _objectSpread$
|
|
1560
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
|
|
1559
1561
|
values: {
|
|
1560
1562
|
rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
|
|
1561
1563
|
b: getBold$1
|
|
@@ -1567,7 +1569,7 @@ function UploadPreviewModal() {
|
|
|
1567
1569
|
children: [jsx(CheckBoldIcon, {
|
|
1568
1570
|
color: "success"
|
|
1569
1571
|
}), jsx(Text.Body, {
|
|
1570
|
-
intlMessage: _objectSpread$
|
|
1572
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeImported), {}, {
|
|
1571
1573
|
values: {
|
|
1572
1574
|
columnCount: intl.formatNumber(validatedColumns.length),
|
|
1573
1575
|
b: getBold$1
|
|
@@ -1587,7 +1589,7 @@ function UploadPreviewModal() {
|
|
|
1587
1589
|
children: [jsx(EyeCrossedIcon, {
|
|
1588
1590
|
color: "neutral60"
|
|
1589
1591
|
}), jsx(Text.Body, {
|
|
1590
|
-
intlMessage: _objectSpread$
|
|
1592
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeIgnored), {}, {
|
|
1591
1593
|
values: {
|
|
1592
1594
|
columnCount: intl.formatNumber(ignoredColumns.length),
|
|
1593
1595
|
b: getBold$1
|
|
@@ -1614,8 +1616,8 @@ function getBold$1(msg) {
|
|
|
1614
1616
|
});
|
|
1615
1617
|
}
|
|
1616
1618
|
|
|
1617
|
-
function ownKeys$
|
|
1618
|
-
function _objectSpread$
|
|
1619
|
+
function ownKeys$4(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; }
|
|
1620
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1619
1621
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
1620
1622
|
const getNewLine = () => jsx("br", {});
|
|
1621
1623
|
const getImportLogsLink = (msg, projectKey) => jsx(Link, {
|
|
@@ -1634,7 +1636,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
1634
1636
|
const ImportRunningTextNotification = props => jsx("div", {
|
|
1635
1637
|
css: _ref2,
|
|
1636
1638
|
children: jsx(Text.Body, {
|
|
1637
|
-
intlMessage: _objectSpread$
|
|
1639
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.importNotificationSuccessMessage), {}, {
|
|
1638
1640
|
values: {
|
|
1639
1641
|
newline: getNewLine,
|
|
1640
1642
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1655,7 +1657,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
1655
1657
|
const ImportPreparingTextNotification = props => jsx("div", {
|
|
1656
1658
|
css: _ref,
|
|
1657
1659
|
children: jsx(Text.Body, {
|
|
1658
|
-
intlMessage: _objectSpread$
|
|
1660
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.importNotificationPrepareMessage), {}, {
|
|
1659
1661
|
values: {
|
|
1660
1662
|
newline: getNewLine,
|
|
1661
1663
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1680,7 +1682,7 @@ const ImportConfirmationModal = () => {
|
|
|
1680
1682
|
const showNotification = useShowNotification();
|
|
1681
1683
|
return jsx(ConfirmationDialog, {
|
|
1682
1684
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1683
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1685
|
+
labelPrimary: intl.formatMessage(messages$3.startImportButton),
|
|
1684
1686
|
isOpen: true,
|
|
1685
1687
|
onClose: () => onClose({
|
|
1686
1688
|
shouldDeleteImportContainer: true
|
|
@@ -1743,7 +1745,7 @@ const ImportConfirmationModal = () => {
|
|
|
1743
1745
|
scale: "xl",
|
|
1744
1746
|
children: [jsxs("div", {
|
|
1745
1747
|
children: [jsx(Text.Body, {
|
|
1746
|
-
intlMessage: _objectSpread$
|
|
1748
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.confirmationBodyText), {}, {
|
|
1747
1749
|
values: {
|
|
1748
1750
|
projectName: projectName,
|
|
1749
1751
|
count: intl.formatNumber(state?.uploadFileResponse?.rowsCount || 0),
|
|
@@ -1751,10 +1753,10 @@ const ImportConfirmationModal = () => {
|
|
|
1751
1753
|
}
|
|
1752
1754
|
})
|
|
1753
1755
|
}), jsx(Text.Body, {
|
|
1754
|
-
intlMessage: messages$
|
|
1756
|
+
intlMessage: messages$3.confirmationBodyNote
|
|
1755
1757
|
})]
|
|
1756
1758
|
}), jsx(Text.Body, {
|
|
1757
|
-
intlMessage: messages$
|
|
1759
|
+
intlMessage: messages$3.confirmationBodyQuestion
|
|
1758
1760
|
})]
|
|
1759
1761
|
})
|
|
1760
1762
|
})
|
|
@@ -1776,10 +1778,10 @@ const UploadResult = () => {
|
|
|
1776
1778
|
return jsx(UploadPreviewModal, {});
|
|
1777
1779
|
};
|
|
1778
1780
|
|
|
1779
|
-
function ownKeys$
|
|
1780
|
-
function _objectSpread$
|
|
1781
|
+
function ownKeys$3(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; }
|
|
1782
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$3(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$3(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1781
1783
|
var FileIcon = function FileIcon(props) {
|
|
1782
|
-
return jsxs("svg", _objectSpread$
|
|
1784
|
+
return jsxs("svg", _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
1783
1785
|
children: [jsx("mask", {
|
|
1784
1786
|
id: "a",
|
|
1785
1787
|
style: {
|
|
@@ -1873,7 +1875,7 @@ const CurrentStep = () => {
|
|
|
1873
1875
|
return steps[state.currentStep] || null;
|
|
1874
1876
|
};
|
|
1875
1877
|
|
|
1876
|
-
var messages$
|
|
1878
|
+
var messages$2 = defineMessages({
|
|
1877
1879
|
products: {
|
|
1878
1880
|
id: 'ImportResourcesModal.radio.products',
|
|
1879
1881
|
description: 'Label for the products radio button',
|
|
@@ -1894,11 +1896,11 @@ var messages$1 = defineMessages({
|
|
|
1894
1896
|
const resourceTypeToDisplayName = resourceType => {
|
|
1895
1897
|
switch (resourceType) {
|
|
1896
1898
|
case IMPORTABLE_RESOURCES.PRODUCT:
|
|
1897
|
-
return messages$
|
|
1899
|
+
return messages$2.products;
|
|
1898
1900
|
case IMPORTABLE_RESOURCES.INVENTORY:
|
|
1899
|
-
return messages$
|
|
1901
|
+
return messages$2.inventories;
|
|
1900
1902
|
case IMPORTABLE_RESOURCES.CATEGORY:
|
|
1901
|
-
return messages$
|
|
1903
|
+
return messages$2.categories;
|
|
1902
1904
|
default:
|
|
1903
1905
|
throw new Error(`Unknown resource type: ${resourceType}`);
|
|
1904
1906
|
}
|
|
@@ -1926,7 +1928,7 @@ const ResourceTypeSelection = () => {
|
|
|
1926
1928
|
});
|
|
1927
1929
|
};
|
|
1928
1930
|
|
|
1929
|
-
var messages = defineMessages({
|
|
1931
|
+
var messages$1 = defineMessages({
|
|
1930
1932
|
fileUploadInstructions: {
|
|
1931
1933
|
id: 'ImportResourcesModal.fileUploadInstructions',
|
|
1932
1934
|
description: 'Label for the modal category description',
|
|
@@ -1934,8 +1936,8 @@ var messages = defineMessages({
|
|
|
1934
1936
|
}
|
|
1935
1937
|
});
|
|
1936
1938
|
|
|
1937
|
-
function ownKeys$
|
|
1938
|
-
function _objectSpread$
|
|
1939
|
+
function ownKeys$2(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; }
|
|
1940
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$2(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$2(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1939
1941
|
const Instructions = () => {
|
|
1940
1942
|
const intl = useIntl();
|
|
1941
1943
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1943,7 +1945,7 @@ const Instructions = () => {
|
|
|
1943
1945
|
const templateLink = RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS[state.resourceType];
|
|
1944
1946
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
1945
1947
|
return jsx(Text.Body, {
|
|
1946
|
-
intlMessage: _objectSpread$
|
|
1948
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$1.fileUploadInstructions), {}, {
|
|
1947
1949
|
values: {
|
|
1948
1950
|
fileSize: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType]),
|
|
1949
1951
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType]),
|
|
@@ -1964,13 +1966,58 @@ const Instructions = () => {
|
|
|
1964
1966
|
});
|
|
1965
1967
|
};
|
|
1966
1968
|
|
|
1969
|
+
var messages = defineMessages({
|
|
1970
|
+
prerequisitesOfImportingData: {
|
|
1971
|
+
id: 'ImportResourcesModal.infoBox.prerequisitesOfImportingData',
|
|
1972
|
+
description: 'A message to guide users to check the prerequisites of importing data',
|
|
1973
|
+
defaultMessage: 'Prerequisites of importing data'
|
|
1974
|
+
},
|
|
1975
|
+
keysForEveryResource: {
|
|
1976
|
+
id: 'ImportResourcesModal.infoBox.keysForEveryResource',
|
|
1977
|
+
description: 'A message to guide users to provide keys for every resource they import',
|
|
1978
|
+
defaultMessage: 'You must provide keys for every resource you import, including embedded resources such as Prices and Assets. Please consult with your admins to assign keys through <link>the HTTP API</link>.'
|
|
1979
|
+
}
|
|
1980
|
+
});
|
|
1981
|
+
|
|
1982
|
+
function ownKeys$1(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; }
|
|
1983
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$1(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$1(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1984
|
+
const InfoBox = () => {
|
|
1985
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1986
|
+
state = _useImportResourcesCo.state;
|
|
1987
|
+
if (!state.resourceType) return null;
|
|
1988
|
+
return jsx(ContentNotification, {
|
|
1989
|
+
type: "info",
|
|
1990
|
+
children: jsx(Spacings.Inset, {
|
|
1991
|
+
scale: "xs",
|
|
1992
|
+
children: jsxs(Spacings.Stack, {
|
|
1993
|
+
scale: "xs",
|
|
1994
|
+
children: [jsx(Text.Subheadline, {
|
|
1995
|
+
as: "h4",
|
|
1996
|
+
intlMessage: messages.prerequisitesOfImportingData
|
|
1997
|
+
}), jsx(Text.Body, {
|
|
1998
|
+
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.keysForEveryResource), {}, {
|
|
1999
|
+
values: {
|
|
2000
|
+
link: msg => jsx(Link, {
|
|
2001
|
+
tone: "secondary",
|
|
2002
|
+
isExternal: true,
|
|
2003
|
+
to: CT__API_DOCS_URL,
|
|
2004
|
+
children: msg
|
|
2005
|
+
})
|
|
2006
|
+
}
|
|
2007
|
+
})
|
|
2008
|
+
})]
|
|
2009
|
+
})
|
|
2010
|
+
})
|
|
2011
|
+
});
|
|
2012
|
+
};
|
|
2013
|
+
|
|
1967
2014
|
const getChunkImport = locale => {
|
|
1968
2015
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
1969
2016
|
switch (intlLocale) {
|
|
1970
2017
|
case 'de':
|
|
1971
2018
|
return import(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-cd6c45d3.esm.js');
|
|
1972
2019
|
case 'es':
|
|
1973
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2020
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-b38875bc.esm.js');
|
|
1974
2021
|
case 'fr-FR':
|
|
1975
2022
|
return import(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-9d9081ee.esm.js');
|
|
1976
2023
|
case 'zh-CN':
|
|
@@ -2060,4 +2107,4 @@ const ImportResourcesModal = props => {
|
|
|
2060
2107
|
};
|
|
2061
2108
|
ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
2062
2109
|
|
|
2063
|
-
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, messages$
|
|
2110
|
+
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, messages$6 as m, useImportResourcesContext as u };
|