@commercetools-frontend-extensions/import-resources-modal 1.3.19 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{active-drag-drop-area-9667523a.esm.js → active-drag-drop-area-02862be1.esm.js} +1 -1
- package/dist/{active-drag-drop-area-f7b82691.cjs.prod.js → active-drag-drop-area-3353cf7c.cjs.prod.js} +1 -1
- package/dist/{active-drag-drop-area-af12a9b1.cjs.dev.js → active-drag-drop-area-9097bdc0.cjs.dev.js} +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +2 -2
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +2 -2
- package/dist/de-22a8eb66.cjs.prod.js +246 -0
- package/dist/de-3d74f145.esm.js +244 -0
- package/dist/de-fd3b70e4.cjs.dev.js +246 -0
- package/dist/declarations/src/@types/import-container.d.ts +14 -0
- package/dist/en-0b96b221.cjs.dev.js +246 -0
- package/dist/en-8d84a827.cjs.prod.js +246 -0
- package/dist/en-bfc8cfec.esm.js +244 -0
- package/dist/{enabled-drop-area-93e90a7a.cjs.prod.js → enabled-drop-area-71390280.cjs.prod.js} +1 -1
- package/dist/{enabled-drop-area-e2c28a9e.esm.js → enabled-drop-area-cecad6d0.esm.js} +1 -1
- package/dist/{enabled-drop-area-ed0fd3ba.cjs.dev.js → enabled-drop-area-dff17a22.cjs.dev.js} +1 -1
- package/dist/{es-9821e666.cjs.prod.js → es-01b24cea.cjs.prod.js} +9 -9
- package/dist/{es-c6b4310c.esm.js → es-561e774f.esm.js} +9 -9
- package/dist/{es-c3c63de8.cjs.dev.js → es-a45120de.cjs.dev.js} +9 -9
- package/dist/{file-dropped-area-16894986.cjs.prod.js → file-dropped-area-30e0efb8.cjs.prod.js} +9 -9
- package/dist/{file-dropped-area-8a8a3de8.esm.js → file-dropped-area-70859cc8.esm.js} +9 -9
- package/dist/{file-dropped-area-b3ce24a7.cjs.dev.js → file-dropped-area-85c3b3a4.cjs.dev.js} +9 -9
- package/dist/fr-FR-1c33adf1.esm.js +244 -0
- package/dist/fr-FR-2a0f5518.cjs.prod.js +246 -0
- package/dist/fr-FR-d51f6a8e.cjs.dev.js +246 -0
- package/dist/{index-0bd38b3d.cjs.dev.js → index-120dc76b.cjs.dev.js} +214 -129
- package/dist/{index-02b35395.cjs.prod.js → index-169848a9.cjs.prod.js} +199 -128
- package/dist/{index-62b39c5f.esm.js → index-fd6bbcc5.esm.js} +215 -130
- package/dist/pt-BR-6b7a389e.cjs.prod.js +246 -0
- package/dist/pt-BR-8b999c2f.cjs.dev.js +246 -0
- package/dist/pt-BR-c09d735f.esm.js +244 -0
- package/package.json +16 -15
- package/dist/de-a34c5dd4.cjs.dev.js +0 -6
- package/dist/de-cd6c45d3.esm.js +0 -4
- package/dist/de-d954fe3d.cjs.prod.js +0 -6
- package/dist/en-3a9aa2d4.esm.js +0 -4
- package/dist/en-6b3694f6.cjs.dev.js +0 -6
- package/dist/en-c7757448.cjs.prod.js +0 -6
- package/dist/fr-FR-9d9081ee.esm.js +0 -4
- package/dist/fr-FR-e7126fcc.cjs.dev.js +0 -6
- package/dist/fr-FR-fce1ca96.cjs.prod.js +0 -6
- package/dist/pt-BR-b37d730b.esm.js +0 -4
- package/dist/pt-BR-ea6b3251.cjs.dev.js +0 -6
- package/dist/pt-BR-ec2a1a11.cjs.prod.js +0 -6
|
@@ -39,7 +39,7 @@ import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
|
39
39
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
40
40
|
import { FormDialog, InfoDialog, PageContentNarrow, ConfirmationDialog } from '@commercetools-frontend/application-components';
|
|
41
41
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
42
|
-
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
|
+
import { customProperties, Constraints, CheckboxInput, Spacings, Grid, designTokens, Text, usePaginationState, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, Link, TagList, Card, CheckBoldIcon, EyeCrossedIcon, ProgressBar, RadioInput, ContentNotification } from '@commercetools-frontend/ui-kit';
|
|
43
43
|
import _someInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/some';
|
|
44
44
|
import { useDropzone } from 'react-dropzone';
|
|
45
45
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
@@ -50,23 +50,26 @@ import { useIsAuthorized } from '@commercetools-frontend/permissions';
|
|
|
50
50
|
import DataTable from '@commercetools-uikit/data-table';
|
|
51
51
|
import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
|
|
52
52
|
|
|
53
|
-
function ownKeys$
|
|
54
|
-
function _objectSpread$
|
|
53
|
+
function ownKeys$i(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; }
|
|
54
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$i(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$i(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
55
|
+
// TODO: make this resource type specific
|
|
56
|
+
|
|
55
57
|
function reducer(state, action) {
|
|
56
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
58
|
+
if (action.type === 'setCurrentStep') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
57
59
|
currentStep: action.currentStep,
|
|
58
60
|
progress: 0
|
|
59
61
|
});
|
|
60
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
62
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
61
63
|
uploadFileResponse: action.uploadFileResponse
|
|
62
64
|
});
|
|
63
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
65
|
+
if (action.type === 'setResourceType') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
66
|
+
settings: undefined,
|
|
64
67
|
resourceType: action.resourceType
|
|
65
68
|
});
|
|
66
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
69
|
+
if (action.type === 'setContainerKey') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
67
70
|
containerKey: action.containerKey
|
|
68
71
|
});
|
|
69
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
72
|
+
if (action.type === 'cancelImport') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
70
73
|
currentStep: 1,
|
|
71
74
|
containerKey: undefined,
|
|
72
75
|
fileUploadErrors: [],
|
|
@@ -75,7 +78,7 @@ function reducer(state, action) {
|
|
|
75
78
|
dropAreaState: 'disabled',
|
|
76
79
|
progress: 0
|
|
77
80
|
});
|
|
78
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
81
|
+
if (action.type === 'uploadNewFile') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
79
82
|
currentStep: 1,
|
|
80
83
|
containerKey: undefined,
|
|
81
84
|
fileUploadErrors: [],
|
|
@@ -85,25 +88,30 @@ function reducer(state, action) {
|
|
|
85
88
|
progress: 0
|
|
86
89
|
});
|
|
87
90
|
if (action.type === 'setDroppedFile') {
|
|
88
|
-
return _objectSpread$
|
|
91
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
89
92
|
droppedFile: action.droppedFile
|
|
90
93
|
});
|
|
91
94
|
}
|
|
92
95
|
if (action.type === 'setFileUploadErrors') {
|
|
93
|
-
return _objectSpread$
|
|
96
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
94
97
|
fileUploadErrors: action.fileUploadErrors
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
if (action.type === 'setAbortController') {
|
|
98
|
-
return _objectSpread$
|
|
101
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
99
102
|
abortController: action.abortController
|
|
100
103
|
});
|
|
101
104
|
}
|
|
102
105
|
if (action.type === 'setProgress') {
|
|
103
|
-
return _objectSpread$
|
|
106
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
104
107
|
progress: action.progress
|
|
105
108
|
});
|
|
106
109
|
}
|
|
110
|
+
if (action.type === 'setUploadSettings') {
|
|
111
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
112
|
+
settings: _objectSpread$i(_objectSpread$i({}, state.settings), action.settings)
|
|
113
|
+
});
|
|
114
|
+
}
|
|
107
115
|
throw new Error(getUnknownActionError(action));
|
|
108
116
|
}
|
|
109
117
|
function getUnknownActionError(actionType) {
|
|
@@ -166,8 +174,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
166
174
|
return _createClass(HttpError);
|
|
167
175
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
168
176
|
|
|
169
|
-
function ownKeys$
|
|
170
|
-
function _objectSpread$
|
|
177
|
+
function ownKeys$h(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; }
|
|
178
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$h(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$h(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
171
179
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
172
180
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
173
181
|
};
|
|
@@ -179,7 +187,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
179
187
|
onSuccess = _ref2.onSuccess,
|
|
180
188
|
onError = _ref2.onError;
|
|
181
189
|
const options = createHttpClientOptions({
|
|
182
|
-
headers: _objectSpread$
|
|
190
|
+
headers: _objectSpread$h({
|
|
183
191
|
'Content-Type': 'application/json'
|
|
184
192
|
}, config?.headers)
|
|
185
193
|
});
|
|
@@ -296,9 +304,25 @@ const PERMISSIONS = {
|
|
|
296
304
|
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
297
305
|
ViewDiscountCodes: 'ViewDiscountCodes'
|
|
298
306
|
};
|
|
307
|
+
const ACTION_RIGHTS = {
|
|
308
|
+
PublishProducts: {
|
|
309
|
+
group: 'products',
|
|
310
|
+
name: 'PublishProducts'
|
|
311
|
+
},
|
|
312
|
+
UnpublishProducts: {
|
|
313
|
+
group: 'products',
|
|
314
|
+
name: 'UnpublishProducts'
|
|
315
|
+
}
|
|
316
|
+
};
|
|
299
317
|
|
|
300
|
-
function ownKeys$
|
|
301
|
-
function _objectSpread$
|
|
318
|
+
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; }
|
|
319
|
+
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; }
|
|
320
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
321
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
322
|
+
_objectSpread$g(_objectSpread$g({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
323
|
+
|
|
324
|
+
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; }
|
|
325
|
+
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; }
|
|
302
326
|
/**
|
|
303
327
|
* This function checks if the provided `expectedDelimiter` is used consistently in the first 10 lines of a CSV file.
|
|
304
328
|
* Returns a Promise that resolves to an object containing a boolean `isValid` property and the detected delimiter `delimiter`.
|
|
@@ -353,7 +377,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
353
377
|
};
|
|
354
378
|
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
355
379
|
let idCounter = 1;
|
|
356
|
-
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$
|
|
380
|
+
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$f(_objectSpread$f({}, uploadFileError), {}, {
|
|
357
381
|
id: String(idCounter++)
|
|
358
382
|
}));
|
|
359
383
|
};
|
|
@@ -498,8 +522,6 @@ function uploadFileForImport(_ref) {
|
|
|
498
522
|
});
|
|
499
523
|
}
|
|
500
524
|
|
|
501
|
-
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; }
|
|
502
|
-
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; }
|
|
503
525
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
504
526
|
return asyncDispatch(actions.post({
|
|
505
527
|
mcApiProxyTarget: MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -508,9 +530,7 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
508
530
|
accept: 'application/json',
|
|
509
531
|
'Content-Type': 'application/json'
|
|
510
532
|
},
|
|
511
|
-
payload: _JSON$stringify(
|
|
512
|
-
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
513
|
-
}))
|
|
533
|
+
payload: _JSON$stringify(importContainerDraft)
|
|
514
534
|
}));
|
|
515
535
|
}
|
|
516
536
|
function deleteImportContainer(projectKey, containerKey, asyncDispatch) {
|
|
@@ -547,8 +567,8 @@ function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
|
547
567
|
throw new Error('Invalid response');
|
|
548
568
|
}
|
|
549
569
|
|
|
550
|
-
function ownKeys$
|
|
551
|
-
function _objectSpread$
|
|
570
|
+
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; }
|
|
571
|
+
function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$e(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$e(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
552
572
|
const ImportResourcesContext = /*#__PURE__*/React.createContext();
|
|
553
573
|
const ImportResourcesProvider = props => {
|
|
554
574
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
@@ -556,7 +576,7 @@ const ImportResourcesProvider = props => {
|
|
|
556
576
|
})),
|
|
557
577
|
projectKey = _useApplicationContex.projectKey;
|
|
558
578
|
const asyncDispatch = useAsyncDispatch();
|
|
559
|
-
const _React$useReducer = React.useReducer(reducer, _objectSpread$
|
|
579
|
+
const _React$useReducer = React.useReducer(reducer, _objectSpread$e(_objectSpread$e({}, initialState), {}, {
|
|
560
580
|
resourceType: props.resourceTypes[0]
|
|
561
581
|
})),
|
|
562
582
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -600,6 +620,12 @@ const ImportResourcesProvider = props => {
|
|
|
600
620
|
type: 'setProgress',
|
|
601
621
|
progress
|
|
602
622
|
});
|
|
623
|
+
const setUploadSettings = nextSettings => {
|
|
624
|
+
dispatch({
|
|
625
|
+
type: 'setUploadSettings',
|
|
626
|
+
settings: nextSettings
|
|
627
|
+
});
|
|
628
|
+
};
|
|
603
629
|
const handleClose = function () {
|
|
604
630
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
605
631
|
shouldDeleteImportContainer = _ref.shouldDeleteImportContainer;
|
|
@@ -627,7 +653,8 @@ const ImportResourcesProvider = props => {
|
|
|
627
653
|
setContainerKey,
|
|
628
654
|
setAbortController,
|
|
629
655
|
setFileUploadErrors,
|
|
630
|
-
setProgress
|
|
656
|
+
setProgress,
|
|
657
|
+
setUploadSettings
|
|
631
658
|
}
|
|
632
659
|
},
|
|
633
660
|
children: props.children
|
|
@@ -689,13 +716,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
689
716
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5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lcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
690
717
|
}
|
|
691
718
|
|
|
692
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
719
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-02862be1.esm.js' /* webpackChunkName: "active-drag-drop-area" */));
|
|
693
720
|
|
|
694
721
|
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-2c088477.esm.js' /* webpackChunkName: "disabled-drop-area" */));
|
|
695
722
|
|
|
696
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
723
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-cecad6d0.esm.js' /* webpackChunkName: "enabled-drop-area" */));
|
|
697
724
|
|
|
698
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
725
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-70859cc8.esm.js' /* webpackChunkName: "filed-dropped-area" */));
|
|
699
726
|
|
|
700
727
|
function getDropArea(_ref) {
|
|
701
728
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -733,7 +760,7 @@ function getDropAreaState(flags) {
|
|
|
733
760
|
return 'ready-for-drop';
|
|
734
761
|
}
|
|
735
762
|
|
|
736
|
-
var messages$
|
|
763
|
+
var messages$7 = defineMessages({
|
|
737
764
|
dragAndDropCSV: {
|
|
738
765
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
739
766
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -798,7 +825,7 @@ function useImportResourcesContext() {
|
|
|
798
825
|
return context;
|
|
799
826
|
}
|
|
800
827
|
|
|
801
|
-
var messages$
|
|
828
|
+
var messages$6 = defineMessages({
|
|
802
829
|
fileSizeExceededTitle: {
|
|
803
830
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
804
831
|
defaultMessage: 'File size exceeded'
|
|
@@ -858,6 +885,8 @@ var messages$5 = defineMessages({
|
|
|
858
885
|
}
|
|
859
886
|
});
|
|
860
887
|
|
|
888
|
+
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; }
|
|
889
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$d(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$d(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
861
890
|
const useUpload = () => {
|
|
862
891
|
const intl = useIntl();
|
|
863
892
|
const projectKey = useApplicationContext(context => context.project?.key);
|
|
@@ -875,23 +904,23 @@ const useUpload = () => {
|
|
|
875
904
|
const errors = [];
|
|
876
905
|
const delimiterCheck = await checkDelimiter(file);
|
|
877
906
|
if (!delimiterCheck.isValid) errors.push({
|
|
878
|
-
title: intl.formatMessage(messages$
|
|
879
|
-
description: intl.formatMessage(messages$
|
|
907
|
+
title: intl.formatMessage(messages$6.dropAreaWrongDelimiterTitle),
|
|
908
|
+
description: intl.formatMessage(messages$6.dropAreaWrongDelimiterDescription)
|
|
880
909
|
});
|
|
881
910
|
const rowCount = await getRowCount(file);
|
|
882
911
|
if (rowCount < 1) errors.push({
|
|
883
|
-
title: intl.formatMessage(messages$
|
|
884
|
-
description: intl.formatMessage(messages$
|
|
912
|
+
title: intl.formatMessage(messages$6.dropAreaNotEnoughRowsTitle),
|
|
913
|
+
description: intl.formatMessage(messages$6.dropAreaNotEnoughRowsDescription)
|
|
885
914
|
});
|
|
886
915
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
887
|
-
title: intl.formatMessage(messages$
|
|
888
|
-
description: intl.formatMessage(messages$
|
|
916
|
+
title: intl.formatMessage(messages$6.fileSizeExceededTitle),
|
|
917
|
+
description: intl.formatMessage(messages$6.fileSizeExceededDescription, {
|
|
889
918
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
890
919
|
})
|
|
891
920
|
});
|
|
892
921
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
893
|
-
title: intl.formatMessage(messages$
|
|
894
|
-
description: intl.formatMessage(messages$
|
|
922
|
+
title: intl.formatMessage(messages$6.rowLimitExceededTitle),
|
|
923
|
+
description: intl.formatMessage(messages$6.rowLimitExceededDescription, {
|
|
895
924
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
896
925
|
})
|
|
897
926
|
});
|
|
@@ -910,16 +939,16 @@ const useUpload = () => {
|
|
|
910
939
|
if (error instanceof HttpError) {
|
|
911
940
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
912
941
|
actions.setFileUploadErrors([{
|
|
913
|
-
title: intl.formatMessage(messages$
|
|
914
|
-
description: intl.formatMessage(messages$
|
|
942
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
943
|
+
description: intl.formatMessage(messages$6.missingKeyError)
|
|
915
944
|
}]);
|
|
916
945
|
actions.setCurrentStep(3);
|
|
917
946
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
918
947
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
919
948
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
920
949
|
actions.setFileUploadErrors([{
|
|
921
|
-
title: intl.formatMessage(messages$
|
|
922
|
-
description: intl.formatMessage(messages$
|
|
950
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
951
|
+
description: intl.formatMessage(messages$6.missingRequiredKeys, {
|
|
923
952
|
fieldNames
|
|
924
953
|
})
|
|
925
954
|
}]);
|
|
@@ -932,7 +961,7 @@ const useUpload = () => {
|
|
|
932
961
|
showNotification({
|
|
933
962
|
kind: 'error',
|
|
934
963
|
domain: DOMAINS.PAGE,
|
|
935
|
-
text: intl.formatMessage(messages$
|
|
964
|
+
text: intl.formatMessage(messages$6.unexpectedError)
|
|
936
965
|
});
|
|
937
966
|
}
|
|
938
967
|
} else {
|
|
@@ -961,10 +990,21 @@ const useUpload = () => {
|
|
|
961
990
|
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
962
991
|
actions.setContainerKey(containerKey);
|
|
963
992
|
try {
|
|
964
|
-
|
|
993
|
+
// TODO: Temporarily apply settings only for products
|
|
994
|
+
const shouldApplySettings = state.resourceType === 'product';
|
|
995
|
+
await createImportContainerForFileUpload(_objectSpread$d({
|
|
965
996
|
key: containerKey,
|
|
966
|
-
resourceType: state.resourceType
|
|
967
|
-
|
|
997
|
+
resourceType: state.resourceType,
|
|
998
|
+
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
999
|
+
}, shouldApplySettings ? {
|
|
1000
|
+
settings: {
|
|
1001
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1002
|
+
format: 'CSV',
|
|
1003
|
+
options: {
|
|
1004
|
+
publishAllChanges: state.settings?.publish ?? false
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
} : {}), projectKey, asyncDispatch);
|
|
968
1008
|
const newAbortController = uploadFileForImport({
|
|
969
1009
|
projectKey,
|
|
970
1010
|
containerKey,
|
|
@@ -1025,8 +1065,8 @@ const useImportPermission = () => {
|
|
|
1025
1065
|
};
|
|
1026
1066
|
};
|
|
1027
1067
|
|
|
1028
|
-
function ownKeys$
|
|
1029
|
-
function _objectSpread$
|
|
1068
|
+
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; }
|
|
1069
|
+
function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys$c(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$c(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1030
1070
|
const FileDropArea = () => {
|
|
1031
1071
|
const intl = useIntl();
|
|
1032
1072
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1056,7 +1096,7 @@ const FileDropArea = () => {
|
|
|
1056
1096
|
showNotification({
|
|
1057
1097
|
kind: 'error',
|
|
1058
1098
|
domain: DOMAINS.PAGE,
|
|
1059
|
-
text: intl.formatMessage(messages$
|
|
1099
|
+
text: intl.formatMessage(messages$7.tooManyFilesError)
|
|
1060
1100
|
});
|
|
1061
1101
|
return;
|
|
1062
1102
|
}
|
|
@@ -1064,13 +1104,13 @@ const FileDropArea = () => {
|
|
|
1064
1104
|
showNotification({
|
|
1065
1105
|
kind: 'error',
|
|
1066
1106
|
domain: DOMAINS.PAGE,
|
|
1067
|
-
text: intl.formatMessage(messages$
|
|
1107
|
+
text: intl.formatMessage(messages$7.fileFormatNotSupported)
|
|
1068
1108
|
});
|
|
1069
1109
|
} else {
|
|
1070
1110
|
showNotification({
|
|
1071
1111
|
kind: 'error',
|
|
1072
1112
|
domain: DOMAINS.PAGE,
|
|
1073
|
-
text: intl.formatMessage(messages$
|
|
1113
|
+
text: intl.formatMessage(messages$7.genericError)
|
|
1074
1114
|
});
|
|
1075
1115
|
}
|
|
1076
1116
|
}
|
|
@@ -1088,11 +1128,11 @@ const FileDropArea = () => {
|
|
|
1088
1128
|
resourceType: 'category',
|
|
1089
1129
|
isFileDropped: Boolean(state.droppedFile)
|
|
1090
1130
|
});
|
|
1091
|
-
return jsxs(DropWrapper, _objectSpread$
|
|
1131
|
+
return jsxs(DropWrapper, _objectSpread$c(_objectSpread$c({
|
|
1092
1132
|
role: "presentation"
|
|
1093
1133
|
}, getRootProps()), {}, {
|
|
1094
1134
|
dropAreaState: dropAreaState,
|
|
1095
|
-
children: [jsx("input", _objectSpread$
|
|
1135
|
+
children: [jsx("input", _objectSpread$c({
|
|
1096
1136
|
"data-testid": "file-input"
|
|
1097
1137
|
}, getInputProps())), jsx(Constraints.Horizontal, {
|
|
1098
1138
|
children: dropArea
|
|
@@ -1100,6 +1140,41 @@ const FileDropArea = () => {
|
|
|
1100
1140
|
}));
|
|
1101
1141
|
};
|
|
1102
1142
|
|
|
1143
|
+
var messages$5 = defineMessages({
|
|
1144
|
+
publishProducts: {
|
|
1145
|
+
id: 'ImportResourcesModal.settings.publishProducts',
|
|
1146
|
+
description: 'Label for the publish products checkbox',
|
|
1147
|
+
defaultMessage: 'Publish all products in the file'
|
|
1148
|
+
}
|
|
1149
|
+
});
|
|
1150
|
+
|
|
1151
|
+
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; }
|
|
1152
|
+
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$b(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1153
|
+
const UploadProductSettings = () => {
|
|
1154
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1155
|
+
state = _useImportResourcesCo.state,
|
|
1156
|
+
actions = _useImportResourcesCo.actions;
|
|
1157
|
+
return jsx(CheckboxInput, {
|
|
1158
|
+
isChecked: state.settings?.publish,
|
|
1159
|
+
onChange: e => {
|
|
1160
|
+
actions.setUploadSettings({
|
|
1161
|
+
publish: e.target.checked
|
|
1162
|
+
});
|
|
1163
|
+
},
|
|
1164
|
+
children: jsx(FormattedMessage, _objectSpread$b({}, messages$5.publishProducts))
|
|
1165
|
+
});
|
|
1166
|
+
};
|
|
1167
|
+
const UploadSettings = () => {
|
|
1168
|
+
const _useImportResourcesCo2 = useImportResourcesContext(),
|
|
1169
|
+
state = _useImportResourcesCo2.state;
|
|
1170
|
+
const canPublishProducts = useIsAuthorized({
|
|
1171
|
+
demandedPermissions: [PERMISSIONS.ManageProducts],
|
|
1172
|
+
demandedActionRights: [ACTION_RIGHTS.PublishProducts]
|
|
1173
|
+
});
|
|
1174
|
+
if (state.resourceType === 'product' && canPublishProducts) return jsx(UploadProductSettings, {});
|
|
1175
|
+
return null;
|
|
1176
|
+
};
|
|
1177
|
+
|
|
1103
1178
|
var sharedMessages = defineMessages({
|
|
1104
1179
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
1105
1180
|
id: 'ImportResourcesModal.modalTitle.category',
|
|
@@ -1184,21 +1259,23 @@ const Upload = () => {
|
|
|
1184
1259
|
children: [jsx(Grid.Item, {
|
|
1185
1260
|
children: jsx(Text.Body, {
|
|
1186
1261
|
isBold: true,
|
|
1187
|
-
intlMessage: messages$
|
|
1262
|
+
intlMessage: messages$7.dataType
|
|
1188
1263
|
})
|
|
1189
1264
|
}), jsx(Grid.Item, {
|
|
1190
1265
|
children: jsx(ResourceTypeSelection, {})
|
|
1191
1266
|
}), jsx(Grid.Item, {
|
|
1192
1267
|
children: jsx(Text.Body, {
|
|
1193
1268
|
isBold: true,
|
|
1194
|
-
intlMessage: messages$
|
|
1269
|
+
intlMessage: messages$7.instructions
|
|
1195
1270
|
})
|
|
1196
1271
|
}), jsx(Grid.Item, {
|
|
1197
1272
|
children: jsx(Instructions, {})
|
|
1198
1273
|
})]
|
|
1199
|
-
}) : jsx(
|
|
1274
|
+
}) : jsx(Fragment, {
|
|
1275
|
+
children: jsx(Instructions, {})
|
|
1276
|
+
}), jsx(InfoBox, {}), jsx(Masking.Mask, {
|
|
1200
1277
|
children: jsx(FileDropArea, {})
|
|
1201
|
-
})]
|
|
1278
|
+
}), jsx(UploadSettings, {})]
|
|
1202
1279
|
})
|
|
1203
1280
|
})
|
|
1204
1281
|
});
|
|
@@ -1478,21 +1555,6 @@ var messages$3 = defineMessages({
|
|
|
1478
1555
|
description: 'Label for the modal Start import button',
|
|
1479
1556
|
defaultMessage: 'Start import'
|
|
1480
1557
|
},
|
|
1481
|
-
BodyText: {
|
|
1482
|
-
id: 'ImportResourcesModal.BodyText',
|
|
1483
|
-
description: 'Confirmation dialog text',
|
|
1484
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows to the project: <bold>{projectName}</bold>.'
|
|
1485
|
-
},
|
|
1486
|
-
BodyNote: {
|
|
1487
|
-
id: 'ImportResourcesModal.BodyNote',
|
|
1488
|
-
description: 'Confirmation dialog text',
|
|
1489
|
-
defaultMessage: 'Please be aware that existing values with the same keys will be overwritten by the data included in the CSV.'
|
|
1490
|
-
},
|
|
1491
|
-
BodyQuestion: {
|
|
1492
|
-
id: 'ImportResourcesModal.BodyQuestion',
|
|
1493
|
-
description: 'Confirmation question',
|
|
1494
|
-
defaultMessage: 'Proceed with the import?'
|
|
1495
|
-
},
|
|
1496
1558
|
importNotificationSuccessMessage: {
|
|
1497
1559
|
id: 'ImportResourcesModal.successMessage',
|
|
1498
1560
|
description: 'Notification success message',
|
|
@@ -1511,7 +1573,7 @@ var messages$3 = defineMessages({
|
|
|
1511
1573
|
rowsToBeImported: {
|
|
1512
1574
|
id: 'ImportResourcesModal.rowsToBeImported',
|
|
1513
1575
|
description: 'This message indicates the number of rows that are ready to be imported into the system.',
|
|
1514
|
-
defaultMessage: '<b>{rowCount}</b> rows to be imported'
|
|
1576
|
+
defaultMessage: '{rowCount, plural, one {<b>1</b> row to be imported} other {<b>{rowCount}</b> rows to be imported}}{publish, select, true { and published} other {}}'
|
|
1515
1577
|
},
|
|
1516
1578
|
columnsToBeImported: {
|
|
1517
1579
|
id: 'ImportResourcesModal.columnsToBeImported',
|
|
@@ -1541,7 +1603,7 @@ var messages$3 = defineMessages({
|
|
|
1541
1603
|
confirmationBodyText: {
|
|
1542
1604
|
id: 'ImportResourcesModal.confirmationBodyText',
|
|
1543
1605
|
description: 'Confirmation dialog text',
|
|
1544
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows
|
|
1606
|
+
defaultMessage: 'You are about to import {count, plural, one {<bold>1</bold> row} other {<bold>{count}</bold> rows}} in the project: <bold>{projectName}</bold>.'
|
|
1545
1607
|
},
|
|
1546
1608
|
confirmationBodyNote: {
|
|
1547
1609
|
id: 'ImportResourcesModal.confirmationBodyNote',
|
|
@@ -1556,38 +1618,57 @@ var messages$3 = defineMessages({
|
|
|
1556
1618
|
});
|
|
1557
1619
|
|
|
1558
1620
|
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; }
|
|
1559
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1621
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1622
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$1() { 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)."; }
|
|
1623
|
+
const AlignedContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
1624
|
+
target: "e1amawj91"
|
|
1625
|
+
} : {
|
|
1626
|
+
target: "e1amawj91",
|
|
1627
|
+
label: "AlignedContainer"
|
|
1628
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
1629
|
+
name: "1x0d6yz",
|
|
1630
|
+
styles: "padding-top:5px"
|
|
1631
|
+
} : {
|
|
1632
|
+
name: "1x0d6yz",
|
|
1633
|
+
styles: "padding-top:5px",
|
|
1634
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbHVtbi1saXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXMEMiLCJmaWxlIjoiY29sdW1uLWxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgRm9ybWF0dGVkTWVzc2FnZSB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyBMaW5rLCBTdGFtcCwgVGFnTGlzdCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzL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SA9PiAoXG4gICAgICAgIDxTdGFtcCBrZXk9e2luZGV4fSBsYWJlbD17Y29sdW1ufSB0b25lPVwic2Vjb25kYXJ5XCIgLz5cbiAgICAgICkpfVxuICAgICAge3Nob3VsZFNob3dFeHBhbmRCdXR0b24gJiYgKFxuICAgICAgICA8QWxpZ25lZENvbnRhaW5lcj5cbiAgICAgICAgICA8TGlua1xuICAgICAgICAgICAgdG89XCJcIlxuICAgICAgICAgICAgdG9uZT1cInNlY29uZGFyeVwiXG4gICAgICAgICAgICBvbkNsaWNrPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICAgICAgc2V0SXNFeHBhbmRlZCghaXNFeHBhbmRlZClcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2lzRXhwYW5kZWQgPyAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TGVzc30gLz5cbiAgICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TW9yZX0gLz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9MaW5rPlxuICAgICAgICA8L0FsaWduZWRDb250YWluZXI+XG4gICAgICApfVxuICAgIDwvTW9kaWZpZWRUYWdMaXN0PlxuICApXG59XG4iXX0= */",
|
|
1635
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
1636
|
+
});
|
|
1637
|
+
const ModifiedTagList = /*#__PURE__*/_styled(TagList, process.env.NODE_ENV === "production" ? {
|
|
1564
1638
|
target: "e1amawj90"
|
|
1565
1639
|
} : {
|
|
1566
1640
|
target: "e1amawj90",
|
|
1567
|
-
label: "
|
|
1568
|
-
})(
|
|
1641
|
+
label: "ModifiedTagList"
|
|
1642
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
1643
|
+
name: "u9abxe",
|
|
1644
|
+
styles: ">div{margin:8px 8px 0 0;}"
|
|
1645
|
+
} : {
|
|
1646
|
+
name: "u9abxe",
|
|
1647
|
+
styles: ">div{margin:8px 8px 0 0;}",
|
|
1648
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbHVtbi1saXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlOEMiLCJmaWxlIjoiY29sdW1uLWxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgRm9ybWF0dGVkTWVzc2FnZSB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyBMaW5rLCBTdGFtcCwgVGFnTGlzdCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnXG5pbXBvcnQgeyBJTklUSUFMX0NPTFVNTl9ESVNQTEFZX0NPVU5UIH0gZnJvbSAnLi4vLi4vQGNvbnN0YW50cydcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgY29sdW1uczogQXJyYXk8c3RyaW5nPlxufVxuXG5leHBvcnQgY29uc3QgQWxpZ25lZENvbnRhaW5lciA9IHN0eWxlZC5kaXZgXG4gIHBhZGRpbmctdG9wOiA1cHg7XG5gXG5cbmV4cG9ydCBjb25zdCBNb2RpZmllZFRhZ0xpc3QgPSBzdHlsZWQoVGFnTGlzdClgXG4gID4gZGl2IHtcbiAgICBtYXJnaW46IDhweCA4cHggMCAwO1xuICB9XG5gXG5cbmV4cG9ydCBjb25zdCBDb2x1bW5MaXN0ID0gKHByb3BzOiBSZWFjdC5Qcm9wc1dpdGhDaGlsZHJlbjxQc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gIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TW9yZX0gLz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9MaW5rPlxuICAgICAgICA8L0FsaWduZWRDb250YWluZXI+XG4gICAgICApfVxuICAgIDwvTW9kaWZpZWRUYWdMaXN0PlxuICApXG59XG4iXX0= */",
|
|
1649
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
1650
|
+
});
|
|
1569
1651
|
const ColumnList = props => {
|
|
1652
|
+
var _context;
|
|
1570
1653
|
const _React$useState = React.useState(false),
|
|
1571
1654
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1572
1655
|
isExpanded = _React$useState2[0],
|
|
1573
1656
|
setIsExpanded = _React$useState2[1];
|
|
1574
1657
|
const shouldShowExpandButton = props.columns.length > INITIAL_COLUMN_DISPLAY_COUNT;
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
children: [
|
|
1578
|
-
|
|
1658
|
+
const finalColumns = isExpanded ? props.columns : _sliceInstanceProperty(_context = props.columns).call(_context, 0, INITIAL_COLUMN_DISPLAY_COUNT);
|
|
1659
|
+
return jsxs(ModifiedTagList, {
|
|
1660
|
+
children: [_mapInstanceProperty(finalColumns).call(finalColumns, (column, index) => jsx(Stamp, {
|
|
1661
|
+
label: column,
|
|
1662
|
+
tone: "secondary"
|
|
1663
|
+
}, index)), shouldShowExpandButton && jsx(AlignedContainer, {
|
|
1664
|
+
children: jsx(Link, {
|
|
1665
|
+
to: "",
|
|
1579
1666
|
tone: "secondary",
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
e.preventDefault();
|
|
1586
|
-
setIsExpanded(!isExpanded);
|
|
1587
|
-
},
|
|
1588
|
-
children: isExpanded ? jsx(FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1589
|
-
})
|
|
1590
|
-
})]
|
|
1667
|
+
onClick: e => {
|
|
1668
|
+
e.preventDefault();
|
|
1669
|
+
setIsExpanded(!isExpanded);
|
|
1670
|
+
},
|
|
1671
|
+
children: isExpanded ? jsx(FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1591
1672
|
})
|
|
1592
1673
|
})]
|
|
1593
1674
|
});
|
|
@@ -1632,30 +1713,34 @@ function UploadPreviewModal() {
|
|
|
1632
1713
|
}), jsx(Card, {
|
|
1633
1714
|
insetScale: "xl",
|
|
1634
1715
|
children: jsxs(Spacings.Stack, {
|
|
1635
|
-
scale: "
|
|
1636
|
-
children: [jsxs(Spacings.
|
|
1637
|
-
|
|
1638
|
-
children: [
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1716
|
+
scale: "s",
|
|
1717
|
+
children: [jsxs(Spacings.Stack, {
|
|
1718
|
+
scale: "xs",
|
|
1719
|
+
children: [jsxs(Spacings.Inline, {
|
|
1720
|
+
alignItems: "center",
|
|
1721
|
+
children: [jsx(CheckBoldIcon, {
|
|
1722
|
+
color: "success"
|
|
1723
|
+
}), jsx(Text.Body, {
|
|
1724
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
|
|
1725
|
+
values: {
|
|
1726
|
+
rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
|
|
1727
|
+
publish: state.resourceType === 'product' && state.settings?.publish,
|
|
1728
|
+
b: getBold$1
|
|
1729
|
+
}
|
|
1730
|
+
})
|
|
1731
|
+
})]
|
|
1732
|
+
}), jsxs(Spacings.Inline, {
|
|
1733
|
+
alignItems: "center",
|
|
1734
|
+
children: [jsx(CheckBoldIcon, {
|
|
1735
|
+
color: "success"
|
|
1736
|
+
}), jsx(Text.Body, {
|
|
1737
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeImported), {}, {
|
|
1738
|
+
values: {
|
|
1739
|
+
columnCount: intl.formatNumber(validatedColumns.length),
|
|
1740
|
+
b: getBold$1
|
|
1741
|
+
}
|
|
1742
|
+
})
|
|
1743
|
+
})]
|
|
1659
1744
|
})]
|
|
1660
1745
|
}), jsx(ColumnList, {
|
|
1661
1746
|
columns: validatedColumns
|
|
@@ -1664,7 +1749,7 @@ function UploadPreviewModal() {
|
|
|
1664
1749
|
}), ignoredColumns.length > 0 && jsx(Card, {
|
|
1665
1750
|
insetScale: "xl",
|
|
1666
1751
|
children: jsxs(Spacings.Stack, {
|
|
1667
|
-
scale: "
|
|
1752
|
+
scale: "s",
|
|
1668
1753
|
children: [jsxs(Spacings.Inline, {
|
|
1669
1754
|
alignItems: "center",
|
|
1670
1755
|
children: [jsx(EyeCrossedIcon, {
|
|
@@ -2096,19 +2181,19 @@ const getChunkImport = locale => {
|
|
|
2096
2181
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
2097
2182
|
switch (intlLocale) {
|
|
2098
2183
|
case 'de':
|
|
2099
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-
|
|
2184
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-3d74f145.esm.js');
|
|
2100
2185
|
case 'es':
|
|
2101
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2186
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-561e774f.esm.js');
|
|
2102
2187
|
case 'fr-FR':
|
|
2103
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
2188
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-1c33adf1.esm.js');
|
|
2104
2189
|
case 'zh-CN':
|
|
2105
2190
|
return import(/* webpackChunkName: "import-resources-modal-i18n-zh-CN" */'./zh-CN-4780d88e.esm.js');
|
|
2106
2191
|
case 'ja':
|
|
2107
2192
|
return import(/* webpackChunkName: "import-resources-modal-i18n-ja" */'./ja-73c088a7.esm.js');
|
|
2108
2193
|
case 'pt-BR':
|
|
2109
|
-
return import(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
2194
|
+
return import(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-c09d735f.esm.js');
|
|
2110
2195
|
default:
|
|
2111
|
-
return import(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-
|
|
2196
|
+
return import(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-bfc8cfec.esm.js');
|
|
2112
2197
|
}
|
|
2113
2198
|
};
|
|
2114
2199
|
const loadMessages = async locale => {
|
|
@@ -2188,4 +2273,4 @@ const ImportResourcesModal = props => {
|
|
|
2188
2273
|
};
|
|
2189
2274
|
ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
2190
2275
|
|
|
2191
|
-
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, useImportPermission as a, messages$
|
|
2276
|
+
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, useImportPermission as a, messages$7 as m, useImportResourcesContext as u };
|