@commercetools-frontend-extensions/import-resources-modal 1.3.19 → 1.4.1
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-14547b3b.esm.js} +1 -1
- package/dist/{active-drag-drop-area-f7b82691.cjs.prod.js → active-drag-drop-area-8c1a33ba.cjs.prod.js} +1 -1
- package/dist/{active-drag-drop-area-af12a9b1.cjs.dev.js → active-drag-drop-area-cef224e3.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-2d941c45.esm.js +244 -0
- package/dist/en-c12caec6.cjs.dev.js +246 -0
- package/dist/en-c80bec2f.cjs.prod.js +246 -0
- package/dist/{enabled-drop-area-e2c28a9e.esm.js → enabled-drop-area-77804d07.esm.js} +1 -1
- package/dist/{enabled-drop-area-ed0fd3ba.cjs.dev.js → enabled-drop-area-7e676557.cjs.dev.js} +1 -1
- package/dist/{enabled-drop-area-93e90a7a.cjs.prod.js → enabled-drop-area-f5edef91.cjs.prod.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-8a8a3de8.esm.js → file-dropped-area-01985830.esm.js} +9 -9
- package/dist/{file-dropped-area-16894986.cjs.prod.js → file-dropped-area-0f2194fc.cjs.prod.js} +9 -9
- package/dist/{file-dropped-area-b3ce24a7.cjs.dev.js → file-dropped-area-f4f37cd4.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-53c3ff29.cjs.dev.js} +214 -129
- package/dist/{index-02b35395.cjs.prod.js → index-d687055a.cjs.prod.js} +199 -128
- package/dist/{index-62b39c5f.esm.js → index-f96d232d.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
|
|
@@ -718,13 +745,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
718
745
|
return /*#__PURE__*/react.css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5kaXNhYmxlZFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
719
746
|
}
|
|
720
747
|
|
|
721
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-
|
|
748
|
+
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-cef224e3.cjs.dev.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
722
749
|
|
|
723
750
|
var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-aa78075b.cjs.dev.js' /* webpackChunkName: "disabled-drop-area" */); }));
|
|
724
751
|
|
|
725
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-
|
|
752
|
+
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-7e676557.cjs.dev.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
726
753
|
|
|
727
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-
|
|
754
|
+
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-f4f37cd4.cjs.dev.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
728
755
|
|
|
729
756
|
function getDropArea(_ref) {
|
|
730
757
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -762,7 +789,7 @@ function getDropAreaState(flags) {
|
|
|
762
789
|
return 'ready-for-drop';
|
|
763
790
|
}
|
|
764
791
|
|
|
765
|
-
var messages$
|
|
792
|
+
var messages$7 = reactIntl.defineMessages({
|
|
766
793
|
dragAndDropCSV: {
|
|
767
794
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
768
795
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -827,7 +854,7 @@ function useImportResourcesContext() {
|
|
|
827
854
|
return context;
|
|
828
855
|
}
|
|
829
856
|
|
|
830
|
-
var messages$
|
|
857
|
+
var messages$6 = reactIntl.defineMessages({
|
|
831
858
|
fileSizeExceededTitle: {
|
|
832
859
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
833
860
|
defaultMessage: 'File size exceeded'
|
|
@@ -887,6 +914,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
887
914
|
}
|
|
888
915
|
});
|
|
889
916
|
|
|
917
|
+
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; }
|
|
918
|
+
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; }
|
|
890
919
|
const useUpload = () => {
|
|
891
920
|
const intl = reactIntl.useIntl();
|
|
892
921
|
const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
|
|
@@ -904,23 +933,23 @@ const useUpload = () => {
|
|
|
904
933
|
const errors = [];
|
|
905
934
|
const delimiterCheck = await checkDelimiter(file);
|
|
906
935
|
if (!delimiterCheck.isValid) errors.push({
|
|
907
|
-
title: intl.formatMessage(messages$
|
|
908
|
-
description: intl.formatMessage(messages$
|
|
936
|
+
title: intl.formatMessage(messages$6.dropAreaWrongDelimiterTitle),
|
|
937
|
+
description: intl.formatMessage(messages$6.dropAreaWrongDelimiterDescription)
|
|
909
938
|
});
|
|
910
939
|
const rowCount = await getRowCount(file);
|
|
911
940
|
if (rowCount < 1) errors.push({
|
|
912
|
-
title: intl.formatMessage(messages$
|
|
913
|
-
description: intl.formatMessage(messages$
|
|
941
|
+
title: intl.formatMessage(messages$6.dropAreaNotEnoughRowsTitle),
|
|
942
|
+
description: intl.formatMessage(messages$6.dropAreaNotEnoughRowsDescription)
|
|
914
943
|
});
|
|
915
944
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
916
|
-
title: intl.formatMessage(messages$
|
|
917
|
-
description: intl.formatMessage(messages$
|
|
945
|
+
title: intl.formatMessage(messages$6.fileSizeExceededTitle),
|
|
946
|
+
description: intl.formatMessage(messages$6.fileSizeExceededDescription, {
|
|
918
947
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
919
948
|
})
|
|
920
949
|
});
|
|
921
950
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
922
|
-
title: intl.formatMessage(messages$
|
|
923
|
-
description: intl.formatMessage(messages$
|
|
951
|
+
title: intl.formatMessage(messages$6.rowLimitExceededTitle),
|
|
952
|
+
description: intl.formatMessage(messages$6.rowLimitExceededDescription, {
|
|
924
953
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
925
954
|
})
|
|
926
955
|
});
|
|
@@ -939,16 +968,16 @@ const useUpload = () => {
|
|
|
939
968
|
if (error instanceof HttpError) {
|
|
940
969
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
941
970
|
actions.setFileUploadErrors([{
|
|
942
|
-
title: intl.formatMessage(messages$
|
|
943
|
-
description: intl.formatMessage(messages$
|
|
971
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
972
|
+
description: intl.formatMessage(messages$6.missingKeyError)
|
|
944
973
|
}]);
|
|
945
974
|
actions.setCurrentStep(3);
|
|
946
975
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
947
976
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
948
977
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
949
978
|
actions.setFileUploadErrors([{
|
|
950
|
-
title: intl.formatMessage(messages$
|
|
951
|
-
description: intl.formatMessage(messages$
|
|
979
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
980
|
+
description: intl.formatMessage(messages$6.missingRequiredKeys, {
|
|
952
981
|
fieldNames
|
|
953
982
|
})
|
|
954
983
|
}]);
|
|
@@ -961,7 +990,7 @@ const useUpload = () => {
|
|
|
961
990
|
showNotification({
|
|
962
991
|
kind: 'error',
|
|
963
992
|
domain: constants.DOMAINS.PAGE,
|
|
964
|
-
text: intl.formatMessage(messages$
|
|
993
|
+
text: intl.formatMessage(messages$6.unexpectedError)
|
|
965
994
|
});
|
|
966
995
|
}
|
|
967
996
|
} else {
|
|
@@ -990,10 +1019,21 @@ const useUpload = () => {
|
|
|
990
1019
|
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
991
1020
|
actions.setContainerKey(containerKey);
|
|
992
1021
|
try {
|
|
993
|
-
|
|
1022
|
+
// TODO: Temporarily apply settings only for products
|
|
1023
|
+
const shouldApplySettings = state.resourceType === 'product';
|
|
1024
|
+
await createImportContainerForFileUpload(_objectSpread$d({
|
|
994
1025
|
key: containerKey,
|
|
995
|
-
resourceType: state.resourceType
|
|
996
|
-
|
|
1026
|
+
resourceType: state.resourceType,
|
|
1027
|
+
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
1028
|
+
}, shouldApplySettings ? {
|
|
1029
|
+
settings: {
|
|
1030
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1031
|
+
format: 'CSV',
|
|
1032
|
+
options: {
|
|
1033
|
+
publishAllChanges: state.settings?.publish ?? false
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
} : {}), projectKey, asyncDispatch);
|
|
997
1037
|
const newAbortController = uploadFileForImport({
|
|
998
1038
|
projectKey,
|
|
999
1039
|
containerKey,
|
|
@@ -1054,8 +1094,8 @@ const useImportPermission = () => {
|
|
|
1054
1094
|
};
|
|
1055
1095
|
};
|
|
1056
1096
|
|
|
1057
|
-
function ownKeys$
|
|
1058
|
-
function _objectSpread$
|
|
1097
|
+
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; }
|
|
1098
|
+
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; }
|
|
1059
1099
|
const FileDropArea = () => {
|
|
1060
1100
|
const intl = reactIntl.useIntl();
|
|
1061
1101
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1085,7 +1125,7 @@ const FileDropArea = () => {
|
|
|
1085
1125
|
showNotification({
|
|
1086
1126
|
kind: 'error',
|
|
1087
1127
|
domain: constants.DOMAINS.PAGE,
|
|
1088
|
-
text: intl.formatMessage(messages$
|
|
1128
|
+
text: intl.formatMessage(messages$7.tooManyFilesError)
|
|
1089
1129
|
});
|
|
1090
1130
|
return;
|
|
1091
1131
|
}
|
|
@@ -1093,13 +1133,13 @@ const FileDropArea = () => {
|
|
|
1093
1133
|
showNotification({
|
|
1094
1134
|
kind: 'error',
|
|
1095
1135
|
domain: constants.DOMAINS.PAGE,
|
|
1096
|
-
text: intl.formatMessage(messages$
|
|
1136
|
+
text: intl.formatMessage(messages$7.fileFormatNotSupported)
|
|
1097
1137
|
});
|
|
1098
1138
|
} else {
|
|
1099
1139
|
showNotification({
|
|
1100
1140
|
kind: 'error',
|
|
1101
1141
|
domain: constants.DOMAINS.PAGE,
|
|
1102
|
-
text: intl.formatMessage(messages$
|
|
1142
|
+
text: intl.formatMessage(messages$7.genericError)
|
|
1103
1143
|
});
|
|
1104
1144
|
}
|
|
1105
1145
|
}
|
|
@@ -1117,11 +1157,11 @@ const FileDropArea = () => {
|
|
|
1117
1157
|
resourceType: 'category',
|
|
1118
1158
|
isFileDropped: Boolean(state.droppedFile)
|
|
1119
1159
|
});
|
|
1120
|
-
return jsxRuntime.jsxs(DropWrapper, _objectSpread$
|
|
1160
|
+
return jsxRuntime.jsxs(DropWrapper, _objectSpread$c(_objectSpread$c({
|
|
1121
1161
|
role: "presentation"
|
|
1122
1162
|
}, getRootProps()), {}, {
|
|
1123
1163
|
dropAreaState: dropAreaState,
|
|
1124
|
-
children: [jsxRuntime.jsx("input", _objectSpread$
|
|
1164
|
+
children: [jsxRuntime.jsx("input", _objectSpread$c({
|
|
1125
1165
|
"data-testid": "file-input"
|
|
1126
1166
|
}, getInputProps())), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1127
1167
|
children: dropArea
|
|
@@ -1129,6 +1169,41 @@ const FileDropArea = () => {
|
|
|
1129
1169
|
}));
|
|
1130
1170
|
};
|
|
1131
1171
|
|
|
1172
|
+
var messages$5 = reactIntl.defineMessages({
|
|
1173
|
+
publishProducts: {
|
|
1174
|
+
id: 'ImportResourcesModal.settings.publishProducts',
|
|
1175
|
+
description: 'Label for the publish products checkbox',
|
|
1176
|
+
defaultMessage: 'Publish all products in the file'
|
|
1177
|
+
}
|
|
1178
|
+
});
|
|
1179
|
+
|
|
1180
|
+
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; }
|
|
1181
|
+
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; }
|
|
1182
|
+
const UploadProductSettings = () => {
|
|
1183
|
+
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1184
|
+
state = _useImportResourcesCo.state,
|
|
1185
|
+
actions = _useImportResourcesCo.actions;
|
|
1186
|
+
return jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1187
|
+
isChecked: state.settings?.publish,
|
|
1188
|
+
onChange: e => {
|
|
1189
|
+
actions.setUploadSettings({
|
|
1190
|
+
publish: e.target.checked
|
|
1191
|
+
});
|
|
1192
|
+
},
|
|
1193
|
+
children: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$b({}, messages$5.publishProducts))
|
|
1194
|
+
});
|
|
1195
|
+
};
|
|
1196
|
+
const UploadSettings = () => {
|
|
1197
|
+
const _useImportResourcesCo2 = useImportResourcesContext(),
|
|
1198
|
+
state = _useImportResourcesCo2.state;
|
|
1199
|
+
const canPublishProducts = permissions.useIsAuthorized({
|
|
1200
|
+
demandedPermissions: [PERMISSIONS.ManageProducts],
|
|
1201
|
+
demandedActionRights: [ACTION_RIGHTS.PublishProducts]
|
|
1202
|
+
});
|
|
1203
|
+
if (state.resourceType === 'product' && canPublishProducts) return jsxRuntime.jsx(UploadProductSettings, {});
|
|
1204
|
+
return null;
|
|
1205
|
+
};
|
|
1206
|
+
|
|
1132
1207
|
var sharedMessages = reactIntl.defineMessages({
|
|
1133
1208
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
1134
1209
|
id: 'ImportResourcesModal.modalTitle.category',
|
|
@@ -1213,21 +1288,23 @@ const Upload = () => {
|
|
|
1213
1288
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1214
1289
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1215
1290
|
isBold: true,
|
|
1216
|
-
intlMessage: messages$
|
|
1291
|
+
intlMessage: messages$7.dataType
|
|
1217
1292
|
})
|
|
1218
1293
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1219
1294
|
children: jsxRuntime.jsx(ResourceTypeSelection, {})
|
|
1220
1295
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1221
1296
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1222
1297
|
isBold: true,
|
|
1223
|
-
intlMessage: messages$
|
|
1298
|
+
intlMessage: messages$7.instructions
|
|
1224
1299
|
})
|
|
1225
1300
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1226
1301
|
children: jsxRuntime.jsx(Instructions, {})
|
|
1227
1302
|
})]
|
|
1228
|
-
}) : jsxRuntime.jsx(
|
|
1303
|
+
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1304
|
+
children: jsxRuntime.jsx(Instructions, {})
|
|
1305
|
+
}), jsxRuntime.jsx(InfoBox, {}), jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1229
1306
|
children: jsxRuntime.jsx(FileDropArea, {})
|
|
1230
|
-
})]
|
|
1307
|
+
}), jsxRuntime.jsx(UploadSettings, {})]
|
|
1231
1308
|
})
|
|
1232
1309
|
})
|
|
1233
1310
|
});
|
|
@@ -1507,21 +1584,6 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1507
1584
|
description: 'Label for the modal Start import button',
|
|
1508
1585
|
defaultMessage: 'Start import'
|
|
1509
1586
|
},
|
|
1510
|
-
BodyText: {
|
|
1511
|
-
id: 'ImportResourcesModal.BodyText',
|
|
1512
|
-
description: 'Confirmation dialog text',
|
|
1513
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows to the project: <bold>{projectName}</bold>.'
|
|
1514
|
-
},
|
|
1515
|
-
BodyNote: {
|
|
1516
|
-
id: 'ImportResourcesModal.BodyNote',
|
|
1517
|
-
description: 'Confirmation dialog text',
|
|
1518
|
-
defaultMessage: 'Please be aware that existing values with the same keys will be overwritten by the data included in the CSV.'
|
|
1519
|
-
},
|
|
1520
|
-
BodyQuestion: {
|
|
1521
|
-
id: 'ImportResourcesModal.BodyQuestion',
|
|
1522
|
-
description: 'Confirmation question',
|
|
1523
|
-
defaultMessage: 'Proceed with the import?'
|
|
1524
|
-
},
|
|
1525
1587
|
importNotificationSuccessMessage: {
|
|
1526
1588
|
id: 'ImportResourcesModal.successMessage',
|
|
1527
1589
|
description: 'Notification success message',
|
|
@@ -1540,7 +1602,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1540
1602
|
rowsToBeImported: {
|
|
1541
1603
|
id: 'ImportResourcesModal.rowsToBeImported',
|
|
1542
1604
|
description: 'This message indicates the number of rows that are ready to be imported into the system.',
|
|
1543
|
-
defaultMessage: '<b>{rowCount}</b> rows to be imported'
|
|
1605
|
+
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 {}}'
|
|
1544
1606
|
},
|
|
1545
1607
|
columnsToBeImported: {
|
|
1546
1608
|
id: 'ImportResourcesModal.columnsToBeImported',
|
|
@@ -1570,7 +1632,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1570
1632
|
confirmationBodyText: {
|
|
1571
1633
|
id: 'ImportResourcesModal.confirmationBodyText',
|
|
1572
1634
|
description: 'Confirmation dialog text',
|
|
1573
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows
|
|
1635
|
+
defaultMessage: 'You are about to import {count, plural, one {<bold>1</bold> row} other {<bold>{count}</bold> rows}} in the project: <bold>{projectName}</bold>.'
|
|
1574
1636
|
},
|
|
1575
1637
|
confirmationBodyNote: {
|
|
1576
1638
|
id: 'ImportResourcesModal.confirmationBodyNote',
|
|
@@ -1585,38 +1647,57 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1585
1647
|
});
|
|
1586
1648
|
|
|
1587
1649
|
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; }
|
|
1588
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1650
|
+
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; }
|
|
1651
|
+
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)."; }
|
|
1652
|
+
const AlignedContainer = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
1653
|
+
target: "e1amawj91"
|
|
1654
|
+
} : {
|
|
1655
|
+
target: "e1amawj91",
|
|
1656
|
+
label: "AlignedContainer"
|
|
1657
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
1658
|
+
name: "1x0d6yz",
|
|
1659
|
+
styles: "padding-top:5px"
|
|
1660
|
+
} : {
|
|
1661
|
+
name: "1x0d6yz",
|
|
1662
|
+
styles: "padding-top:5px",
|
|
1663
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbHVtbi1saXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFXMEMiLCJmaWxlIjoiY29sdW1uLWxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgRm9ybWF0dGVkTWVzc2FnZSB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyBMaW5rLCBTdGFtcCwgVGFnTGlzdCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnXG5pbXBvcnQgeyBJTklUSUFMX0NPTFVNTl9ESVNQTEFZX0NPVU5UIH0gZnJvbSAnLi4vLi4vQGNvbnN0YW50cydcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgY29sdW1uczogQXJyYXk8c3RyaW5nPlxufVxuXG5leHBvcnQgY29uc3QgQWxpZ25lZENvbnRhaW5lciA9IHN0eWxlZC5kaXZgXG4gIHBhZGRpbmctdG9wOiA1cHg7XG5gXG5cbmV4cG9ydCBjb25zdCBNb2RpZmllZFRhZ0xpc3QgPSBzdHlsZWQoVGFnTGlzdClgXG4gID4gZGl2IHtcbiAgICBtYXJnaW46IDhweCA4cHggMCAwO1xuICB9XG5gXG5cbmV4cG9ydCBjb25zdCBDb2x1bW5MaXN0ID0gKHByb3BzOiBSZWFjdC5Qcm9wc1dpdGhDaGlsZHJlbjxQcm9wcz4pID0+IHtcbiAgY29uc3QgW2lzRXhwYW5kZWQsIHNldElzRXhwYW5kZWRdID0gUmVhY3QudXNlU3RhdGUoZmFsc2UpXG4gIGNvbnN0IHNob3VsZFNob3dFeHBhbmRCdXR0b24gPVxuICAgIHByb3BzLmNvbHVtbnMubGVuZ3RoID4gSU5JVElBTF9DT0xVTU5fRElTUExBWV9DT1VOVFxuICBjb25zdCBmaW5hbENvbHVtbnMgPSBpc0V4cGFuZGVkXG4gICAgPyBwcm9wcy5jb2x1bW5zXG4gICAgOiBwcm9wcy5jb2x1bW5zLnNsaWNlKDAsIElOSVRJQUxfQ09MVU1OX0RJU1BMQVlfQ09VTlQpXG5cbiAgcmV0dXJuIChcbiAgICA8TW9kaWZpZWRUYWdMaXN0PlxuICAgICAge2ZpbmFsQ29sdW1ucy5tYXAoKGNvbHVtbjogc3RyaW5nLCBpbmRleDogbnVtYmVyKSA9PiAoXG4gICAgICAgIDxTdGFtcCBrZXk9e2luZGV4fSBsYWJlbD17Y29sdW1ufSB0b25lPVwic2Vjb25kYXJ5XCIgLz5cbiAgICAgICkpfVxuICAgICAge3Nob3VsZFNob3dFeHBhbmRCdXR0b24gJiYgKFxuICAgICAgICA8QWxpZ25lZENvbnRhaW5lcj5cbiAgICAgICAgICA8TGlua1xuICAgICAgICAgICAgdG89XCJcIlxuICAgICAgICAgICAgdG9uZT1cInNlY29uZGFyeVwiXG4gICAgICAgICAgICBvbkNsaWNrPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICAgICAgc2V0SXNFeHBhbmRlZCghaXNFeHBhbmRlZClcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2lzRXhwYW5kZWQgPyAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TGVzc30gLz5cbiAgICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TW9yZX0gLz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9MaW5rPlxuICAgICAgICA8L0FsaWduZWRDb250YWluZXI+XG4gICAgICApfVxuICAgIDwvTW9kaWZpZWRUYWdMaXN0PlxuICApXG59XG4iXX0= */",
|
|
1664
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
1665
|
+
});
|
|
1666
|
+
const ModifiedTagList = /*#__PURE__*/_styled__default["default"](uiKit.TagList, process.env.NODE_ENV === "production" ? {
|
|
1593
1667
|
target: "e1amawj90"
|
|
1594
1668
|
} : {
|
|
1595
1669
|
target: "e1amawj90",
|
|
1596
|
-
label: "
|
|
1597
|
-
})(
|
|
1670
|
+
label: "ModifiedTagList"
|
|
1671
|
+
})(process.env.NODE_ENV === "production" ? {
|
|
1672
|
+
name: "u9abxe",
|
|
1673
|
+
styles: ">div{margin:8px 8px 0 0;}"
|
|
1674
|
+
} : {
|
|
1675
|
+
name: "u9abxe",
|
|
1676
|
+
styles: ">div{margin:8px 8px 0 0;}",
|
|
1677
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbHVtbi1saXN0LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFlOEMiLCJmaWxlIjoiY29sdW1uLWxpc3QudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgRm9ybWF0dGVkTWVzc2FnZSB9IGZyb20gJ3JlYWN0LWludGwnXG5pbXBvcnQgeyBMaW5rLCBTdGFtcCwgVGFnTGlzdCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3VpLWtpdCdcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IG1lc3NhZ2VzIGZyb20gJy4vbWVzc2FnZXMnXG5pbXBvcnQgeyBJTklUSUFMX0NPTFVNTl9ESVNQTEFZX0NPVU5UIH0gZnJvbSAnLi4vLi4vQGNvbnN0YW50cydcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgY29sdW1uczogQXJyYXk8c3RyaW5nPlxufVxuXG5leHBvcnQgY29uc3QgQWxpZ25lZENvbnRhaW5lciA9IHN0eWxlZC5kaXZgXG4gIHBhZGRpbmctdG9wOiA1cHg7XG5gXG5cbmV4cG9ydCBjb25zdCBNb2RpZmllZFRhZ0xpc3QgPSBzdHlsZWQoVGFnTGlzdClgXG4gID4gZGl2IHtcbiAgICBtYXJnaW46IDhweCA4cHggMCAwO1xuICB9XG5gXG5cbmV4cG9ydCBjb25zdCBDb2x1bW5MaXN0ID0gKHByb3BzOiBSZWFjdC5Qcm9wc1dpdGhDaGlsZHJlbjxQcm9wcz4pID0+IHtcbiAgY29uc3QgW2lzRXhwYW5kZWQsIHNldElzRXhwYW5kZWRdID0gUmVhY3QudXNlU3RhdGUoZmFsc2UpXG4gIGNvbnN0IHNob3VsZFNob3dFeHBhbmRCdXR0b24gPVxuICAgIHByb3BzLmNvbHVtbnMubGVuZ3RoID4gSU5JVElBTF9DT0xVTU5fRElTUExBWV9DT1VOVFxuICBjb25zdCBmaW5hbENvbHVtbnMgPSBpc0V4cGFuZGVkXG4gICAgPyBwcm9wcy5jb2x1bW5zXG4gICAgOiBwcm9wcy5jb2x1bW5zLnNsaWNlKDAsIElOSVRJQUxfQ09MVU1OX0RJU1BMQVlfQ09VTlQpXG5cbiAgcmV0dXJuIChcbiAgICA8TW9kaWZpZWRUYWdMaXN0PlxuICAgICAge2ZpbmFsQ29sdW1ucy5tYXAoKGNvbHVtbjogc3RyaW5nLCBpbmRleDogbnVtYmVyKSA9PiAoXG4gICAgICAgIDxTdGFtcCBrZXk9e2luZGV4fSBsYWJlbD17Y29sdW1ufSB0b25lPVwic2Vjb25kYXJ5XCIgLz5cbiAgICAgICkpfVxuICAgICAge3Nob3VsZFNob3dFeHBhbmRCdXR0b24gJiYgKFxuICAgICAgICA8QWxpZ25lZENvbnRhaW5lcj5cbiAgICAgICAgICA8TGlua1xuICAgICAgICAgICAgdG89XCJcIlxuICAgICAgICAgICAgdG9uZT1cInNlY29uZGFyeVwiXG4gICAgICAgICAgICBvbkNsaWNrPXsoZSkgPT4ge1xuICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICAgICAgc2V0SXNFeHBhbmRlZCghaXNFeHBhbmRlZClcbiAgICAgICAgICAgIH19XG4gICAgICAgICAgPlxuICAgICAgICAgICAge2lzRXhwYW5kZWQgPyAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TGVzc30gLz5cbiAgICAgICAgICAgICkgOiAoXG4gICAgICAgICAgICAgIDxGb3JtYXR0ZWRNZXNzYWdlIHsuLi5tZXNzYWdlcy5zaG93TW9yZX0gLz5cbiAgICAgICAgICAgICl9XG4gICAgICAgICAgPC9MaW5rPlxuICAgICAgICA8L0FsaWduZWRDb250YWluZXI+XG4gICAgICApfVxuICAgIDwvTW9kaWZpZWRUYWdMaXN0PlxuICApXG59XG4iXX0= */",
|
|
1678
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
1679
|
+
});
|
|
1598
1680
|
const ColumnList = props => {
|
|
1681
|
+
var _context;
|
|
1599
1682
|
const _React$useState = React__default["default"].useState(false),
|
|
1600
1683
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1601
1684
|
isExpanded = _React$useState2[0],
|
|
1602
1685
|
setIsExpanded = _React$useState2[1];
|
|
1603
1686
|
const shouldShowExpandButton = props.columns.length > INITIAL_COLUMN_DISPLAY_COUNT;
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
children: [
|
|
1607
|
-
|
|
1687
|
+
const finalColumns = isExpanded ? props.columns : _sliceInstanceProperty__default["default"](_context = props.columns).call(_context, 0, INITIAL_COLUMN_DISPLAY_COUNT);
|
|
1688
|
+
return jsxRuntime.jsxs(ModifiedTagList, {
|
|
1689
|
+
children: [_mapInstanceProperty__default["default"](finalColumns).call(finalColumns, (column, index) => jsxRuntime.jsx(uiKit.Stamp, {
|
|
1690
|
+
label: column,
|
|
1691
|
+
tone: "secondary"
|
|
1692
|
+
}, index)), shouldShowExpandButton && jsxRuntime.jsx(AlignedContainer, {
|
|
1693
|
+
children: jsxRuntime.jsx(uiKit.Link, {
|
|
1694
|
+
to: "",
|
|
1608
1695
|
tone: "secondary",
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
e.preventDefault();
|
|
1615
|
-
setIsExpanded(!isExpanded);
|
|
1616
|
-
},
|
|
1617
|
-
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1618
|
-
})
|
|
1619
|
-
})]
|
|
1696
|
+
onClick: e => {
|
|
1697
|
+
e.preventDefault();
|
|
1698
|
+
setIsExpanded(!isExpanded);
|
|
1699
|
+
},
|
|
1700
|
+
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1620
1701
|
})
|
|
1621
1702
|
})]
|
|
1622
1703
|
});
|
|
@@ -1661,30 +1742,34 @@ function UploadPreviewModal() {
|
|
|
1661
1742
|
}), jsxRuntime.jsx(uiKit.Card, {
|
|
1662
1743
|
insetScale: "xl",
|
|
1663
1744
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1664
|
-
scale: "
|
|
1665
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.
|
|
1666
|
-
|
|
1667
|
-
children: [jsxRuntime.
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1745
|
+
scale: "s",
|
|
1746
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1747
|
+
scale: "xs",
|
|
1748
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1749
|
+
alignItems: "center",
|
|
1750
|
+
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1751
|
+
color: "success"
|
|
1752
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1753
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.rowsToBeImported), {}, {
|
|
1754
|
+
values: {
|
|
1755
|
+
rowCount: intl.formatNumber(state.uploadFileResponse.rowsCount),
|
|
1756
|
+
publish: state.resourceType === 'product' && state.settings?.publish,
|
|
1757
|
+
b: getBold$1
|
|
1758
|
+
}
|
|
1759
|
+
})
|
|
1760
|
+
})]
|
|
1761
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1762
|
+
alignItems: "center",
|
|
1763
|
+
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1764
|
+
color: "success"
|
|
1765
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1766
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.columnsToBeImported), {}, {
|
|
1767
|
+
values: {
|
|
1768
|
+
columnCount: intl.formatNumber(validatedColumns.length),
|
|
1769
|
+
b: getBold$1
|
|
1770
|
+
}
|
|
1771
|
+
})
|
|
1772
|
+
})]
|
|
1688
1773
|
})]
|
|
1689
1774
|
}), jsxRuntime.jsx(ColumnList, {
|
|
1690
1775
|
columns: validatedColumns
|
|
@@ -1693,7 +1778,7 @@ function UploadPreviewModal() {
|
|
|
1693
1778
|
}), ignoredColumns.length > 0 && jsxRuntime.jsx(uiKit.Card, {
|
|
1694
1779
|
insetScale: "xl",
|
|
1695
1780
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1696
|
-
scale: "
|
|
1781
|
+
scale: "s",
|
|
1697
1782
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1698
1783
|
alignItems: "center",
|
|
1699
1784
|
children: [jsxRuntime.jsx(uiKit.EyeCrossedIcon, {
|
|
@@ -2125,19 +2210,19 @@ const getChunkImport = locale => {
|
|
|
2125
2210
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
2126
2211
|
switch (intlLocale) {
|
|
2127
2212
|
case 'de':
|
|
2128
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-
|
|
2213
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-de" */'./de-fd3b70e4.cjs.dev.js'); });
|
|
2129
2214
|
case 'es':
|
|
2130
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-
|
|
2215
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-es" */'./es-a45120de.cjs.dev.js'); });
|
|
2131
2216
|
case 'fr-FR':
|
|
2132
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-
|
|
2217
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-fr-FR" */'./fr-FR-d51f6a8e.cjs.dev.js'); });
|
|
2133
2218
|
case 'zh-CN':
|
|
2134
2219
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-zh-CN" */'./zh-CN-d4bc6d26.cjs.dev.js'); });
|
|
2135
2220
|
case 'ja':
|
|
2136
2221
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-ja" */'./ja-9bd5f452.cjs.dev.js'); });
|
|
2137
2222
|
case 'pt-BR':
|
|
2138
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-
|
|
2223
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "change-history-i18n-pt-BR" */'./pt-BR-8b999c2f.cjs.dev.js'); });
|
|
2139
2224
|
default:
|
|
2140
|
-
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-
|
|
2225
|
+
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-en" */'./en-c12caec6.cjs.dev.js'); });
|
|
2141
2226
|
}
|
|
2142
2227
|
};
|
|
2143
2228
|
const loadMessages = async locale => {
|
|
@@ -2220,6 +2305,6 @@ ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
|
2220
2305
|
exports.EnabledDropArea = EnabledDropArea;
|
|
2221
2306
|
exports.FileDropped = FileDropped;
|
|
2222
2307
|
exports.ImportResourcesModal = ImportResourcesModal;
|
|
2223
|
-
exports.messages = messages$
|
|
2308
|
+
exports.messages = messages$7;
|
|
2224
2309
|
exports.useImportPermission = useImportPermission;
|
|
2225
2310
|
exports.useImportResourcesContext = useImportResourcesContext;
|