@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
|
@@ -79,23 +79,26 @@ var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceP
|
|
|
79
79
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
80
80
|
var DataTable__default = /*#__PURE__*/_interopDefault(DataTable);
|
|
81
81
|
|
|
82
|
-
function ownKeys$
|
|
83
|
-
function _objectSpread$
|
|
82
|
+
function ownKeys$i(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
83
|
+
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__default["default"](_context = ownKeys$i(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$i(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
84
|
+
// TODO: make this resource type specific
|
|
85
|
+
|
|
84
86
|
function reducer(state, action) {
|
|
85
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
87
|
+
if (action.type === 'setCurrentStep') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
86
88
|
currentStep: action.currentStep,
|
|
87
89
|
progress: 0
|
|
88
90
|
});
|
|
89
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
91
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
90
92
|
uploadFileResponse: action.uploadFileResponse
|
|
91
93
|
});
|
|
92
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
94
|
+
if (action.type === 'setResourceType') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
95
|
+
settings: undefined,
|
|
93
96
|
resourceType: action.resourceType
|
|
94
97
|
});
|
|
95
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
98
|
+
if (action.type === 'setContainerKey') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
96
99
|
containerKey: action.containerKey
|
|
97
100
|
});
|
|
98
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
101
|
+
if (action.type === 'cancelImport') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
99
102
|
currentStep: 1,
|
|
100
103
|
containerKey: undefined,
|
|
101
104
|
fileUploadErrors: [],
|
|
@@ -104,7 +107,7 @@ function reducer(state, action) {
|
|
|
104
107
|
dropAreaState: 'disabled',
|
|
105
108
|
progress: 0
|
|
106
109
|
});
|
|
107
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
110
|
+
if (action.type === 'uploadNewFile') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
108
111
|
currentStep: 1,
|
|
109
112
|
containerKey: undefined,
|
|
110
113
|
fileUploadErrors: [],
|
|
@@ -114,25 +117,30 @@ function reducer(state, action) {
|
|
|
114
117
|
progress: 0
|
|
115
118
|
});
|
|
116
119
|
if (action.type === 'setDroppedFile') {
|
|
117
|
-
return _objectSpread$
|
|
120
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
118
121
|
droppedFile: action.droppedFile
|
|
119
122
|
});
|
|
120
123
|
}
|
|
121
124
|
if (action.type === 'setFileUploadErrors') {
|
|
122
|
-
return _objectSpread$
|
|
125
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
123
126
|
fileUploadErrors: action.fileUploadErrors
|
|
124
127
|
});
|
|
125
128
|
}
|
|
126
129
|
if (action.type === 'setAbortController') {
|
|
127
|
-
return _objectSpread$
|
|
130
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
128
131
|
abortController: action.abortController
|
|
129
132
|
});
|
|
130
133
|
}
|
|
131
134
|
if (action.type === 'setProgress') {
|
|
132
|
-
return _objectSpread$
|
|
135
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
133
136
|
progress: action.progress
|
|
134
137
|
});
|
|
135
138
|
}
|
|
139
|
+
if (action.type === 'setUploadSettings') {
|
|
140
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
141
|
+
settings: _objectSpread$i(_objectSpread$i({}, state.settings), action.settings)
|
|
142
|
+
});
|
|
143
|
+
}
|
|
136
144
|
throw new Error(getUnknownActionError(action));
|
|
137
145
|
}
|
|
138
146
|
function getUnknownActionError(actionType) {
|
|
@@ -195,8 +203,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
195
203
|
return _createClass(HttpError);
|
|
196
204
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
197
205
|
|
|
198
|
-
function ownKeys$
|
|
199
|
-
function _objectSpread$
|
|
206
|
+
function ownKeys$h(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
207
|
+
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__default["default"](_context2 = ownKeys$h(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$h(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
200
208
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
201
209
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
202
210
|
};
|
|
@@ -208,7 +216,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
208
216
|
onSuccess = _ref2.onSuccess,
|
|
209
217
|
onError = _ref2.onError;
|
|
210
218
|
const options = applicationShell.createHttpClientOptions({
|
|
211
|
-
headers: _objectSpread$
|
|
219
|
+
headers: _objectSpread$h({
|
|
212
220
|
'Content-Type': 'application/json'
|
|
213
221
|
}, config?.headers)
|
|
214
222
|
});
|
|
@@ -325,9 +333,25 @@ const PERMISSIONS = {
|
|
|
325
333
|
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
326
334
|
ViewDiscountCodes: 'ViewDiscountCodes'
|
|
327
335
|
};
|
|
336
|
+
const ACTION_RIGHTS = {
|
|
337
|
+
PublishProducts: {
|
|
338
|
+
group: 'products',
|
|
339
|
+
name: 'PublishProducts'
|
|
340
|
+
},
|
|
341
|
+
UnpublishProducts: {
|
|
342
|
+
group: 'products',
|
|
343
|
+
name: 'UnpublishProducts'
|
|
344
|
+
}
|
|
345
|
+
};
|
|
328
346
|
|
|
329
|
-
function ownKeys$
|
|
330
|
-
function _objectSpread$
|
|
347
|
+
function ownKeys$g(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
348
|
+
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__default["default"](_context = ownKeys$g(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$g(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
349
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
350
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
351
|
+
_objectSpread$g(_objectSpread$g({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
352
|
+
|
|
353
|
+
function ownKeys$f(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
354
|
+
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__default["default"](_context2 = ownKeys$f(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$f(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
331
355
|
/**
|
|
332
356
|
* This function checks if the provided `expectedDelimiter` is used consistently in the first 10 lines of a CSV file.
|
|
333
357
|
* Returns a Promise that resolves to an object containing a boolean `isValid` property and the detected delimiter `delimiter`.
|
|
@@ -382,7 +406,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
382
406
|
};
|
|
383
407
|
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
384
408
|
let idCounter = 1;
|
|
385
|
-
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$
|
|
409
|
+
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$f(_objectSpread$f({}, uploadFileError), {}, {
|
|
386
410
|
id: String(idCounter++)
|
|
387
411
|
}));
|
|
388
412
|
};
|
|
@@ -527,8 +551,6 @@ function uploadFileForImport(_ref) {
|
|
|
527
551
|
});
|
|
528
552
|
}
|
|
529
553
|
|
|
530
|
-
function ownKeys$d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
531
|
-
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__default["default"](_context2 = ownKeys$d(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$d(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
532
554
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
533
555
|
return asyncDispatch(sdk.actions.post({
|
|
534
556
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -537,9 +559,7 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
537
559
|
accept: 'application/json',
|
|
538
560
|
'Content-Type': 'application/json'
|
|
539
561
|
},
|
|
540
|
-
payload: _JSON$stringify__default["default"](
|
|
541
|
-
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
542
|
-
}))
|
|
562
|
+
payload: _JSON$stringify__default["default"](importContainerDraft)
|
|
543
563
|
}));
|
|
544
564
|
}
|
|
545
565
|
function deleteImportContainer(projectKey, containerKey, asyncDispatch) {
|
|
@@ -576,8 +596,8 @@ function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
|
576
596
|
throw new Error('Invalid response');
|
|
577
597
|
}
|
|
578
598
|
|
|
579
|
-
function ownKeys$
|
|
580
|
-
function _objectSpread$
|
|
599
|
+
function ownKeys$e(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
600
|
+
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__default["default"](_context = ownKeys$e(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$e(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
581
601
|
const ImportResourcesContext = /*#__PURE__*/React__default["default"].createContext();
|
|
582
602
|
const ImportResourcesProvider = props => {
|
|
583
603
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -585,7 +605,7 @@ const ImportResourcesProvider = props => {
|
|
|
585
605
|
})),
|
|
586
606
|
projectKey = _useApplicationContex.projectKey;
|
|
587
607
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
588
|
-
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$
|
|
608
|
+
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$e(_objectSpread$e({}, initialState), {}, {
|
|
589
609
|
resourceType: props.resourceTypes[0]
|
|
590
610
|
})),
|
|
591
611
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -629,6 +649,12 @@ const ImportResourcesProvider = props => {
|
|
|
629
649
|
type: 'setProgress',
|
|
630
650
|
progress
|
|
631
651
|
});
|
|
652
|
+
const setUploadSettings = nextSettings => {
|
|
653
|
+
dispatch({
|
|
654
|
+
type: 'setUploadSettings',
|
|
655
|
+
settings: nextSettings
|
|
656
|
+
});
|
|
657
|
+
};
|
|
632
658
|
const handleClose = function () {
|
|
633
659
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
634
660
|
shouldDeleteImportContainer = _ref.shouldDeleteImportContainer;
|
|
@@ -656,7 +682,8 @@ const ImportResourcesProvider = props => {
|
|
|
656
682
|
setContainerKey,
|
|
657
683
|
setAbortController,
|
|
658
684
|
setFileUploadErrors,
|
|
659
|
-
setProgress
|
|
685
|
+
setProgress,
|
|
686
|
+
setUploadSettings
|
|
660
687
|
}
|
|
661
688
|
},
|
|
662
689
|
children: props.children
|
|
@@ -715,13 +742,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
715
742
|
return /*#__PURE__*/react.css("" , "" );
|
|
716
743
|
}
|
|
717
744
|
|
|
718
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-
|
|
745
|
+
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-3353cf7c.cjs.prod.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
719
746
|
|
|
720
747
|
var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-99c1fa0b.cjs.prod.js' /* webpackChunkName: "disabled-drop-area" */); }));
|
|
721
748
|
|
|
722
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-
|
|
749
|
+
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-71390280.cjs.prod.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
723
750
|
|
|
724
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-
|
|
751
|
+
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-30e0efb8.cjs.prod.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
725
752
|
|
|
726
753
|
function getDropArea(_ref) {
|
|
727
754
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -759,7 +786,7 @@ function getDropAreaState(flags) {
|
|
|
759
786
|
return 'ready-for-drop';
|
|
760
787
|
}
|
|
761
788
|
|
|
762
|
-
var messages$
|
|
789
|
+
var messages$7 = reactIntl.defineMessages({
|
|
763
790
|
dragAndDropCSV: {
|
|
764
791
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
765
792
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -824,7 +851,7 @@ function useImportResourcesContext() {
|
|
|
824
851
|
return context;
|
|
825
852
|
}
|
|
826
853
|
|
|
827
|
-
var messages$
|
|
854
|
+
var messages$6 = reactIntl.defineMessages({
|
|
828
855
|
fileSizeExceededTitle: {
|
|
829
856
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
830
857
|
defaultMessage: 'File size exceeded'
|
|
@@ -884,6 +911,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
884
911
|
}
|
|
885
912
|
});
|
|
886
913
|
|
|
914
|
+
function ownKeys$d(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
915
|
+
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__default["default"](_context = ownKeys$d(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$d(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
887
916
|
const useUpload = () => {
|
|
888
917
|
const intl = reactIntl.useIntl();
|
|
889
918
|
const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
|
|
@@ -901,23 +930,23 @@ const useUpload = () => {
|
|
|
901
930
|
const errors = [];
|
|
902
931
|
const delimiterCheck = await checkDelimiter(file);
|
|
903
932
|
if (!delimiterCheck.isValid) errors.push({
|
|
904
|
-
title: intl.formatMessage(messages$
|
|
905
|
-
description: intl.formatMessage(messages$
|
|
933
|
+
title: intl.formatMessage(messages$6.dropAreaWrongDelimiterTitle),
|
|
934
|
+
description: intl.formatMessage(messages$6.dropAreaWrongDelimiterDescription)
|
|
906
935
|
});
|
|
907
936
|
const rowCount = await getRowCount(file);
|
|
908
937
|
if (rowCount < 1) errors.push({
|
|
909
|
-
title: intl.formatMessage(messages$
|
|
910
|
-
description: intl.formatMessage(messages$
|
|
938
|
+
title: intl.formatMessage(messages$6.dropAreaNotEnoughRowsTitle),
|
|
939
|
+
description: intl.formatMessage(messages$6.dropAreaNotEnoughRowsDescription)
|
|
911
940
|
});
|
|
912
941
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
913
|
-
title: intl.formatMessage(messages$
|
|
914
|
-
description: intl.formatMessage(messages$
|
|
942
|
+
title: intl.formatMessage(messages$6.fileSizeExceededTitle),
|
|
943
|
+
description: intl.formatMessage(messages$6.fileSizeExceededDescription, {
|
|
915
944
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
916
945
|
})
|
|
917
946
|
});
|
|
918
947
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
919
|
-
title: intl.formatMessage(messages$
|
|
920
|
-
description: intl.formatMessage(messages$
|
|
948
|
+
title: intl.formatMessage(messages$6.rowLimitExceededTitle),
|
|
949
|
+
description: intl.formatMessage(messages$6.rowLimitExceededDescription, {
|
|
921
950
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
922
951
|
})
|
|
923
952
|
});
|
|
@@ -936,16 +965,16 @@ const useUpload = () => {
|
|
|
936
965
|
if (error instanceof HttpError) {
|
|
937
966
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
938
967
|
actions.setFileUploadErrors([{
|
|
939
|
-
title: intl.formatMessage(messages$
|
|
940
|
-
description: intl.formatMessage(messages$
|
|
968
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
969
|
+
description: intl.formatMessage(messages$6.missingKeyError)
|
|
941
970
|
}]);
|
|
942
971
|
actions.setCurrentStep(3);
|
|
943
972
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
944
973
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
945
974
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
946
975
|
actions.setFileUploadErrors([{
|
|
947
|
-
title: intl.formatMessage(messages$
|
|
948
|
-
description: intl.formatMessage(messages$
|
|
976
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
977
|
+
description: intl.formatMessage(messages$6.missingRequiredKeys, {
|
|
949
978
|
fieldNames
|
|
950
979
|
})
|
|
951
980
|
}]);
|
|
@@ -958,7 +987,7 @@ const useUpload = () => {
|
|
|
958
987
|
showNotification({
|
|
959
988
|
kind: 'error',
|
|
960
989
|
domain: constants.DOMAINS.PAGE,
|
|
961
|
-
text: intl.formatMessage(messages$
|
|
990
|
+
text: intl.formatMessage(messages$6.unexpectedError)
|
|
962
991
|
});
|
|
963
992
|
}
|
|
964
993
|
} else {
|
|
@@ -987,10 +1016,21 @@ const useUpload = () => {
|
|
|
987
1016
|
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
988
1017
|
actions.setContainerKey(containerKey);
|
|
989
1018
|
try {
|
|
990
|
-
|
|
1019
|
+
// TODO: Temporarily apply settings only for products
|
|
1020
|
+
const shouldApplySettings = state.resourceType === 'product';
|
|
1021
|
+
await createImportContainerForFileUpload(_objectSpread$d({
|
|
991
1022
|
key: containerKey,
|
|
992
|
-
resourceType: state.resourceType
|
|
993
|
-
|
|
1023
|
+
resourceType: state.resourceType,
|
|
1024
|
+
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
1025
|
+
}, shouldApplySettings ? {
|
|
1026
|
+
settings: {
|
|
1027
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1028
|
+
format: 'CSV',
|
|
1029
|
+
options: {
|
|
1030
|
+
publishAllChanges: state.settings?.publish ?? false
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
} : {}), projectKey, asyncDispatch);
|
|
994
1034
|
const newAbortController = uploadFileForImport({
|
|
995
1035
|
projectKey,
|
|
996
1036
|
containerKey,
|
|
@@ -1051,8 +1091,8 @@ const useImportPermission = () => {
|
|
|
1051
1091
|
};
|
|
1052
1092
|
};
|
|
1053
1093
|
|
|
1054
|
-
function ownKeys$
|
|
1055
|
-
function _objectSpread$
|
|
1094
|
+
function ownKeys$c(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1095
|
+
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__default["default"](_context3 = ownKeys$c(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$c(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1056
1096
|
const FileDropArea = () => {
|
|
1057
1097
|
const intl = reactIntl.useIntl();
|
|
1058
1098
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1082,7 +1122,7 @@ const FileDropArea = () => {
|
|
|
1082
1122
|
showNotification({
|
|
1083
1123
|
kind: 'error',
|
|
1084
1124
|
domain: constants.DOMAINS.PAGE,
|
|
1085
|
-
text: intl.formatMessage(messages$
|
|
1125
|
+
text: intl.formatMessage(messages$7.tooManyFilesError)
|
|
1086
1126
|
});
|
|
1087
1127
|
return;
|
|
1088
1128
|
}
|
|
@@ -1090,13 +1130,13 @@ const FileDropArea = () => {
|
|
|
1090
1130
|
showNotification({
|
|
1091
1131
|
kind: 'error',
|
|
1092
1132
|
domain: constants.DOMAINS.PAGE,
|
|
1093
|
-
text: intl.formatMessage(messages$
|
|
1133
|
+
text: intl.formatMessage(messages$7.fileFormatNotSupported)
|
|
1094
1134
|
});
|
|
1095
1135
|
} else {
|
|
1096
1136
|
showNotification({
|
|
1097
1137
|
kind: 'error',
|
|
1098
1138
|
domain: constants.DOMAINS.PAGE,
|
|
1099
|
-
text: intl.formatMessage(messages$
|
|
1139
|
+
text: intl.formatMessage(messages$7.genericError)
|
|
1100
1140
|
});
|
|
1101
1141
|
}
|
|
1102
1142
|
}
|
|
@@ -1114,11 +1154,11 @@ const FileDropArea = () => {
|
|
|
1114
1154
|
resourceType: 'category',
|
|
1115
1155
|
isFileDropped: Boolean(state.droppedFile)
|
|
1116
1156
|
});
|
|
1117
|
-
return jsxRuntime.jsxs(DropWrapper, _objectSpread$
|
|
1157
|
+
return jsxRuntime.jsxs(DropWrapper, _objectSpread$c(_objectSpread$c({
|
|
1118
1158
|
role: "presentation"
|
|
1119
1159
|
}, getRootProps()), {}, {
|
|
1120
1160
|
dropAreaState: dropAreaState,
|
|
1121
|
-
children: [jsxRuntime.jsx("input", _objectSpread$
|
|
1161
|
+
children: [jsxRuntime.jsx("input", _objectSpread$c({
|
|
1122
1162
|
"data-testid": "file-input"
|
|
1123
1163
|
}, getInputProps())), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1124
1164
|
children: dropArea
|
|
@@ -1126,6 +1166,41 @@ const FileDropArea = () => {
|
|
|
1126
1166
|
}));
|
|
1127
1167
|
};
|
|
1128
1168
|
|
|
1169
|
+
var messages$5 = reactIntl.defineMessages({
|
|
1170
|
+
publishProducts: {
|
|
1171
|
+
id: 'ImportResourcesModal.settings.publishProducts',
|
|
1172
|
+
description: 'Label for the publish products checkbox',
|
|
1173
|
+
defaultMessage: 'Publish all products in the file'
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
|
|
1177
|
+
function ownKeys$b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1178
|
+
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__default["default"](_context = ownKeys$b(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1179
|
+
const UploadProductSettings = () => {
|
|
1180
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1181
|
+
state = _useImportResourcesCo.state,
|
|
1182
|
+
actions = _useImportResourcesCo.actions;
|
|
1183
|
+
return jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1184
|
+
isChecked: state.settings?.publish,
|
|
1185
|
+
onChange: e => {
|
|
1186
|
+
actions.setUploadSettings({
|
|
1187
|
+
publish: e.target.checked
|
|
1188
|
+
});
|
|
1189
|
+
},
|
|
1190
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$b({}, messages$5.publishProducts))
|
|
1191
|
+
});
|
|
1192
|
+
};
|
|
1193
|
+
const UploadSettings = () => {
|
|
1194
|
+
const _useImportResourcesCo2 = useImportResourcesContext(),
|
|
1195
|
+
state = _useImportResourcesCo2.state;
|
|
1196
|
+
const canPublishProducts = permissions.useIsAuthorized({
|
|
1197
|
+
demandedPermissions: [PERMISSIONS.ManageProducts],
|
|
1198
|
+
demandedActionRights: [ACTION_RIGHTS.PublishProducts]
|
|
1199
|
+
});
|
|
1200
|
+
if (state.resourceType === 'product' && canPublishProducts) return jsxRuntime.jsx(UploadProductSettings, {});
|
|
1201
|
+
return null;
|
|
1202
|
+
};
|
|
1203
|
+
|
|
1129
1204
|
var sharedMessages = reactIntl.defineMessages({
|
|
1130
1205
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
1131
1206
|
id: 'ImportResourcesModal.modalTitle.category',
|
|
@@ -1210,21 +1285,23 @@ const Upload = () => {
|
|
|
1210
1285
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1211
1286
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1212
1287
|
isBold: true,
|
|
1213
|
-
intlMessage: messages$
|
|
1288
|
+
intlMessage: messages$7.dataType
|
|
1214
1289
|
})
|
|
1215
1290
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1216
1291
|
children: jsxRuntime.jsx(ResourceTypeSelection, {})
|
|
1217
1292
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1218
1293
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1219
1294
|
isBold: true,
|
|
1220
|
-
intlMessage: messages$
|
|
1295
|
+
intlMessage: messages$7.instructions
|
|
1221
1296
|
})
|
|
1222
1297
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1223
1298
|
children: jsxRuntime.jsx(Instructions, {})
|
|
1224
1299
|
})]
|
|
1225
|
-
}) : jsxRuntime.jsx(
|
|
1300
|
+
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1301
|
+
children: jsxRuntime.jsx(Instructions, {})
|
|
1302
|
+
}), jsxRuntime.jsx(InfoBox, {}), jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1226
1303
|
children: jsxRuntime.jsx(FileDropArea, {})
|
|
1227
|
-
})]
|
|
1304
|
+
}), jsxRuntime.jsx(UploadSettings, {})]
|
|
1228
1305
|
})
|
|
1229
1306
|
})
|
|
1230
1307
|
});
|
|
@@ -1504,21 +1581,6 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1504
1581
|
description: 'Label for the modal Start import button',
|
|
1505
1582
|
defaultMessage: 'Start import'
|
|
1506
1583
|
},
|
|
1507
|
-
BodyText: {
|
|
1508
|
-
id: 'ImportResourcesModal.BodyText',
|
|
1509
|
-
description: 'Confirmation dialog text',
|
|
1510
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows to the project: <bold>{projectName}</bold>.'
|
|
1511
|
-
},
|
|
1512
|
-
BodyNote: {
|
|
1513
|
-
id: 'ImportResourcesModal.BodyNote',
|
|
1514
|
-
description: 'Confirmation dialog text',
|
|
1515
|
-
defaultMessage: 'Please be aware that existing values with the same keys will be overwritten by the data included in the CSV.'
|
|
1516
|
-
},
|
|
1517
|
-
BodyQuestion: {
|
|
1518
|
-
id: 'ImportResourcesModal.BodyQuestion',
|
|
1519
|
-
description: 'Confirmation question',
|
|
1520
|
-
defaultMessage: 'Proceed with the import?'
|
|
1521
|
-
},
|
|
1522
1584
|
importNotificationSuccessMessage: {
|
|
1523
1585
|
id: 'ImportResourcesModal.successMessage',
|
|
1524
1586
|
description: 'Notification success message',
|
|
@@ -1537,7 +1599,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1537
1599
|
rowsToBeImported: {
|
|
1538
1600
|
id: 'ImportResourcesModal.rowsToBeImported',
|
|
1539
1601
|
description: 'This message indicates the number of rows that are ready to be imported into the system.',
|
|
1540
|
-
defaultMessage: '<b>{rowCount}</b> rows to be imported'
|
|
1602
|
+
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 {}}'
|
|
1541
1603
|
},
|
|
1542
1604
|
columnsToBeImported: {
|
|
1543
1605
|
id: 'ImportResourcesModal.columnsToBeImported',
|
|
@@ -1567,7 +1629,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1567
1629
|
confirmationBodyText: {
|
|
1568
1630
|
id: 'ImportResourcesModal.confirmationBodyText',
|
|
1569
1631
|
description: 'Confirmation dialog text',
|
|
1570
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows
|
|
1632
|
+
defaultMessage: 'You are about to import {count, plural, one {<bold>1</bold> row} other {<bold>{count}</bold> rows}} in the project: <bold>{projectName}</bold>.'
|
|
1571
1633
|
},
|
|
1572
1634
|
confirmationBodyNote: {
|
|
1573
1635
|
id: 'ImportResourcesModal.confirmationBodyNote',
|
|
@@ -1582,35 +1644,40 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1582
1644
|
});
|
|
1583
1645
|
|
|
1584
1646
|
function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1585
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1647
|
+
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__default["default"](_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1648
|
+
const AlignedContainer = /*#__PURE__*/_styled__default["default"]("div", {
|
|
1649
|
+
target: "e1amawj91"
|
|
1650
|
+
} )({
|
|
1651
|
+
name: "1x0d6yz",
|
|
1652
|
+
styles: "padding-top:5px"
|
|
1653
|
+
} );
|
|
1654
|
+
const ModifiedTagList = /*#__PURE__*/_styled__default["default"](uiKit.TagList, {
|
|
1590
1655
|
target: "e1amawj90"
|
|
1591
|
-
} )(
|
|
1656
|
+
} )({
|
|
1657
|
+
name: "u9abxe",
|
|
1658
|
+
styles: ">div{margin:8px 8px 0 0;}"
|
|
1659
|
+
} );
|
|
1592
1660
|
const ColumnList = props => {
|
|
1661
|
+
var _context;
|
|
1593
1662
|
const _React$useState = React__default["default"].useState(false),
|
|
1594
1663
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1595
1664
|
isExpanded = _React$useState2[0],
|
|
1596
1665
|
setIsExpanded = _React$useState2[1];
|
|
1597
1666
|
const shouldShowExpandButton = props.columns.length > INITIAL_COLUMN_DISPLAY_COUNT;
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
children: [
|
|
1601
|
-
|
|
1667
|
+
const finalColumns = isExpanded ? props.columns : _sliceInstanceProperty__default["default"](_context = props.columns).call(_context, 0, INITIAL_COLUMN_DISPLAY_COUNT);
|
|
1668
|
+
return jsxRuntime.jsxs(ModifiedTagList, {
|
|
1669
|
+
children: [_mapInstanceProperty__default["default"](finalColumns).call(finalColumns, (column, index) => jsxRuntime.jsx(uiKit.Stamp, {
|
|
1670
|
+
label: column,
|
|
1671
|
+
tone: "secondary"
|
|
1672
|
+
}, index)), shouldShowExpandButton && jsxRuntime.jsx(AlignedContainer, {
|
|
1673
|
+
children: jsxRuntime.jsx(uiKit.Link, {
|
|
1674
|
+
to: "",
|
|
1602
1675
|
tone: "secondary",
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
e.preventDefault();
|
|
1609
|
-
setIsExpanded(!isExpanded);
|
|
1610
|
-
},
|
|
1611
|
-
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1612
|
-
})
|
|
1613
|
-
})]
|
|
1676
|
+
onClick: e => {
|
|
1677
|
+
e.preventDefault();
|
|
1678
|
+
setIsExpanded(!isExpanded);
|
|
1679
|
+
},
|
|
1680
|
+
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1614
1681
|
})
|
|
1615
1682
|
})]
|
|
1616
1683
|
});
|
|
@@ -1655,30 +1722,34 @@ function UploadPreviewModal() {
|
|
|
1655
1722
|
}), jsxRuntime.jsx(uiKit.Card, {
|
|
1656
1723
|
insetScale: "xl",
|
|
1657
1724
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1658
|
-
scale: "
|
|
1659
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.
|
|
1660
|
-
|
|
1661
|
-
children: [jsxRuntime.
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1725
|
+
scale: "s",
|
|
1726
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1727
|
+
scale: "xs",
|
|
1728
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1729
|
+
alignItems: "center",
|
|
1730
|
+
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1731
|
+
color: "success"
|
|
1732
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1733
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
|
|
1734
|
+
values: {
|
|
1735
|
+
rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
|
|
1736
|
+
publish: state.resourceType === 'product' && state.settings?.publish,
|
|
1737
|
+
b: getBold$1
|
|
1738
|
+
}
|
|
1739
|
+
})
|
|
1740
|
+
})]
|
|
1741
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1742
|
+
alignItems: "center",
|
|
1743
|
+
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1744
|
+
color: "success"
|
|
1745
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1746
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeImported), {}, {
|
|
1747
|
+
values: {
|
|
1748
|
+
columnCount: intl.formatNumber(validatedColumns.length),
|
|
1749
|
+
b: getBold$1
|
|
1750
|
+
}
|
|
1751
|
+
})
|
|
1752
|
+
})]
|
|
1682
1753
|
})]
|
|
1683
1754
|
}), jsxRuntime.jsx(ColumnList, {
|
|
1684
1755
|
columns: validatedColumns
|
|
@@ -1687,7 +1758,7 @@ function UploadPreviewModal() {
|
|
|
1687
1758
|
}), ignoredColumns.length > 0 && jsxRuntime.jsx(uiKit.Card, {
|
|
1688
1759
|
insetScale: "xl",
|
|
1689
1760
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1690
|
-
scale: "
|
|
1761
|
+
scale: "s",
|
|
1691
1762
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1692
1763
|
alignItems: "center",
|
|
1693
1764
|
children: [jsxRuntime.jsx(uiKit.EyeCrossedIcon, {
|
|
@@ -2108,19 +2179,19 @@ const getChunkImport = locale => {
|
|
|
2108
2179
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
2109
2180
|
switch (intlLocale) {
|
|
2110
2181
|
case 'de':
|
|
2111
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-
|
|
2182
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-22a8eb66.cjs.prod.js'); });
|
|
2112
2183
|
case 'es':
|
|
2113
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2184
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-01b24cea.cjs.prod.js'); });
|
|
2114
2185
|
case 'fr-FR':
|
|
2115
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
2186
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-2a0f5518.cjs.prod.js'); });
|
|
2116
2187
|
case 'zh-CN':
|
|
2117
2188
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-zh-CN" */'./zh-CN-52baa549.cjs.prod.js'); });
|
|
2118
2189
|
case 'ja':
|
|
2119
2190
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-ja" */'./ja-37632763.cjs.prod.js'); });
|
|
2120
2191
|
case 'pt-BR':
|
|
2121
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
2192
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-6b7a389e.cjs.prod.js'); });
|
|
2122
2193
|
default:
|
|
2123
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-
|
|
2194
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-8d84a827.cjs.prod.js'); });
|
|
2124
2195
|
}
|
|
2125
2196
|
};
|
|
2126
2197
|
const loadMessages = async locale => {
|
|
@@ -2203,6 +2274,6 @@ ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
|
2203
2274
|
exports.EnabledDropArea = EnabledDropArea;
|
|
2204
2275
|
exports.FileDropped = FileDropped;
|
|
2205
2276
|
exports.ImportResourcesModal = ImportResourcesModal;
|
|
2206
|
-
exports.messages = messages$
|
|
2277
|
+
exports.messages = messages$7;
|
|
2207
2278
|
exports.useImportPermission = useImportPermission;
|
|
2208
2279
|
exports.useImportResourcesContext = useImportResourcesContext;
|