@commercetools-frontend-extensions/import-resources-modal 1.3.13 → 1.3.15
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-11f2cde9.cjs.prod.js → active-drag-drop-area-2b0845a4.cjs.prod.js} +1 -1
- package/dist/{active-drag-drop-area-67588c22.esm.js → active-drag-drop-area-c0368c1e.esm.js} +1 -1
- package/dist/{active-drag-drop-area-2105994c.cjs.dev.js → active-drag-drop-area-e62ef22b.cjs.dev.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-f36e516f.cjs.prod.js → enabled-drop-area-134390f4.cjs.prod.js} +1 -1
- package/dist/{enabled-drop-area-fbda1cbb.cjs.dev.js → enabled-drop-area-2429c14d.cjs.dev.js} +1 -1
- package/dist/{enabled-drop-area-93f8c01f.esm.js → enabled-drop-area-c0c903b2.esm.js} +1 -1
- package/dist/{es-d3119d27.cjs.prod.js → es-08b25677.cjs.dev.js} +9 -1
- package/dist/{es-57633f1e.cjs.dev.js → es-231d6889.cjs.prod.js} +9 -1
- package/dist/{es-7843d8d8.esm.js → es-4cfa2244.esm.js} +9 -1
- package/dist/{file-dropped-area-73e015f2.cjs.prod.js → file-dropped-area-353d39b6.cjs.prod.js} +1 -1
- package/dist/{file-dropped-area-39ef5224.esm.js → file-dropped-area-5560a729.esm.js} +1 -1
- package/dist/{file-dropped-area-9468bb2e.cjs.dev.js → file-dropped-area-8b7bffb5.cjs.dev.js} +1 -1
- package/dist/{index-07a3b260.cjs.prod.js → index-3905ce0c.cjs.prod.js} +149 -104
- package/dist/{index-9b9b2650.esm.js → index-704cf74c.esm.js} +150 -105
- package/dist/{index-decbade4.cjs.dev.js → index-bfc0d471.cjs.dev.js} +149 -104
- 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-c0368c1e.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-c0c903b2.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-5560a729.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'
|
|
@@ -789,7 +791,7 @@ var messages$4 = defineMessages({
|
|
|
789
791
|
dropAreaWrongDelimiterDescription: {
|
|
790
792
|
id: 'ImportResourcesModal.wrongDelimiterDescription',
|
|
791
793
|
description: 'Message within the drop area when a CSV file uses an unexpected delimiter',
|
|
792
|
-
defaultMessage: 'The file is using
|
|
794
|
+
defaultMessage: 'The file is using an incorrect delimiter. Please use comma (,) instead.'
|
|
793
795
|
},
|
|
794
796
|
dropAreaNotEnoughRowsTitle: {
|
|
795
797
|
id: 'ImportResourcesModal.dropAreaNotEnoughRowsTitle',
|
|
@@ -830,25 +832,23 @@ 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
|
-
delimiter: delimiterCheck.delimiter
|
|
836
|
-
})
|
|
835
|
+
title: intl.formatMessage(messages$5.dropAreaWrongDelimiterTitle),
|
|
836
|
+
description: intl.formatMessage(messages$5.dropAreaWrongDelimiterDescription)
|
|
837
837
|
});
|
|
838
838
|
const rowCount = await getRowCount(file);
|
|
839
839
|
if (rowCount < 1) errors.push({
|
|
840
|
-
title: intl.formatMessage(messages$
|
|
841
|
-
description: intl.formatMessage(messages$
|
|
840
|
+
title: intl.formatMessage(messages$5.dropAreaNotEnoughRowsTitle),
|
|
841
|
+
description: intl.formatMessage(messages$5.dropAreaNotEnoughRowsDescription)
|
|
842
842
|
});
|
|
843
843
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
844
|
-
title: intl.formatMessage(messages$
|
|
845
|
-
description: intl.formatMessage(messages$
|
|
844
|
+
title: intl.formatMessage(messages$5.fileSizeExceededTitle),
|
|
845
|
+
description: intl.formatMessage(messages$5.fileSizeExceededDescription, {
|
|
846
846
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
847
847
|
})
|
|
848
848
|
});
|
|
849
849
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
850
|
-
title: intl.formatMessage(messages$
|
|
851
|
-
description: intl.formatMessage(messages$
|
|
850
|
+
title: intl.formatMessage(messages$5.rowLimitExceededTitle),
|
|
851
|
+
description: intl.formatMessage(messages$5.rowLimitExceededDescription, {
|
|
852
852
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
853
853
|
})
|
|
854
854
|
});
|
|
@@ -870,7 +870,7 @@ const useUpload = () => {
|
|
|
870
870
|
showNotification({
|
|
871
871
|
kind: 'error',
|
|
872
872
|
domain: DOMAINS.PAGE,
|
|
873
|
-
text: intl.formatMessage(messages$
|
|
873
|
+
text: intl.formatMessage(messages$5.missingKeyError)
|
|
874
874
|
});
|
|
875
875
|
} else if (error.errorData?.invalid > 0) {
|
|
876
876
|
actions.setUploadFileResponse(error.errorData);
|
|
@@ -880,7 +880,7 @@ const useUpload = () => {
|
|
|
880
880
|
showNotification({
|
|
881
881
|
kind: 'error',
|
|
882
882
|
domain: DOMAINS.PAGE,
|
|
883
|
-
text: intl.formatMessage(messages$
|
|
883
|
+
text: intl.formatMessage(messages$5.unexpectedError)
|
|
884
884
|
});
|
|
885
885
|
}
|
|
886
886
|
} else {
|
|
@@ -942,8 +942,8 @@ const useUpload = () => {
|
|
|
942
942
|
};
|
|
943
943
|
};
|
|
944
944
|
|
|
945
|
-
function ownKeys$
|
|
946
|
-
function _objectSpread$
|
|
945
|
+
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; }
|
|
946
|
+
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
947
|
const FileDropArea = () => {
|
|
948
948
|
const intl = useIntl();
|
|
949
949
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -973,7 +973,7 @@ const FileDropArea = () => {
|
|
|
973
973
|
showNotification({
|
|
974
974
|
kind: 'error',
|
|
975
975
|
domain: DOMAINS.PAGE,
|
|
976
|
-
text: intl.formatMessage(messages$
|
|
976
|
+
text: intl.formatMessage(messages$6.tooManyFilesError)
|
|
977
977
|
});
|
|
978
978
|
return;
|
|
979
979
|
}
|
|
@@ -981,13 +981,13 @@ const FileDropArea = () => {
|
|
|
981
981
|
showNotification({
|
|
982
982
|
kind: 'error',
|
|
983
983
|
domain: DOMAINS.PAGE,
|
|
984
|
-
text: intl.formatMessage(messages$
|
|
984
|
+
text: intl.formatMessage(messages$6.fileFormatNotSupported)
|
|
985
985
|
});
|
|
986
986
|
} else {
|
|
987
987
|
showNotification({
|
|
988
988
|
kind: 'error',
|
|
989
989
|
domain: DOMAINS.PAGE,
|
|
990
|
-
text: intl.formatMessage(messages$
|
|
990
|
+
text: intl.formatMessage(messages$6.genericError)
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
993
|
}
|
|
@@ -1005,11 +1005,11 @@ const FileDropArea = () => {
|
|
|
1005
1005
|
resourceType: 'category',
|
|
1006
1006
|
isFileDropped: Boolean(state.droppedFile)
|
|
1007
1007
|
});
|
|
1008
|
-
return jsxs(DropWrapper, _objectSpread$
|
|
1008
|
+
return jsxs(DropWrapper, _objectSpread$b(_objectSpread$b({
|
|
1009
1009
|
role: "presentation"
|
|
1010
1010
|
}, getRootProps()), {}, {
|
|
1011
1011
|
dropAreaState: dropAreaState,
|
|
1012
|
-
children: [jsx("input", _objectSpread$
|
|
1012
|
+
children: [jsx("input", _objectSpread$b({
|
|
1013
1013
|
"data-testid": "file-input"
|
|
1014
1014
|
}, getInputProps())), jsx(Constraints.Horizontal, {
|
|
1015
1015
|
children: dropArea
|
|
@@ -1094,26 +1094,26 @@ const Upload = () => {
|
|
|
1094
1094
|
}),
|
|
1095
1095
|
children: jsx(Masking.Unmask, {
|
|
1096
1096
|
children: jsxs(Spacings.Stack, {
|
|
1097
|
-
scale: "
|
|
1097
|
+
scale: "m",
|
|
1098
1098
|
children: [isMultipleResourceTypes ? jsxs(Grid, {
|
|
1099
1099
|
gridRowGap: designTokens.spacingL,
|
|
1100
1100
|
gridTemplateColumns: `calc(${designTokens.constraint3} + ${designTokens.spacingL}) auto`,
|
|
1101
1101
|
children: [jsx(Grid.Item, {
|
|
1102
1102
|
children: jsx(Text.Body, {
|
|
1103
1103
|
isBold: true,
|
|
1104
|
-
intlMessage: messages$
|
|
1104
|
+
intlMessage: messages$6.dataType
|
|
1105
1105
|
})
|
|
1106
1106
|
}), jsx(Grid.Item, {
|
|
1107
1107
|
children: jsx(ResourceTypeSelection, {})
|
|
1108
1108
|
}), jsx(Grid.Item, {
|
|
1109
1109
|
children: jsx(Text.Body, {
|
|
1110
1110
|
isBold: true,
|
|
1111
|
-
intlMessage: messages$
|
|
1111
|
+
intlMessage: messages$6.instructions
|
|
1112
1112
|
})
|
|
1113
1113
|
}), jsx(Grid.Item, {
|
|
1114
1114
|
children: jsx(Instructions, {})
|
|
1115
1115
|
})]
|
|
1116
|
-
}) : jsx(Instructions, {}), jsx(Masking.Mask, {
|
|
1116
|
+
}) : jsx(Instructions, {}), jsx(InfoBox, {}), jsx(Masking.Mask, {
|
|
1117
1117
|
children: jsx(FileDropArea, {})
|
|
1118
1118
|
})]
|
|
1119
1119
|
})
|
|
@@ -1121,7 +1121,7 @@ const Upload = () => {
|
|
|
1121
1121
|
});
|
|
1122
1122
|
};
|
|
1123
1123
|
|
|
1124
|
-
var messages$
|
|
1124
|
+
var messages$4 = defineMessages({
|
|
1125
1125
|
row: {
|
|
1126
1126
|
id: 'ImportResourcesModal.row',
|
|
1127
1127
|
description: 'In Upload file error modal - "Row" column',
|
|
@@ -1154,15 +1154,15 @@ var messages$3 = defineMessages({
|
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
1156
1156
|
|
|
1157
|
-
function ownKeys$
|
|
1158
|
-
function _objectSpread$
|
|
1157
|
+
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; }
|
|
1158
|
+
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
1159
|
const getColumns$1 = () => [{
|
|
1160
1160
|
key: 'errorType',
|
|
1161
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1161
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.errorType)),
|
|
1162
1162
|
width: 'max-content'
|
|
1163
1163
|
}, {
|
|
1164
1164
|
key: 'details',
|
|
1165
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1165
|
+
label: jsx(FormattedMessage, _objectSpread$a({}, messages$4.details))
|
|
1166
1166
|
}];
|
|
1167
1167
|
const UploadClientSideErrorTable = props => {
|
|
1168
1168
|
var _context;
|
|
@@ -1205,8 +1205,8 @@ function itemRenderer$1(item, column) {
|
|
|
1205
1205
|
}
|
|
1206
1206
|
}
|
|
1207
1207
|
|
|
1208
|
-
function ownKeys$
|
|
1209
|
-
function _objectSpread$
|
|
1208
|
+
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; }
|
|
1209
|
+
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
1210
|
const UploadClientSideErrorsModal = () => {
|
|
1211
1211
|
const intl = useIntl();
|
|
1212
1212
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1224,7 +1224,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1224
1224
|
scale: "l",
|
|
1225
1225
|
children: [jsx(Masking.Mask, {
|
|
1226
1226
|
children: jsx(Text.Body, {
|
|
1227
|
-
intlMessage: _objectSpread$
|
|
1227
|
+
intlMessage: _objectSpread$9(_objectSpread$9({}, messages$4.uploadingError), {}, {
|
|
1228
1228
|
values: {
|
|
1229
1229
|
fileName: state.droppedFile?.name,
|
|
1230
1230
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1242,7 +1242,7 @@ const UploadClientSideErrorsModal = () => {
|
|
|
1242
1242
|
onClick: () => onClose()
|
|
1243
1243
|
}), jsx(PrimaryButton, {
|
|
1244
1244
|
iconLeft: jsx(ImportIcon, {}),
|
|
1245
|
-
label: intl.formatMessage(messages$
|
|
1245
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1246
1246
|
onClick: () => actions.uploadNewFile()
|
|
1247
1247
|
})]
|
|
1248
1248
|
})]
|
|
@@ -1258,19 +1258,19 @@ function getBold$3(msg) {
|
|
|
1258
1258
|
});
|
|
1259
1259
|
}
|
|
1260
1260
|
|
|
1261
|
-
function ownKeys$
|
|
1262
|
-
function _objectSpread$
|
|
1261
|
+
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; }
|
|
1262
|
+
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
1263
|
const getColumns = () => [{
|
|
1264
1264
|
key: 'row',
|
|
1265
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1265
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.row)),
|
|
1266
1266
|
width: 'max-content'
|
|
1267
1267
|
}, {
|
|
1268
1268
|
key: 'errorType',
|
|
1269
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1269
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.errorType)),
|
|
1270
1270
|
width: 'max-content'
|
|
1271
1271
|
}, {
|
|
1272
1272
|
key: 'details',
|
|
1273
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1273
|
+
label: jsx(FormattedMessage, _objectSpread$8({}, messages$4.details))
|
|
1274
1274
|
}];
|
|
1275
1275
|
const UploadServerSideErrorTable = props => {
|
|
1276
1276
|
var _context;
|
|
@@ -1321,8 +1321,8 @@ function itemRenderer(item, column) {
|
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
1323
|
|
|
1324
|
-
function ownKeys$
|
|
1325
|
-
function _objectSpread$
|
|
1324
|
+
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; }
|
|
1325
|
+
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
1326
|
const UploadServerSideErrorsModal = () => {
|
|
1327
1327
|
const intl = useIntl();
|
|
1328
1328
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1343,7 +1343,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1343
1343
|
scale: "xs",
|
|
1344
1344
|
children: [jsx(Masking.Mask, {
|
|
1345
1345
|
children: jsx(Text.Body, {
|
|
1346
|
-
intlMessage: _objectSpread$
|
|
1346
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.uploadingError), {}, {
|
|
1347
1347
|
values: {
|
|
1348
1348
|
fileName: state.droppedFile?.name,
|
|
1349
1349
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1352,7 +1352,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1352
1352
|
})
|
|
1353
1353
|
})
|
|
1354
1354
|
}), jsx(Text.Body, {
|
|
1355
|
-
intlMessage: _objectSpread$
|
|
1355
|
+
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$4.supportedValuesDocumentation), {}, {
|
|
1356
1356
|
values: {
|
|
1357
1357
|
documentationLink: msg => jsx(Link, {
|
|
1358
1358
|
tone: "secondary",
|
|
@@ -1373,7 +1373,7 @@ const UploadServerSideErrorsModal = () => {
|
|
|
1373
1373
|
onClick: () => onClose()
|
|
1374
1374
|
}), jsx(PrimaryButton, {
|
|
1375
1375
|
iconLeft: jsx(ImportIcon, {}),
|
|
1376
|
-
label: intl.formatMessage(messages$
|
|
1376
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1377
1377
|
onClick: () => actions.uploadNewFile()
|
|
1378
1378
|
})]
|
|
1379
1379
|
})]
|
|
@@ -1389,7 +1389,7 @@ function getBold$2(msg) {
|
|
|
1389
1389
|
});
|
|
1390
1390
|
}
|
|
1391
1391
|
|
|
1392
|
-
var messages$
|
|
1392
|
+
var messages$3 = defineMessages({
|
|
1393
1393
|
startImportButton: {
|
|
1394
1394
|
id: 'ImportResourcesModal.startImportButton',
|
|
1395
1395
|
description: 'Label for the modal Start import button',
|
|
@@ -1472,8 +1472,8 @@ var messages$2 = defineMessages({
|
|
|
1472
1472
|
}
|
|
1473
1473
|
});
|
|
1474
1474
|
|
|
1475
|
-
function ownKeys$
|
|
1476
|
-
function _objectSpread$
|
|
1475
|
+
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; }
|
|
1476
|
+
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
1477
|
const truncate = (isExpanded, columns, columnsCount) => {
|
|
1478
1478
|
return isExpanded ? columns.join(' | ') : _sliceInstanceProperty(columns).call(columns, 0, columnsCount).join(' | ') + (columns.length > columnsCount ? '...' : '');
|
|
1479
1479
|
};
|
|
@@ -1502,7 +1502,7 @@ const ColumnList = props => {
|
|
|
1502
1502
|
e.preventDefault();
|
|
1503
1503
|
setIsExpanded(!isExpanded);
|
|
1504
1504
|
},
|
|
1505
|
-
children: isExpanded ? jsx(FormattedMessage, _objectSpread$
|
|
1505
|
+
children: isExpanded ? jsx(FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1506
1506
|
})
|
|
1507
1507
|
})]
|
|
1508
1508
|
})
|
|
@@ -1510,8 +1510,8 @@ const ColumnList = props => {
|
|
|
1510
1510
|
});
|
|
1511
1511
|
};
|
|
1512
1512
|
|
|
1513
|
-
function ownKeys$
|
|
1514
|
-
function _objectSpread$
|
|
1513
|
+
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; }
|
|
1514
|
+
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
1515
|
function UploadPreviewModal() {
|
|
1516
1516
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1517
1517
|
state = _useImportResourcesCo.state;
|
|
@@ -1526,7 +1526,7 @@ function UploadPreviewModal() {
|
|
|
1526
1526
|
size: 16,
|
|
1527
1527
|
isOpen: true,
|
|
1528
1528
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1529
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1529
|
+
labelPrimary: intl.formatMessage(messages$3.continue),
|
|
1530
1530
|
onSecondaryButtonClick: () => onClose({
|
|
1531
1531
|
shouldDeleteImportContainer: true
|
|
1532
1532
|
}),
|
|
@@ -1545,7 +1545,7 @@ function UploadPreviewModal() {
|
|
|
1545
1545
|
children: jsxs(Spacings.Stack, {
|
|
1546
1546
|
scale: "m",
|
|
1547
1547
|
children: [jsx("div", {}), jsx(Text.Body, {
|
|
1548
|
-
intlMessage: messages$
|
|
1548
|
+
intlMessage: messages$3.previewOfYourImport
|
|
1549
1549
|
}), jsx(Card, {
|
|
1550
1550
|
insetScale: "xl",
|
|
1551
1551
|
children: jsxs(Spacings.Stack, {
|
|
@@ -1555,7 +1555,7 @@ function UploadPreviewModal() {
|
|
|
1555
1555
|
children: [jsx(CheckBoldIcon, {
|
|
1556
1556
|
color: "success"
|
|
1557
1557
|
}), jsx(Text.Body, {
|
|
1558
|
-
intlMessage: _objectSpread$
|
|
1558
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
|
|
1559
1559
|
values: {
|
|
1560
1560
|
rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
|
|
1561
1561
|
b: getBold$1
|
|
@@ -1567,7 +1567,7 @@ function UploadPreviewModal() {
|
|
|
1567
1567
|
children: [jsx(CheckBoldIcon, {
|
|
1568
1568
|
color: "success"
|
|
1569
1569
|
}), jsx(Text.Body, {
|
|
1570
|
-
intlMessage: _objectSpread$
|
|
1570
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeImported), {}, {
|
|
1571
1571
|
values: {
|
|
1572
1572
|
columnCount: intl.formatNumber(validatedColumns.length),
|
|
1573
1573
|
b: getBold$1
|
|
@@ -1587,7 +1587,7 @@ function UploadPreviewModal() {
|
|
|
1587
1587
|
children: [jsx(EyeCrossedIcon, {
|
|
1588
1588
|
color: "neutral60"
|
|
1589
1589
|
}), jsx(Text.Body, {
|
|
1590
|
-
intlMessage: _objectSpread$
|
|
1590
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeIgnored), {}, {
|
|
1591
1591
|
values: {
|
|
1592
1592
|
columnCount: intl.formatNumber(ignoredColumns.length),
|
|
1593
1593
|
b: getBold$1
|
|
@@ -1614,8 +1614,8 @@ function getBold$1(msg) {
|
|
|
1614
1614
|
});
|
|
1615
1615
|
}
|
|
1616
1616
|
|
|
1617
|
-
function ownKeys$
|
|
1618
|
-
function _objectSpread$
|
|
1617
|
+
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; }
|
|
1618
|
+
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
1619
|
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
1620
|
const getNewLine = () => jsx("br", {});
|
|
1621
1621
|
const getImportLogsLink = (msg, projectKey) => jsx(Link, {
|
|
@@ -1634,7 +1634,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
1634
1634
|
const ImportRunningTextNotification = props => jsx("div", {
|
|
1635
1635
|
css: _ref2,
|
|
1636
1636
|
children: jsx(Text.Body, {
|
|
1637
|
-
intlMessage: _objectSpread$
|
|
1637
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.importNotificationSuccessMessage), {}, {
|
|
1638
1638
|
values: {
|
|
1639
1639
|
newline: getNewLine,
|
|
1640
1640
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1655,7 +1655,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
1655
1655
|
const ImportPreparingTextNotification = props => jsx("div", {
|
|
1656
1656
|
css: _ref,
|
|
1657
1657
|
children: jsx(Text.Body, {
|
|
1658
|
-
intlMessage: _objectSpread$
|
|
1658
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.importNotificationPrepareMessage), {}, {
|
|
1659
1659
|
values: {
|
|
1660
1660
|
newline: getNewLine,
|
|
1661
1661
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1680,7 +1680,7 @@ const ImportConfirmationModal = () => {
|
|
|
1680
1680
|
const showNotification = useShowNotification();
|
|
1681
1681
|
return jsx(ConfirmationDialog, {
|
|
1682
1682
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1683
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1683
|
+
labelPrimary: intl.formatMessage(messages$3.startImportButton),
|
|
1684
1684
|
isOpen: true,
|
|
1685
1685
|
onClose: () => onClose({
|
|
1686
1686
|
shouldDeleteImportContainer: true
|
|
@@ -1743,7 +1743,7 @@ const ImportConfirmationModal = () => {
|
|
|
1743
1743
|
scale: "xl",
|
|
1744
1744
|
children: [jsxs("div", {
|
|
1745
1745
|
children: [jsx(Text.Body, {
|
|
1746
|
-
intlMessage: _objectSpread$
|
|
1746
|
+
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$3.confirmationBodyText), {}, {
|
|
1747
1747
|
values: {
|
|
1748
1748
|
projectName: projectName,
|
|
1749
1749
|
count: intl.formatNumber(state?.uploadFileResponse?.rowsCount || 0),
|
|
@@ -1751,10 +1751,10 @@ const ImportConfirmationModal = () => {
|
|
|
1751
1751
|
}
|
|
1752
1752
|
})
|
|
1753
1753
|
}), jsx(Text.Body, {
|
|
1754
|
-
intlMessage: messages$
|
|
1754
|
+
intlMessage: messages$3.confirmationBodyNote
|
|
1755
1755
|
})]
|
|
1756
1756
|
}), jsx(Text.Body, {
|
|
1757
|
-
intlMessage: messages$
|
|
1757
|
+
intlMessage: messages$3.confirmationBodyQuestion
|
|
1758
1758
|
})]
|
|
1759
1759
|
})
|
|
1760
1760
|
})
|
|
@@ -1776,10 +1776,10 @@ const UploadResult = () => {
|
|
|
1776
1776
|
return jsx(UploadPreviewModal, {});
|
|
1777
1777
|
};
|
|
1778
1778
|
|
|
1779
|
-
function ownKeys$
|
|
1780
|
-
function _objectSpread$
|
|
1779
|
+
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; }
|
|
1780
|
+
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
1781
|
var FileIcon = function FileIcon(props) {
|
|
1782
|
-
return jsxs("svg", _objectSpread$
|
|
1782
|
+
return jsxs("svg", _objectSpread$3(_objectSpread$3({}, props), {}, {
|
|
1783
1783
|
children: [jsx("mask", {
|
|
1784
1784
|
id: "a",
|
|
1785
1785
|
style: {
|
|
@@ -1873,7 +1873,7 @@ const CurrentStep = () => {
|
|
|
1873
1873
|
return steps[state.currentStep] || null;
|
|
1874
1874
|
};
|
|
1875
1875
|
|
|
1876
|
-
var messages$
|
|
1876
|
+
var messages$2 = defineMessages({
|
|
1877
1877
|
products: {
|
|
1878
1878
|
id: 'ImportResourcesModal.radio.products',
|
|
1879
1879
|
description: 'Label for the products radio button',
|
|
@@ -1894,11 +1894,11 @@ var messages$1 = defineMessages({
|
|
|
1894
1894
|
const resourceTypeToDisplayName = resourceType => {
|
|
1895
1895
|
switch (resourceType) {
|
|
1896
1896
|
case IMPORTABLE_RESOURCES.PRODUCT:
|
|
1897
|
-
return messages$
|
|
1897
|
+
return messages$2.products;
|
|
1898
1898
|
case IMPORTABLE_RESOURCES.INVENTORY:
|
|
1899
|
-
return messages$
|
|
1899
|
+
return messages$2.inventories;
|
|
1900
1900
|
case IMPORTABLE_RESOURCES.CATEGORY:
|
|
1901
|
-
return messages$
|
|
1901
|
+
return messages$2.categories;
|
|
1902
1902
|
default:
|
|
1903
1903
|
throw new Error(`Unknown resource type: ${resourceType}`);
|
|
1904
1904
|
}
|
|
@@ -1926,7 +1926,7 @@ const ResourceTypeSelection = () => {
|
|
|
1926
1926
|
});
|
|
1927
1927
|
};
|
|
1928
1928
|
|
|
1929
|
-
var messages = defineMessages({
|
|
1929
|
+
var messages$1 = defineMessages({
|
|
1930
1930
|
fileUploadInstructions: {
|
|
1931
1931
|
id: 'ImportResourcesModal.fileUploadInstructions',
|
|
1932
1932
|
description: 'Label for the modal category description',
|
|
@@ -1934,8 +1934,8 @@ var messages = defineMessages({
|
|
|
1934
1934
|
}
|
|
1935
1935
|
});
|
|
1936
1936
|
|
|
1937
|
-
function ownKeys$
|
|
1938
|
-
function _objectSpread$
|
|
1937
|
+
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; }
|
|
1938
|
+
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
1939
|
const Instructions = () => {
|
|
1940
1940
|
const intl = useIntl();
|
|
1941
1941
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1943,7 +1943,7 @@ const Instructions = () => {
|
|
|
1943
1943
|
const templateLink = RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS[state.resourceType];
|
|
1944
1944
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
1945
1945
|
return jsx(Text.Body, {
|
|
1946
|
-
intlMessage: _objectSpread$
|
|
1946
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$1.fileUploadInstructions), {}, {
|
|
1947
1947
|
values: {
|
|
1948
1948
|
fileSize: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType]),
|
|
1949
1949
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType]),
|
|
@@ -1964,13 +1964,58 @@ const Instructions = () => {
|
|
|
1964
1964
|
});
|
|
1965
1965
|
};
|
|
1966
1966
|
|
|
1967
|
+
var messages = defineMessages({
|
|
1968
|
+
prerequisitesOfImportingData: {
|
|
1969
|
+
id: 'ImportResourcesModal.infoBox.prerequisitesOfImportingData',
|
|
1970
|
+
description: 'A message to guide users to check the prerequisites of importing data',
|
|
1971
|
+
defaultMessage: 'Prerequisites of importing data'
|
|
1972
|
+
},
|
|
1973
|
+
keysForEveryResource: {
|
|
1974
|
+
id: 'ImportResourcesModal.infoBox.keysForEveryResource',
|
|
1975
|
+
description: 'A message to guide users to provide keys for every resource they import',
|
|
1976
|
+
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>.'
|
|
1977
|
+
}
|
|
1978
|
+
});
|
|
1979
|
+
|
|
1980
|
+
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; }
|
|
1981
|
+
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; }
|
|
1982
|
+
const InfoBox = () => {
|
|
1983
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1984
|
+
state = _useImportResourcesCo.state;
|
|
1985
|
+
if (!state.resourceType) return null;
|
|
1986
|
+
return jsx(ContentNotification, {
|
|
1987
|
+
type: "info",
|
|
1988
|
+
children: jsx(Spacings.Inset, {
|
|
1989
|
+
scale: "xs",
|
|
1990
|
+
children: jsxs(Spacings.Stack, {
|
|
1991
|
+
scale: "xs",
|
|
1992
|
+
children: [jsx(Text.Subheadline, {
|
|
1993
|
+
as: "h4",
|
|
1994
|
+
intlMessage: messages.prerequisitesOfImportingData
|
|
1995
|
+
}), jsx(Text.Body, {
|
|
1996
|
+
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.keysForEveryResource), {}, {
|
|
1997
|
+
values: {
|
|
1998
|
+
link: msg => jsx(Link, {
|
|
1999
|
+
tone: "secondary",
|
|
2000
|
+
isExternal: true,
|
|
2001
|
+
to: CT__API_DOCS_URL,
|
|
2002
|
+
children: msg
|
|
2003
|
+
})
|
|
2004
|
+
}
|
|
2005
|
+
})
|
|
2006
|
+
})]
|
|
2007
|
+
})
|
|
2008
|
+
})
|
|
2009
|
+
});
|
|
2010
|
+
};
|
|
2011
|
+
|
|
1967
2012
|
const getChunkImport = locale => {
|
|
1968
2013
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
1969
2014
|
switch (intlLocale) {
|
|
1970
2015
|
case 'de':
|
|
1971
2016
|
return import(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-cd6c45d3.esm.js');
|
|
1972
2017
|
case 'es':
|
|
1973
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2018
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-4cfa2244.esm.js');
|
|
1974
2019
|
case 'fr-FR':
|
|
1975
2020
|
return import(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-9d9081ee.esm.js');
|
|
1976
2021
|
case 'zh-CN':
|
|
@@ -2060,4 +2105,4 @@ const ImportResourcesModal = props => {
|
|
|
2060
2105
|
};
|
|
2061
2106
|
ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
2062
2107
|
|
|
2063
|
-
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, messages$
|
|
2108
|
+
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, messages$6 as m, useImportResourcesContext as u };
|