@commercetools-frontend-extensions/import-resources-modal 1.9.0 → 1.10.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-a995b09d.cjs.prod.js → active-drag-drop-area-58179e9a.cjs.prod.js} +1 -1
- package/dist/{active-drag-drop-area-294d353d.esm.js → active-drag-drop-area-5983aeff.esm.js} +1 -1
- package/dist/{active-drag-drop-area-0467c118.cjs.dev.js → active-drag-drop-area-bb4bbe27.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/{de-2836a9ae.cjs.prod.js → de-3e1e8435.cjs.dev.js} +3 -3
- package/dist/{de-19530b12.esm.js → de-67bd98c5.esm.js} +3 -3
- package/dist/{de-db4fb974.cjs.dev.js → de-a33f40b4.cjs.prod.js} +3 -3
- package/dist/declarations/src/@types/file-upload.d.ts +1 -0
- package/dist/declarations/src/@types/import-container.d.ts +4 -2
- package/dist/{disabled-drop-area-7ca6b04a.esm.js → disabled-drop-area-67de59ef.esm.js} +1 -1
- package/dist/{disabled-drop-area-16b58581.cjs.prod.js → disabled-drop-area-9c90609b.cjs.prod.js} +1 -1
- package/dist/{disabled-drop-area-4a639dbf.cjs.dev.js → disabled-drop-area-a3d62583.cjs.dev.js} +1 -1
- package/dist/{en-f53130d1.cjs.dev.js → en-647cd603.cjs.prod.js} +1 -1
- package/dist/{en-1f091237.esm.js → en-850d8c4a.esm.js} +1 -1
- package/dist/{en-cb6893e4.cjs.prod.js → en-b68b87c8.cjs.dev.js} +1 -1
- package/dist/{enabled-drop-area-9bf924fa.esm.js → enabled-drop-area-5f322d0a.esm.js} +1 -1
- package/dist/{enabled-drop-area-1f50b766.cjs.prod.js → enabled-drop-area-723eb5b8.cjs.prod.js} +1 -1
- package/dist/{enabled-drop-area-a4a76650.cjs.dev.js → enabled-drop-area-7cc66fc8.cjs.dev.js} +1 -1
- package/dist/{es-420f21e1.cjs.dev.js → es-02f8a321.cjs.prod.js} +3 -3
- package/dist/{es-a9aada13.esm.js → es-21c30725.esm.js} +3 -3
- package/dist/{es-f085026e.cjs.prod.js → es-68d1ba91.cjs.dev.js} +3 -3
- package/dist/{file-dropped-area-e6b5a3fa.esm.js → file-dropped-area-724a3d30.esm.js} +1 -1
- package/dist/{file-dropped-area-84bc6912.cjs.prod.js → file-dropped-area-d451d883.cjs.prod.js} +1 -1
- package/dist/{file-dropped-area-9387283c.cjs.dev.js → file-dropped-area-e06176a3.cjs.dev.js} +1 -1
- package/dist/{fr-FR-dc40a55c.cjs.prod.js → fr-FR-078895d6.cjs.prod.js} +3 -3
- package/dist/{fr-FR-02bd52fb.esm.js → fr-FR-3c6878e4.esm.js} +3 -3
- package/dist/{fr-FR-342599f4.cjs.dev.js → fr-FR-a9a6c5c9.cjs.dev.js} +3 -3
- package/dist/{index-40da749a.cjs.dev.js → index-44a01cb9.cjs.dev.js} +174 -83
- package/dist/{index-10a225f5.esm.js → index-7a93797c.esm.js} +175 -84
- package/dist/{index-77194696.cjs.prod.js → index-e08c812b.cjs.prod.js} +169 -83
- package/dist/{pt-BR-339ed808.cjs.dev.js → pt-BR-a50aa3dd.cjs.prod.js} +3 -3
- package/dist/{pt-BR-31c46d23.cjs.prod.js → pt-BR-cd32fb09.cjs.dev.js} +3 -3
- package/dist/{pt-BR-ac1fc192.esm.js → pt-BR-fa0b65c8.esm.js} +3 -3
- package/package.json +18 -18
|
@@ -41,7 +41,7 @@ import '@babel/runtime-corejs3/core-js-stable/object/entries';
|
|
|
41
41
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
42
42
|
import { FormDialog, InfoDialog, PageContentNarrow, ConfirmationDialog } from '@commercetools-frontend/application-components';
|
|
43
43
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
44
|
-
import { customProperties, Constraints,
|
|
44
|
+
import { customProperties, Constraints, Spacings, Text, SelectField, CheckboxInput, Grid, designTokens, usePaginationState, DataTable, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, Link, TagList, Card, CheckBoldIcon, EyeCrossedIcon, ProgressBar, RadioInput, ContentNotification } from '@commercetools-frontend/ui-kit';
|
|
45
45
|
import { useDropzone } from 'react-dropzone';
|
|
46
46
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
47
47
|
import _styled from '@emotion/styled/base';
|
|
@@ -88,27 +88,26 @@ let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
|
|
|
88
88
|
return CurrentStep;
|
|
89
89
|
}({});
|
|
90
90
|
|
|
91
|
-
function ownKeys$
|
|
92
|
-
function _objectSpread$
|
|
91
|
+
function ownKeys$k(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; }
|
|
92
|
+
function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$k(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$k(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
93
93
|
|
|
94
94
|
// TODO: make this resource type specific
|
|
95
95
|
|
|
96
96
|
function reducer(state, action) {
|
|
97
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
97
|
+
if (action.type === 'setCurrentStep') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
98
98
|
currentStep: action.currentStep,
|
|
99
99
|
progress: 0
|
|
100
100
|
});
|
|
101
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
101
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
102
102
|
uploadFileResponse: action.uploadFileResponse
|
|
103
103
|
});
|
|
104
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
105
|
-
settings: undefined,
|
|
104
|
+
if (action.type === 'setResourceType') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
106
105
|
resourceType: action.resourceType
|
|
107
106
|
});
|
|
108
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
107
|
+
if (action.type === 'setContainerKey') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
109
108
|
containerKey: action.containerKey
|
|
110
109
|
});
|
|
111
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
110
|
+
if (action.type === 'cancelImport') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
112
111
|
currentStep: CurrentStep$1.Upload,
|
|
113
112
|
containerKey: undefined,
|
|
114
113
|
fileUploadErrors: [],
|
|
@@ -117,7 +116,7 @@ function reducer(state, action) {
|
|
|
117
116
|
dropAreaState: 'disabled',
|
|
118
117
|
progress: 0
|
|
119
118
|
});
|
|
120
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
119
|
+
if (action.type === 'uploadNewFile') return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
121
120
|
currentStep: CurrentStep$1.Upload,
|
|
122
121
|
containerKey: undefined,
|
|
123
122
|
fileUploadErrors: [],
|
|
@@ -127,28 +126,28 @@ function reducer(state, action) {
|
|
|
127
126
|
progress: 0
|
|
128
127
|
});
|
|
129
128
|
if (action.type === 'setDroppedFile') {
|
|
130
|
-
return _objectSpread$
|
|
129
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
131
130
|
droppedFile: action.droppedFile
|
|
132
131
|
});
|
|
133
132
|
}
|
|
134
133
|
if (action.type === 'setFileUploadErrors') {
|
|
135
|
-
return _objectSpread$
|
|
134
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
136
135
|
fileUploadErrors: action.fileUploadErrors
|
|
137
136
|
});
|
|
138
137
|
}
|
|
139
138
|
if (action.type === 'setAbortController') {
|
|
140
|
-
return _objectSpread$
|
|
139
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
141
140
|
abortController: action.abortController
|
|
142
141
|
});
|
|
143
142
|
}
|
|
144
143
|
if (action.type === 'setProgress') {
|
|
145
|
-
return _objectSpread$
|
|
144
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
146
145
|
progress: action.progress
|
|
147
146
|
});
|
|
148
147
|
}
|
|
149
148
|
if (action.type === 'setUploadSettings') {
|
|
150
|
-
return _objectSpread$
|
|
151
|
-
settings: _objectSpread$
|
|
149
|
+
return _objectSpread$k(_objectSpread$k({}, state), {}, {
|
|
150
|
+
settings: _objectSpread$k(_objectSpread$k({}, state.settings), action.settings)
|
|
152
151
|
});
|
|
153
152
|
}
|
|
154
153
|
throw new Error(getUnknownActionError(action));
|
|
@@ -164,7 +163,10 @@ const initialState = {
|
|
|
164
163
|
fileUploadErrors: [],
|
|
165
164
|
resourceType: 'category',
|
|
166
165
|
containerKey: undefined,
|
|
167
|
-
progress: 0
|
|
166
|
+
progress: 0,
|
|
167
|
+
settings: {
|
|
168
|
+
decimalSeparator: '.'
|
|
169
|
+
}
|
|
168
170
|
};
|
|
169
171
|
|
|
170
172
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? _Reflect$construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
@@ -213,8 +215,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
213
215
|
return _createClass(HttpError);
|
|
214
216
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
215
217
|
|
|
216
|
-
function ownKeys$
|
|
217
|
-
function _objectSpread$
|
|
218
|
+
function ownKeys$j(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; }
|
|
219
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$j(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$j(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
218
220
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
219
221
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
220
222
|
};
|
|
@@ -226,7 +228,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
226
228
|
onSuccess = _ref2.onSuccess,
|
|
227
229
|
onError = _ref2.onError;
|
|
228
230
|
const options = createHttpClientOptions({
|
|
229
|
-
headers: _objectSpread$
|
|
231
|
+
headers: _objectSpread$j({
|
|
230
232
|
'Content-Type': 'application/json'
|
|
231
233
|
}, config?.headers)
|
|
232
234
|
});
|
|
@@ -270,7 +272,14 @@ const fetchUsingXhr = _ref2 => {
|
|
|
270
272
|
return xhr;
|
|
271
273
|
};
|
|
272
274
|
|
|
273
|
-
const
|
|
275
|
+
const DELIMITERS = {
|
|
276
|
+
COMMA: ',',
|
|
277
|
+
SEMICOLON: ';',
|
|
278
|
+
POINT: '.',
|
|
279
|
+
TAB: '\t',
|
|
280
|
+
PIPE: '|'
|
|
281
|
+
};
|
|
282
|
+
const COLUMN_DELIMITERS = [DELIMITERS.COMMA, DELIMITERS.SEMICOLON, DELIMITERS.PIPE, DELIMITERS.TAB];
|
|
274
283
|
const INITIAL_COLUMN_DISPLAY_COUNT = 8;
|
|
275
284
|
const IMPORT_TAG_KEYS = {
|
|
276
285
|
source: 'source'
|
|
@@ -371,11 +380,11 @@ const ACTION_RIGHTS = {
|
|
|
371
380
|
}
|
|
372
381
|
};
|
|
373
382
|
|
|
374
|
-
function ownKeys$
|
|
375
|
-
function _objectSpread$
|
|
383
|
+
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; }
|
|
384
|
+
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; }
|
|
376
385
|
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
377
386
|
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
378
|
-
_objectSpread$
|
|
387
|
+
_objectSpread$i(_objectSpread$i({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
379
388
|
|
|
380
389
|
var sharedMessages = defineMessages({
|
|
381
390
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
@@ -627,13 +636,13 @@ var sharedMessages = defineMessages({
|
|
|
627
636
|
//
|
|
628
637
|
});
|
|
629
638
|
|
|
630
|
-
function ownKeys$
|
|
631
|
-
function _objectSpread$
|
|
639
|
+
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; }
|
|
640
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys$h(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$h(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
632
641
|
|
|
633
642
|
// Delimiters not included in this array may be treated as part of a column content
|
|
634
643
|
// potentially causing the file to be parsed as a single-column CSV and pass this validation
|
|
635
|
-
const
|
|
636
|
-
const DELIMITERS_TO_GUESS = [...
|
|
644
|
+
const NON_ALLOWED_COLUMN_DELIMITERS = ['%', '.', ' '];
|
|
645
|
+
const DELIMITERS_TO_GUESS = [...COLUMN_DELIMITERS, ...NON_ALLOWED_COLUMN_DELIMITERS];
|
|
637
646
|
const validateDelimiter = file => {
|
|
638
647
|
return new _Promise(resolve => {
|
|
639
648
|
Papa.parse(file, {
|
|
@@ -648,7 +657,7 @@ const validateDelimiter = file => {
|
|
|
648
657
|
}
|
|
649
658
|
const detectedDelimiter = result.meta.delimiter;
|
|
650
659
|
let isValid = false;
|
|
651
|
-
if (detectedDelimiter !== null && _includesInstanceProperty(
|
|
660
|
+
if (detectedDelimiter !== null && _includesInstanceProperty(COLUMN_DELIMITERS).call(COLUMN_DELIMITERS, detectedDelimiter)) {
|
|
652
661
|
var _context;
|
|
653
662
|
const isUndetectableDelimiter = _someInstanceProperty(_context = result.errors).call(_context, error => error.code === 'UndetectableDelimiter');
|
|
654
663
|
if (!isUndetectableDelimiter) {
|
|
@@ -677,7 +686,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
677
686
|
};
|
|
678
687
|
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
679
688
|
let idCounter = 1;
|
|
680
|
-
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$
|
|
689
|
+
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$h(_objectSpread$h({}, uploadFileError), {}, {
|
|
681
690
|
id: String(idCounter++)
|
|
682
691
|
}));
|
|
683
692
|
};
|
|
@@ -717,7 +726,7 @@ const getValidatedColumns = (columns, ignoredColumns) => {
|
|
|
717
726
|
};
|
|
718
727
|
const formatAllowedDelimitersForMessageDisplay = intl => {
|
|
719
728
|
const localizedOr = intl.formatMessage(sharedMessages.listConjunctionOr);
|
|
720
|
-
const descriptions = _mapInstanceProperty(
|
|
729
|
+
const descriptions = _mapInstanceProperty(COLUMN_DELIMITERS).call(COLUMN_DELIMITERS, delimiter => {
|
|
721
730
|
let nameDescriptor;
|
|
722
731
|
switch (delimiter) {
|
|
723
732
|
case ',':
|
|
@@ -875,8 +884,8 @@ function uploadFileForImport(_ref) {
|
|
|
875
884
|
});
|
|
876
885
|
}
|
|
877
886
|
|
|
878
|
-
function ownKeys$
|
|
879
|
-
function _objectSpread$
|
|
887
|
+
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; }
|
|
888
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$g(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$g(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
880
889
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
881
890
|
return asyncDispatch(actions.post({
|
|
882
891
|
mcApiProxyTarget: MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -885,7 +894,7 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
885
894
|
accept: 'application/json',
|
|
886
895
|
'Content-Type': 'application/json'
|
|
887
896
|
},
|
|
888
|
-
payload: _JSON$stringify(_objectSpread$
|
|
897
|
+
payload: _JSON$stringify(_objectSpread$g({
|
|
889
898
|
retentionPolicy: {
|
|
890
899
|
strategy: 'ttl',
|
|
891
900
|
config: {
|
|
@@ -929,8 +938,8 @@ function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
|
929
938
|
throw new Error('Invalid response');
|
|
930
939
|
}
|
|
931
940
|
|
|
932
|
-
function ownKeys$
|
|
933
|
-
function _objectSpread$
|
|
941
|
+
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; }
|
|
942
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$f(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$f(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
934
943
|
const ImportResourcesContext = /*#__PURE__*/React.createContext();
|
|
935
944
|
const ImportResourcesProvider = props => {
|
|
936
945
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
@@ -938,7 +947,7 @@ const ImportResourcesProvider = props => {
|
|
|
938
947
|
})),
|
|
939
948
|
projectKey = _useApplicationContex.projectKey;
|
|
940
949
|
const asyncDispatch = useAsyncDispatch();
|
|
941
|
-
const _React$useReducer = React.useReducer(reducer, _objectSpread$
|
|
950
|
+
const _React$useReducer = React.useReducer(reducer, _objectSpread$f(_objectSpread$f({}, initialState), {}, {
|
|
942
951
|
resourceType: props.resourceTypes[0]
|
|
943
952
|
})),
|
|
944
953
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -1078,13 +1087,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
1078
1087
|
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== */");
|
|
1079
1088
|
}
|
|
1080
1089
|
|
|
1081
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
1090
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-5983aeff.esm.js'));
|
|
1082
1091
|
|
|
1083
|
-
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-
|
|
1092
|
+
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-67de59ef.esm.js'));
|
|
1084
1093
|
|
|
1085
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
1094
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-5f322d0a.esm.js'));
|
|
1086
1095
|
|
|
1087
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
1096
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-724a3d30.esm.js'));
|
|
1088
1097
|
|
|
1089
1098
|
function getDropArea(_ref) {
|
|
1090
1099
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -1122,7 +1131,7 @@ function getDropAreaState(flags) {
|
|
|
1122
1131
|
return 'ready-for-drop';
|
|
1123
1132
|
}
|
|
1124
1133
|
|
|
1125
|
-
var messages$
|
|
1134
|
+
var messages$8 = defineMessages({
|
|
1126
1135
|
dragAndDropCSV: {
|
|
1127
1136
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
1128
1137
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -1187,7 +1196,7 @@ function useImportResourcesContext() {
|
|
|
1187
1196
|
return context;
|
|
1188
1197
|
}
|
|
1189
1198
|
|
|
1190
|
-
var messages$
|
|
1199
|
+
var messages$7 = defineMessages({
|
|
1191
1200
|
fileSizeExceededTitle: {
|
|
1192
1201
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
1193
1202
|
defaultMessage: 'File size exceeded'
|
|
@@ -1247,8 +1256,8 @@ var messages$6 = defineMessages({
|
|
|
1247
1256
|
}
|
|
1248
1257
|
});
|
|
1249
1258
|
|
|
1250
|
-
function ownKeys$
|
|
1251
|
-
function _objectSpread$
|
|
1259
|
+
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; }
|
|
1260
|
+
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; }
|
|
1252
1261
|
const useUpload = () => {
|
|
1253
1262
|
const intl = useIntl();
|
|
1254
1263
|
const projectKey = useApplicationContext(context => context.project?.key);
|
|
@@ -1266,25 +1275,25 @@ const useUpload = () => {
|
|
|
1266
1275
|
const errors = [];
|
|
1267
1276
|
const isDelimiterValid = await validateDelimiter(file);
|
|
1268
1277
|
if (!isDelimiterValid) errors.push({
|
|
1269
|
-
title: intl.formatMessage(messages$
|
|
1270
|
-
description: intl.formatMessage(messages$
|
|
1278
|
+
title: intl.formatMessage(messages$7.wrongSeparatorTitle),
|
|
1279
|
+
description: intl.formatMessage(messages$7.wrongSeparatorDescription, {
|
|
1271
1280
|
delimiterList: formatAllowedDelimitersForMessageDisplay(intl)
|
|
1272
1281
|
})
|
|
1273
1282
|
});
|
|
1274
1283
|
const rowCount = await getRowCount(file);
|
|
1275
1284
|
if (rowCount < 1) errors.push({
|
|
1276
|
-
title: intl.formatMessage(messages$
|
|
1277
|
-
description: intl.formatMessage(messages$
|
|
1285
|
+
title: intl.formatMessage(messages$7.dropAreaNotEnoughRowsTitle),
|
|
1286
|
+
description: intl.formatMessage(messages$7.dropAreaNotEnoughRowsDescription)
|
|
1278
1287
|
});
|
|
1279
1288
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
1280
|
-
title: intl.formatMessage(messages$
|
|
1281
|
-
description: intl.formatMessage(messages$
|
|
1289
|
+
title: intl.formatMessage(messages$7.fileSizeExceededTitle),
|
|
1290
|
+
description: intl.formatMessage(messages$7.fileSizeExceededDescription, {
|
|
1282
1291
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
1283
1292
|
})
|
|
1284
1293
|
});
|
|
1285
1294
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
1286
|
-
title: intl.formatMessage(messages$
|
|
1287
|
-
description: intl.formatMessage(messages$
|
|
1295
|
+
title: intl.formatMessage(messages$7.rowLimitExceededTitle),
|
|
1296
|
+
description: intl.formatMessage(messages$7.rowLimitExceededDescription, {
|
|
1288
1297
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
1289
1298
|
})
|
|
1290
1299
|
});
|
|
@@ -1303,16 +1312,16 @@ const useUpload = () => {
|
|
|
1303
1312
|
if (error instanceof HttpError) {
|
|
1304
1313
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
1305
1314
|
actions.setFileUploadErrors([{
|
|
1306
|
-
title: intl.formatMessage(messages$
|
|
1307
|
-
description: intl.formatMessage(messages$
|
|
1315
|
+
title: intl.formatMessage(messages$7.missingRequiredField),
|
|
1316
|
+
description: intl.formatMessage(messages$7.missingKeyError)
|
|
1308
1317
|
}]);
|
|
1309
1318
|
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
1310
1319
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
1311
1320
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
1312
1321
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
1313
1322
|
actions.setFileUploadErrors([{
|
|
1314
|
-
title: intl.formatMessage(messages$
|
|
1315
|
-
description: intl.formatMessage(messages$
|
|
1323
|
+
title: intl.formatMessage(messages$7.missingRequiredField),
|
|
1324
|
+
description: intl.formatMessage(messages$7.missingRequiredKeys, {
|
|
1316
1325
|
fieldNames
|
|
1317
1326
|
})
|
|
1318
1327
|
}]);
|
|
@@ -1325,7 +1334,7 @@ const useUpload = () => {
|
|
|
1325
1334
|
showNotification({
|
|
1326
1335
|
kind: 'error',
|
|
1327
1336
|
domain: DOMAINS.PAGE,
|
|
1328
|
-
text: intl.formatMessage(messages$
|
|
1337
|
+
text: intl.formatMessage(messages$7.unexpectedError)
|
|
1329
1338
|
});
|
|
1330
1339
|
}
|
|
1331
1340
|
} else {
|
|
@@ -1354,21 +1363,21 @@ const useUpload = () => {
|
|
|
1354
1363
|
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
1355
1364
|
actions.setContainerKey(containerKey);
|
|
1356
1365
|
try {
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
await createImportContainerForFileUpload(_objectSpread$d({
|
|
1366
|
+
const shouldApplyPublishSettings = state.resourceType === 'product';
|
|
1367
|
+
await createImportContainerForFileUpload({
|
|
1360
1368
|
key: containerKey,
|
|
1361
1369
|
resourceType: state.resourceType,
|
|
1362
|
-
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
1363
|
-
|
|
1364
|
-
settings: {
|
|
1365
|
-
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1370
|
+
tags: [TAG_KEY_SOURCE_FILE_UPLOAD],
|
|
1371
|
+
settings: _objectSpread$e({
|
|
1366
1372
|
format: 'CSV',
|
|
1373
|
+
decimalSeparator: state.settings?.decimalSeparator
|
|
1374
|
+
}, shouldApplyPublishSettings ? {
|
|
1375
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1367
1376
|
options: {
|
|
1368
1377
|
publishAllChanges: state.settings?.publish ?? false
|
|
1369
1378
|
}
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1379
|
+
} : {})
|
|
1380
|
+
}, projectKey, asyncDispatch);
|
|
1372
1381
|
const newAbortController = uploadFileForImport({
|
|
1373
1382
|
projectKey,
|
|
1374
1383
|
containerKey,
|
|
@@ -1446,8 +1455,8 @@ const useImportPermission = () => {
|
|
|
1446
1455
|
};
|
|
1447
1456
|
};
|
|
1448
1457
|
|
|
1449
|
-
function ownKeys$
|
|
1450
|
-
function _objectSpread$
|
|
1458
|
+
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; }
|
|
1459
|
+
function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys$d(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$d(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1451
1460
|
const FileDropArea = () => {
|
|
1452
1461
|
const intl = useIntl();
|
|
1453
1462
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1477,7 +1486,7 @@ const FileDropArea = () => {
|
|
|
1477
1486
|
showNotification({
|
|
1478
1487
|
kind: 'error',
|
|
1479
1488
|
domain: DOMAINS.PAGE,
|
|
1480
|
-
text: intl.formatMessage(messages$
|
|
1489
|
+
text: intl.formatMessage(messages$8.tooManyFilesError)
|
|
1481
1490
|
});
|
|
1482
1491
|
return;
|
|
1483
1492
|
}
|
|
@@ -1485,13 +1494,13 @@ const FileDropArea = () => {
|
|
|
1485
1494
|
showNotification({
|
|
1486
1495
|
kind: 'error',
|
|
1487
1496
|
domain: DOMAINS.PAGE,
|
|
1488
|
-
text: intl.formatMessage(messages$
|
|
1497
|
+
text: intl.formatMessage(messages$8.fileFormatNotSupported)
|
|
1489
1498
|
});
|
|
1490
1499
|
} else {
|
|
1491
1500
|
showNotification({
|
|
1492
1501
|
kind: 'error',
|
|
1493
1502
|
domain: DOMAINS.PAGE,
|
|
1494
|
-
text: intl.formatMessage(messages$
|
|
1503
|
+
text: intl.formatMessage(messages$8.genericError)
|
|
1495
1504
|
});
|
|
1496
1505
|
}
|
|
1497
1506
|
}
|
|
@@ -1509,11 +1518,11 @@ const FileDropArea = () => {
|
|
|
1509
1518
|
resourceType: 'category',
|
|
1510
1519
|
isFileDropped: Boolean(state.droppedFile)
|
|
1511
1520
|
});
|
|
1512
|
-
return jsxs(DropWrapper, _objectSpread$
|
|
1521
|
+
return jsxs(DropWrapper, _objectSpread$d(_objectSpread$d({
|
|
1513
1522
|
role: "presentation"
|
|
1514
1523
|
}, getRootProps()), {}, {
|
|
1515
1524
|
dropAreaState: dropAreaState,
|
|
1516
|
-
children: [jsx("input", _objectSpread$
|
|
1525
|
+
children: [jsx("input", _objectSpread$d({
|
|
1517
1526
|
"data-testid": "file-input"
|
|
1518
1527
|
}, getInputProps())), jsx(Constraints.Horizontal, {
|
|
1519
1528
|
children: dropArea
|
|
@@ -1521,6 +1530,87 @@ const FileDropArea = () => {
|
|
|
1521
1530
|
}));
|
|
1522
1531
|
};
|
|
1523
1532
|
|
|
1533
|
+
var messages$6 = defineMessages({
|
|
1534
|
+
separatorTitle: {
|
|
1535
|
+
id: 'ImportResourcesModal.uploadSeparator.separatorTitle',
|
|
1536
|
+
description: 'Title for the separator selection',
|
|
1537
|
+
defaultMessage: 'Separator'
|
|
1538
|
+
},
|
|
1539
|
+
decimalsSeparatorDescription: {
|
|
1540
|
+
id: 'ImportResourcesModal.uploadSeparator.decimalsSeparatorDescription',
|
|
1541
|
+
description: 'Description for the decimals separator selection',
|
|
1542
|
+
defaultMessage: 'Select the decimals separator that match your CSV file. The column separator is automatically detected.'
|
|
1543
|
+
},
|
|
1544
|
+
decimalSeparatorPoint: {
|
|
1545
|
+
id: 'ImportResourcesModal.uploadSeparator.decimalSeparatorPoint',
|
|
1546
|
+
description: 'Label for point decimal separator option',
|
|
1547
|
+
defaultMessage: 'point (.)'
|
|
1548
|
+
},
|
|
1549
|
+
decimalSeparatorComma: {
|
|
1550
|
+
id: 'ImportResourcesModal.uploadSeparator.decimalSeparatorComma',
|
|
1551
|
+
description: 'Label for comma decimal separator option',
|
|
1552
|
+
defaultMessage: 'comma (,)'
|
|
1553
|
+
},
|
|
1554
|
+
decimals: {
|
|
1555
|
+
id: 'ImportResourcesModal.uploadSeparator.decimals',
|
|
1556
|
+
description: 'Label for decimal separator select',
|
|
1557
|
+
defaultMessage: 'Decimals'
|
|
1558
|
+
}
|
|
1559
|
+
});
|
|
1560
|
+
|
|
1561
|
+
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; }
|
|
1562
|
+
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; }
|
|
1563
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__$2() { 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)."; }
|
|
1564
|
+
const DECIMAL_DELIMITER_OPTIONS = [{
|
|
1565
|
+
label: messages$6.decimalSeparatorPoint,
|
|
1566
|
+
value: DELIMITERS.POINT
|
|
1567
|
+
}, {
|
|
1568
|
+
label: messages$6.decimalSeparatorComma,
|
|
1569
|
+
value: DELIMITERS.COMMA
|
|
1570
|
+
}];
|
|
1571
|
+
const decimalSeparatorOptions = _mapInstanceProperty(DECIMAL_DELIMITER_OPTIONS).call(DECIMAL_DELIMITER_OPTIONS, option => _objectSpread$c(_objectSpread$c({}, option), {}, {
|
|
1572
|
+
label: jsx(FormattedMessage, _objectSpread$c({}, option.label))
|
|
1573
|
+
}));
|
|
1574
|
+
var _ref$1 = process.env.NODE_ENV === "production" ? {
|
|
1575
|
+
name: "lt3z56",
|
|
1576
|
+
styles: "width:calc(50% - 16px)"
|
|
1577
|
+
} : {
|
|
1578
|
+
name: "1vfe1dp-UploadSeparator",
|
|
1579
|
+
styles: "width:calc(50% - 16px);label:UploadSeparator;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVwbG9hZC1zZXBhcmF0b3IudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXNDZ0IiLCJmaWxlIjoidXBsb2FkLXNlcGFyYXRvci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBGb3JtYXR0ZWRNZXNzYWdlLCB1c2VJbnRsIH0gZnJvbSAncmVhY3QtaW50bCdcbmltcG9ydCB7IFNlbGVjdEZpZWxkLCBTcGFjaW5ncywgVGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCdcbmltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnXG5pbXBvcnQgeyBERUxJTUlURVJTIH0gZnJvbSAnLi4vLi4vLi4vQGNvbnN0YW50cydcbmltcG9ydCB7IHVzZUltcG9ydFJlc291cmNlc0NvbnRleHQgfSBmcm9tICcuLi8uLi8uLi9AaG9va3MnXG5pbXBvcnQgeyB0eXBlIERlY2ltYWxTZXBhcmF0b3IgfSBmcm9tICcuLi8uLi8uLi9AdHlwZXMnXG5cbmV4cG9ydCBjb25zdCBERUNJTUFMX0RFTElNSVRFUl9PUFRJT05TID0gW1xuICB7XG4gICAgbGFiZWw6IG1lc3NhZ2VzLmRlY2ltYWxTZXBhcmF0b3JQb2ludCxcbiAgICB2YWx1ZTogREVMSU1JVEVSUy5QT0lOVCxcbiAgfSxcbiAge1xuICAgIGxhYmVsOiBtZXNzYWdlcy5kZWNpbWFsU2VwYXJhdG9yQ29tbWEsXG4gICAgdmFsdWU6IERFTElNSVRFUlMuQ09NTUEsXG4gIH0sXG5dXG5cbmNvbnN0IGRlY2ltYWxTZXBhcmF0b3JPcHRpb25zID0gREVDSU1BTF9ERUxJTUlURVJfT1BUSU9OUy5tYXAoKG9wdGlvbikgPT4gKHtcbiAgLi4ub3B0aW9uLFxuICBsYWJlbDogPEZvcm1hdHRlZE1lc3NhZ2Ugey4uLm9wdGlvbi5sYWJlbH0gLz4sXG59KSlcblxuZXhwb3J0IGNvbnN0IFVwbG9hZFNlcGFyYXRvciA9ICgpID0+IHtcbiAgY29uc3QgaW50bCA9IHVzZUludGwoKVxuICBjb25zdCB7IHN0YXRlLCBhY3Rpb25zIH0gPSB1c2VJbXBvcnRSZXNvdXJjZXNDb250ZXh0KClcblxuICByZXR1cm4gKFxuICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cIm1cIj5cbiAgICAgIDxkaXY+XG4gICAgICAgIDxUZXh0LlN1YmhlYWRsaW5lIGFzPVwiaDRcIiBpbnRsTWVzc2FnZT17bWVzc2FnZXMuc2VwYXJhdG9yVGl0bGV9IC8+XG4gICAgICAgIDxUZXh0LkNhcHRpb25cbiAgICAgICAgICB0b25lPVwidGVydGlhcnlcIlxuICAgICAgICAgIGludGxNZXNzYWdlPXttZXNzYWdlcy5kZWNpbWFsc1NlcGFyYXRvckRlc2NyaXB0aW9ufVxuICAgICAgICAvPlxuICAgICAgPC9kaXY+XG4gICAgICA8ZGl2XG4gICAgICAgIGNzcz17Y3NzYFxuICAgICAgICAgIHdpZHRoOiBjYWxjKDUwJSAtIDE2cHgpO1xuICAgICAgICBgfVxuICAgICAgPlxuICAgICAgICA8U2VsZWN0RmllbGRcbiAgICAgICAgICB0aXRsZT17aW50bC5mb3JtYXRNZXNzYWdlKG1lc3NhZ2VzLmRlY2ltYWxzKX1cbiAgICAgICAgICBpc1NlYXJjaGFibGU9e2ZhbHNlfVxuICAgICAgICAgIG9wdGlvbnM9e2RlY2ltYWxTZXBhcmF0b3JPcHRpb25zfVxuICAgICAgICAgIHZhbHVlPXtzdGF0ZS5zZXR0aW5ncz8uZGVjaW1hbFNlcGFyYXRvcn1cbiAgICAgICAgICBvbkNoYW5nZT17KGUpID0+IHtcbiAgICAgICAgICAgIGFjdGlvbnMuc2V0VXBsb2FkU2V0dGluZ3Moe1xuICAgICAgICAgICAgICBkZWNpbWFsU2VwYXJhdG9yOiBlLnRhcmdldC52YWx1ZSBhcyBEZWNpbWFsU2VwYXJhdG9yLFxuICAgICAgICAgICAgfSlcbiAgICAgICAgICB9fVxuICAgICAgICAvPlxuICAgICAgPC9kaXY+XG4gICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgKVxufVxuIl19 */",
|
|
1580
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$2
|
|
1581
|
+
};
|
|
1582
|
+
const UploadSeparator = () => {
|
|
1583
|
+
const intl = useIntl();
|
|
1584
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1585
|
+
state = _useImportResourcesCo.state,
|
|
1586
|
+
actions = _useImportResourcesCo.actions;
|
|
1587
|
+
return jsxs(Spacings.Stack, {
|
|
1588
|
+
scale: "m",
|
|
1589
|
+
children: [jsxs("div", {
|
|
1590
|
+
children: [jsx(Text.Subheadline, {
|
|
1591
|
+
as: "h4",
|
|
1592
|
+
intlMessage: messages$6.separatorTitle
|
|
1593
|
+
}), jsx(Text.Caption, {
|
|
1594
|
+
tone: "tertiary",
|
|
1595
|
+
intlMessage: messages$6.decimalsSeparatorDescription
|
|
1596
|
+
})]
|
|
1597
|
+
}), jsx("div", {
|
|
1598
|
+
css: _ref$1,
|
|
1599
|
+
children: jsx(SelectField, {
|
|
1600
|
+
title: intl.formatMessage(messages$6.decimals),
|
|
1601
|
+
isSearchable: false,
|
|
1602
|
+
options: decimalSeparatorOptions,
|
|
1603
|
+
value: state.settings?.decimalSeparator,
|
|
1604
|
+
onChange: e => {
|
|
1605
|
+
actions.setUploadSettings({
|
|
1606
|
+
decimalSeparator: e.target.value
|
|
1607
|
+
});
|
|
1608
|
+
}
|
|
1609
|
+
})
|
|
1610
|
+
})]
|
|
1611
|
+
});
|
|
1612
|
+
};
|
|
1613
|
+
|
|
1524
1614
|
var messages$5 = defineMessages({
|
|
1525
1615
|
publishProducts: {
|
|
1526
1616
|
id: 'ImportResourcesModal.settings.publishProducts',
|
|
@@ -1536,6 +1626,7 @@ const UploadProductSettings = () => {
|
|
|
1536
1626
|
state = _useImportResourcesCo.state,
|
|
1537
1627
|
actions = _useImportResourcesCo.actions;
|
|
1538
1628
|
return jsx(CheckboxInput, {
|
|
1629
|
+
"data-tracking-target": 'product_import-publish_checkbox',
|
|
1539
1630
|
isChecked: state.settings?.publish,
|
|
1540
1631
|
onChange: e => {
|
|
1541
1632
|
actions.setUploadSettings({
|
|
@@ -1583,28 +1674,28 @@ const Upload = () => {
|
|
|
1583
1674
|
},
|
|
1584
1675
|
children: jsx(Masking.Unmask, {
|
|
1585
1676
|
children: jsxs(Spacings.Stack, {
|
|
1586
|
-
scale: "
|
|
1677
|
+
scale: "l",
|
|
1587
1678
|
children: [isMultipleResourceTypes ? jsxs(Grid, {
|
|
1588
1679
|
gridRowGap: designTokens.spacingL,
|
|
1589
1680
|
gridTemplateColumns: `calc(${designTokens.constraint3} + ${designTokens.spacingL}) auto`,
|
|
1590
1681
|
children: [jsx(Grid.Item, {
|
|
1591
1682
|
children: jsx(Text.Body, {
|
|
1592
1683
|
isBold: true,
|
|
1593
|
-
intlMessage: messages$
|
|
1684
|
+
intlMessage: messages$8.dataType
|
|
1594
1685
|
})
|
|
1595
1686
|
}), jsx(Grid.Item, {
|
|
1596
1687
|
children: jsx(ResourceTypeSelection, {})
|
|
1597
1688
|
}), jsx(Grid.Item, {
|
|
1598
1689
|
children: jsx(Text.Body, {
|
|
1599
1690
|
isBold: true,
|
|
1600
|
-
intlMessage: messages$
|
|
1691
|
+
intlMessage: messages$8.instructions
|
|
1601
1692
|
})
|
|
1602
1693
|
}), jsx(Grid.Item, {
|
|
1603
1694
|
children: jsx(Instructions, {})
|
|
1604
1695
|
})]
|
|
1605
1696
|
}) : jsx(Fragment, {
|
|
1606
1697
|
children: jsx(Instructions, {})
|
|
1607
|
-
}), jsx(InfoBox, {}), jsx(Masking.Mask, {
|
|
1698
|
+
}), jsx(InfoBox, {}), jsx(UploadSeparator, {}), jsx(Masking.Mask, {
|
|
1608
1699
|
children: jsx(FileDropArea, {})
|
|
1609
1700
|
}), jsx(UploadSettings, {})]
|
|
1610
1701
|
})
|
|
@@ -2515,17 +2606,17 @@ const getChunkImport = locale => {
|
|
|
2515
2606
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
2516
2607
|
switch (intlLocale) {
|
|
2517
2608
|
case 'de':
|
|
2518
|
-
return import('./de-
|
|
2609
|
+
return import('./de-67bd98c5.esm.js');
|
|
2519
2610
|
case 'es':
|
|
2520
|
-
return import('./es-
|
|
2611
|
+
return import('./es-21c30725.esm.js');
|
|
2521
2612
|
case 'fr-FR':
|
|
2522
|
-
return import('./fr-FR-
|
|
2613
|
+
return import('./fr-FR-3c6878e4.esm.js');
|
|
2523
2614
|
case 'ja':
|
|
2524
2615
|
return import('./ja-73c088a7.esm.js');
|
|
2525
2616
|
case 'pt-BR':
|
|
2526
|
-
return import('./pt-BR-
|
|
2617
|
+
return import('./pt-BR-fa0b65c8.esm.js');
|
|
2527
2618
|
default:
|
|
2528
|
-
return import('./en-
|
|
2619
|
+
return import('./en-850d8c4a.esm.js');
|
|
2529
2620
|
}
|
|
2530
2621
|
};
|
|
2531
2622
|
const loadMessages = async locale => {
|
|
@@ -2605,4 +2696,4 @@ const ImportResourcesModal = props => {
|
|
|
2605
2696
|
};
|
|
2606
2697
|
ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
2607
2698
|
|
|
2608
|
-
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, FileIcon as a, useImportPermission as b, messages$
|
|
2699
|
+
export { EnabledDropArea as E, FileDropped as F, ImportResourcesModal as I, FileIcon as a, useImportPermission as b, messages$8 as m, useImportResourcesContext as u };
|