@commercetools-frontend-extensions/import-resources-modal 1.3.18 → 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-2070870c.esm.js → active-drag-drop-area-02862be1.esm.js} +2 -1
- package/dist/{active-drag-drop-area-7223062d.cjs.prod.js → active-drag-drop-area-3353cf7c.cjs.prod.js} +2 -1
- package/dist/{active-drag-drop-area-71b18c95.cjs.dev.js → active-drag-drop-area-9097bdc0.cjs.dev.js} +2 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +9 -7
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +8 -6
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +8 -7
- 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/@hooks/index.d.ts +3 -0
- package/dist/declarations/src/@hooks/use-import-permission.d.ts +7 -0
- package/dist/declarations/src/@hooks/use-import-resources-context.d.ts +1 -0
- package/dist/declarations/src/@hooks/use-upload.d.ts +3 -0
- package/dist/declarations/src/@types/import-container.d.ts +14 -0
- package/dist/declarations/src/index.d.ts +1 -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-f7df6932.cjs.prod.js → enabled-drop-area-71390280.cjs.prod.js} +2 -1
- package/dist/{enabled-drop-area-30f931be.esm.js → enabled-drop-area-cecad6d0.esm.js} +2 -1
- package/dist/{enabled-drop-area-b0e2ad4d.cjs.dev.js → enabled-drop-area-dff17a22.cjs.dev.js} +2 -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-a1b8bc83.cjs.dev.js → file-dropped-area-30e0efb8.cjs.prod.js} +10 -9
- package/dist/{file-dropped-area-0856e6fe.esm.js → file-dropped-area-70859cc8.esm.js} +10 -9
- package/dist/{file-dropped-area-b394c5b4.cjs.prod.js → file-dropped-area-85c3b3a4.cjs.dev.js} +10 -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-fb10311d.cjs.dev.js → index-120dc76b.cjs.dev.js} +262 -129
- package/dist/{index-ed334c08.cjs.prod.js → index-169848a9.cjs.prod.js} +247 -128
- package/dist/{index-bbcef105.esm.js → index-fd6bbcc5.esm.js} +263 -131
- 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 +25 -23
- 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
|
@@ -48,6 +48,7 @@ var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
|
48
48
|
var _styled = require('@emotion/styled/base');
|
|
49
49
|
var react = require('@emotion/react');
|
|
50
50
|
var sentry = require('@commercetools-frontend/sentry');
|
|
51
|
+
var permissions = require('@commercetools-frontend/permissions');
|
|
51
52
|
var DataTable = require('@commercetools-uikit/data-table');
|
|
52
53
|
var i18n = require('@commercetools-frontend/i18n');
|
|
53
54
|
|
|
@@ -78,23 +79,26 @@ var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceP
|
|
|
78
79
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
79
80
|
var DataTable__default = /*#__PURE__*/_interopDefault(DataTable);
|
|
80
81
|
|
|
81
|
-
function ownKeys$
|
|
82
|
-
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
|
+
|
|
83
86
|
function reducer(state, action) {
|
|
84
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
87
|
+
if (action.type === 'setCurrentStep') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
85
88
|
currentStep: action.currentStep,
|
|
86
89
|
progress: 0
|
|
87
90
|
});
|
|
88
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
91
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
89
92
|
uploadFileResponse: action.uploadFileResponse
|
|
90
93
|
});
|
|
91
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
94
|
+
if (action.type === 'setResourceType') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
95
|
+
settings: undefined,
|
|
92
96
|
resourceType: action.resourceType
|
|
93
97
|
});
|
|
94
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
98
|
+
if (action.type === 'setContainerKey') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
95
99
|
containerKey: action.containerKey
|
|
96
100
|
});
|
|
97
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
101
|
+
if (action.type === 'cancelImport') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
98
102
|
currentStep: 1,
|
|
99
103
|
containerKey: undefined,
|
|
100
104
|
fileUploadErrors: [],
|
|
@@ -103,7 +107,7 @@ function reducer(state, action) {
|
|
|
103
107
|
dropAreaState: 'disabled',
|
|
104
108
|
progress: 0
|
|
105
109
|
});
|
|
106
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
110
|
+
if (action.type === 'uploadNewFile') return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
107
111
|
currentStep: 1,
|
|
108
112
|
containerKey: undefined,
|
|
109
113
|
fileUploadErrors: [],
|
|
@@ -113,25 +117,30 @@ function reducer(state, action) {
|
|
|
113
117
|
progress: 0
|
|
114
118
|
});
|
|
115
119
|
if (action.type === 'setDroppedFile') {
|
|
116
|
-
return _objectSpread$
|
|
120
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
117
121
|
droppedFile: action.droppedFile
|
|
118
122
|
});
|
|
119
123
|
}
|
|
120
124
|
if (action.type === 'setFileUploadErrors') {
|
|
121
|
-
return _objectSpread$
|
|
125
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
122
126
|
fileUploadErrors: action.fileUploadErrors
|
|
123
127
|
});
|
|
124
128
|
}
|
|
125
129
|
if (action.type === 'setAbortController') {
|
|
126
|
-
return _objectSpread$
|
|
130
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
127
131
|
abortController: action.abortController
|
|
128
132
|
});
|
|
129
133
|
}
|
|
130
134
|
if (action.type === 'setProgress') {
|
|
131
|
-
return _objectSpread$
|
|
135
|
+
return _objectSpread$i(_objectSpread$i({}, state), {}, {
|
|
132
136
|
progress: action.progress
|
|
133
137
|
});
|
|
134
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
|
+
}
|
|
135
144
|
throw new Error(getUnknownActionError(action));
|
|
136
145
|
}
|
|
137
146
|
function getUnknownActionError(actionType) {
|
|
@@ -194,8 +203,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
194
203
|
return _createClass(HttpError);
|
|
195
204
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
196
205
|
|
|
197
|
-
function ownKeys$
|
|
198
|
-
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; }
|
|
199
208
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
200
209
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
201
210
|
};
|
|
@@ -207,7 +216,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
207
216
|
onSuccess = _ref2.onSuccess,
|
|
208
217
|
onError = _ref2.onError;
|
|
209
218
|
const options = applicationShell.createHttpClientOptions({
|
|
210
|
-
headers: _objectSpread$
|
|
219
|
+
headers: _objectSpread$h({
|
|
211
220
|
'Content-Type': 'application/json'
|
|
212
221
|
}, config?.headers)
|
|
213
222
|
});
|
|
@@ -310,8 +319,39 @@ const RESOURCE_TYPE_DOCUMENTATION_LINKS = {
|
|
|
310
319
|
|
|
311
320
|
const CT__API_DOCS_URL = 'https://docs.commercetools.com/api/';
|
|
312
321
|
|
|
313
|
-
|
|
314
|
-
|
|
322
|
+
const PERMISSIONS = {
|
|
323
|
+
// Categories
|
|
324
|
+
ManageCategories: 'ManageCategories',
|
|
325
|
+
ViewCategories: 'ViewCategories',
|
|
326
|
+
// Products
|
|
327
|
+
ManageProducts: 'ManageProducts',
|
|
328
|
+
ViewProducts: 'ViewProducts',
|
|
329
|
+
// ProductTypes
|
|
330
|
+
ManageProductTypes: 'ManageProductTypes',
|
|
331
|
+
ViewProductTypes: 'ViewProductTypes',
|
|
332
|
+
// DiscountCodes
|
|
333
|
+
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
334
|
+
ViewDiscountCodes: 'ViewDiscountCodes'
|
|
335
|
+
};
|
|
336
|
+
const ACTION_RIGHTS = {
|
|
337
|
+
PublishProducts: {
|
|
338
|
+
group: 'products',
|
|
339
|
+
name: 'PublishProducts'
|
|
340
|
+
},
|
|
341
|
+
UnpublishProducts: {
|
|
342
|
+
group: 'products',
|
|
343
|
+
name: 'UnpublishProducts'
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
|
|
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; }
|
|
315
355
|
/**
|
|
316
356
|
* This function checks if the provided `expectedDelimiter` is used consistently in the first 10 lines of a CSV file.
|
|
317
357
|
* Returns a Promise that resolves to an object containing a boolean `isValid` property and the detected delimiter `delimiter`.
|
|
@@ -366,7 +406,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
366
406
|
};
|
|
367
407
|
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
368
408
|
let idCounter = 1;
|
|
369
|
-
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$
|
|
409
|
+
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$f(_objectSpread$f({}, uploadFileError), {}, {
|
|
370
410
|
id: String(idCounter++)
|
|
371
411
|
}));
|
|
372
412
|
};
|
|
@@ -511,8 +551,6 @@ function uploadFileForImport(_ref) {
|
|
|
511
551
|
});
|
|
512
552
|
}
|
|
513
553
|
|
|
514
|
-
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; }
|
|
515
|
-
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; }
|
|
516
554
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
517
555
|
return asyncDispatch(sdk.actions.post({
|
|
518
556
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -521,9 +559,7 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
521
559
|
accept: 'application/json',
|
|
522
560
|
'Content-Type': 'application/json'
|
|
523
561
|
},
|
|
524
|
-
payload: _JSON$stringify__default["default"](
|
|
525
|
-
tags: [TAG_KEY_SOURCE_FILE_UPLOAD]
|
|
526
|
-
}))
|
|
562
|
+
payload: _JSON$stringify__default["default"](importContainerDraft)
|
|
527
563
|
}));
|
|
528
564
|
}
|
|
529
565
|
function deleteImportContainer(projectKey, containerKey, asyncDispatch) {
|
|
@@ -560,8 +596,8 @@ function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
|
560
596
|
throw new Error('Invalid response');
|
|
561
597
|
}
|
|
562
598
|
|
|
563
|
-
function ownKeys$
|
|
564
|
-
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; }
|
|
565
601
|
const ImportResourcesContext = /*#__PURE__*/React__default["default"].createContext();
|
|
566
602
|
const ImportResourcesProvider = props => {
|
|
567
603
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -569,7 +605,7 @@ const ImportResourcesProvider = props => {
|
|
|
569
605
|
})),
|
|
570
606
|
projectKey = _useApplicationContex.projectKey;
|
|
571
607
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
572
|
-
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$
|
|
608
|
+
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$e(_objectSpread$e({}, initialState), {}, {
|
|
573
609
|
resourceType: props.resourceTypes[0]
|
|
574
610
|
})),
|
|
575
611
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -613,6 +649,12 @@ const ImportResourcesProvider = props => {
|
|
|
613
649
|
type: 'setProgress',
|
|
614
650
|
progress
|
|
615
651
|
});
|
|
652
|
+
const setUploadSettings = nextSettings => {
|
|
653
|
+
dispatch({
|
|
654
|
+
type: 'setUploadSettings',
|
|
655
|
+
settings: nextSettings
|
|
656
|
+
});
|
|
657
|
+
};
|
|
616
658
|
const handleClose = function () {
|
|
617
659
|
let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
618
660
|
shouldDeleteImportContainer = _ref.shouldDeleteImportContainer;
|
|
@@ -640,7 +682,8 @@ const ImportResourcesProvider = props => {
|
|
|
640
682
|
setContainerKey,
|
|
641
683
|
setAbortController,
|
|
642
684
|
setFileUploadErrors,
|
|
643
|
-
setProgress
|
|
685
|
+
setProgress,
|
|
686
|
+
setUploadSettings
|
|
644
687
|
}
|
|
645
688
|
},
|
|
646
689
|
children: props.children
|
|
@@ -702,13 +745,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
702
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== */");
|
|
703
746
|
}
|
|
704
747
|
|
|
705
|
-
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-9097bdc0.cjs.dev.js' /* webpackChunkName: "active-drag-drop-area" */); }));
|
|
706
749
|
|
|
707
750
|
var DisabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./disabled-drop-area-aa78075b.cjs.dev.js' /* webpackChunkName: "disabled-drop-area" */); }));
|
|
708
751
|
|
|
709
|
-
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-dff17a22.cjs.dev.js' /* webpackChunkName: "enabled-drop-area" */); }));
|
|
710
753
|
|
|
711
|
-
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-85c3b3a4.cjs.dev.js' /* webpackChunkName: "filed-dropped-area" */); }));
|
|
712
755
|
|
|
713
756
|
function getDropArea(_ref) {
|
|
714
757
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -746,7 +789,7 @@ function getDropAreaState(flags) {
|
|
|
746
789
|
return 'ready-for-drop';
|
|
747
790
|
}
|
|
748
791
|
|
|
749
|
-
var messages$
|
|
792
|
+
var messages$7 = reactIntl.defineMessages({
|
|
750
793
|
dragAndDropCSV: {
|
|
751
794
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
752
795
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -811,7 +854,7 @@ function useImportResourcesContext() {
|
|
|
811
854
|
return context;
|
|
812
855
|
}
|
|
813
856
|
|
|
814
|
-
var messages$
|
|
857
|
+
var messages$6 = reactIntl.defineMessages({
|
|
815
858
|
fileSizeExceededTitle: {
|
|
816
859
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
817
860
|
defaultMessage: 'File size exceeded'
|
|
@@ -871,6 +914,8 @@ var messages$5 = reactIntl.defineMessages({
|
|
|
871
914
|
}
|
|
872
915
|
});
|
|
873
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; }
|
|
874
919
|
const useUpload = () => {
|
|
875
920
|
const intl = reactIntl.useIntl();
|
|
876
921
|
const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
|
|
@@ -888,23 +933,23 @@ const useUpload = () => {
|
|
|
888
933
|
const errors = [];
|
|
889
934
|
const delimiterCheck = await checkDelimiter(file);
|
|
890
935
|
if (!delimiterCheck.isValid) errors.push({
|
|
891
|
-
title: intl.formatMessage(messages$
|
|
892
|
-
description: intl.formatMessage(messages$
|
|
936
|
+
title: intl.formatMessage(messages$6.dropAreaWrongDelimiterTitle),
|
|
937
|
+
description: intl.formatMessage(messages$6.dropAreaWrongDelimiterDescription)
|
|
893
938
|
});
|
|
894
939
|
const rowCount = await getRowCount(file);
|
|
895
940
|
if (rowCount < 1) errors.push({
|
|
896
|
-
title: intl.formatMessage(messages$
|
|
897
|
-
description: intl.formatMessage(messages$
|
|
941
|
+
title: intl.formatMessage(messages$6.dropAreaNotEnoughRowsTitle),
|
|
942
|
+
description: intl.formatMessage(messages$6.dropAreaNotEnoughRowsDescription)
|
|
898
943
|
});
|
|
899
944
|
if (state.resourceType && file.size > toBytes(FILE_SIZE_LIMITS_MB[state.resourceType])) errors.push({
|
|
900
|
-
title: intl.formatMessage(messages$
|
|
901
|
-
description: intl.formatMessage(messages$
|
|
945
|
+
title: intl.formatMessage(messages$6.fileSizeExceededTitle),
|
|
946
|
+
description: intl.formatMessage(messages$6.fileSizeExceededDescription, {
|
|
902
947
|
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMITS_MB[state.resourceType])
|
|
903
948
|
})
|
|
904
949
|
});
|
|
905
950
|
if (state.resourceType && rowCount > ROW_LIMITS[state.resourceType]) errors.push({
|
|
906
|
-
title: intl.formatMessage(messages$
|
|
907
|
-
description: intl.formatMessage(messages$
|
|
951
|
+
title: intl.formatMessage(messages$6.rowLimitExceededTitle),
|
|
952
|
+
description: intl.formatMessage(messages$6.rowLimitExceededDescription, {
|
|
908
953
|
rowLimit: intl.formatNumber(ROW_LIMITS[state.resourceType])
|
|
909
954
|
})
|
|
910
955
|
});
|
|
@@ -923,16 +968,16 @@ const useUpload = () => {
|
|
|
923
968
|
if (error instanceof HttpError) {
|
|
924
969
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
925
970
|
actions.setFileUploadErrors([{
|
|
926
|
-
title: intl.formatMessage(messages$
|
|
927
|
-
description: intl.formatMessage(messages$
|
|
971
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
972
|
+
description: intl.formatMessage(messages$6.missingKeyError)
|
|
928
973
|
}]);
|
|
929
974
|
actions.setCurrentStep(3);
|
|
930
975
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
931
976
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
932
977
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
933
978
|
actions.setFileUploadErrors([{
|
|
934
|
-
title: intl.formatMessage(messages$
|
|
935
|
-
description: intl.formatMessage(messages$
|
|
979
|
+
title: intl.formatMessage(messages$6.missingRequiredField),
|
|
980
|
+
description: intl.formatMessage(messages$6.missingRequiredKeys, {
|
|
936
981
|
fieldNames
|
|
937
982
|
})
|
|
938
983
|
}]);
|
|
@@ -945,7 +990,7 @@ const useUpload = () => {
|
|
|
945
990
|
showNotification({
|
|
946
991
|
kind: 'error',
|
|
947
992
|
domain: constants.DOMAINS.PAGE,
|
|
948
|
-
text: intl.formatMessage(messages$
|
|
993
|
+
text: intl.formatMessage(messages$6.unexpectedError)
|
|
949
994
|
});
|
|
950
995
|
}
|
|
951
996
|
} else {
|
|
@@ -974,10 +1019,21 @@ const useUpload = () => {
|
|
|
974
1019
|
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
975
1020
|
actions.setContainerKey(containerKey);
|
|
976
1021
|
try {
|
|
977
|
-
|
|
1022
|
+
// TODO: Temporarily apply settings only for products
|
|
1023
|
+
const shouldApplySettings = state.resourceType === 'product';
|
|
1024
|
+
await createImportContainerForFileUpload(_objectSpread$d({
|
|
978
1025
|
key: containerKey,
|
|
979
|
-
resourceType: state.resourceType
|
|
980
|
-
|
|
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);
|
|
981
1037
|
const newAbortController = uploadFileForImport({
|
|
982
1038
|
projectKey,
|
|
983
1039
|
containerKey,
|
|
@@ -1007,8 +1063,39 @@ const useUpload = () => {
|
|
|
1007
1063
|
};
|
|
1008
1064
|
};
|
|
1009
1065
|
|
|
1010
|
-
|
|
1011
|
-
|
|
1066
|
+
const useImportPermission = () => {
|
|
1067
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
1068
|
+
actionRights: applicationContext.actionRights?.products
|
|
1069
|
+
})),
|
|
1070
|
+
actionRights = _useApplicationContex.actionRights;
|
|
1071
|
+
const canManageProducts = permissions.useIsAuthorized({
|
|
1072
|
+
demandedPermissions: [PERMISSIONS.ManageProducts]
|
|
1073
|
+
});
|
|
1074
|
+
const canImportCategories = permissions.useIsAuthorized({
|
|
1075
|
+
demandedPermissions: [PERMISSIONS.ManageCategories]
|
|
1076
|
+
});
|
|
1077
|
+
const canImportDiscountCodes = permissions.useIsAuthorized({
|
|
1078
|
+
demandedPermissions: [PERMISSIONS.ManageDiscountCodes]
|
|
1079
|
+
});
|
|
1080
|
+
const canImportProducts = React.useMemo(() => {
|
|
1081
|
+
if (!actionRights) return false;
|
|
1082
|
+
const canAddPrices = actionRights.canAddPrices,
|
|
1083
|
+
canAddProducts = actionRights.canAddProducts,
|
|
1084
|
+
canEditAttributesAll = actionRights['canEditAttributes:all'],
|
|
1085
|
+
canEditPrices = actionRights.canEditPrices;
|
|
1086
|
+
return canManageProducts && canAddPrices && canAddProducts && canEditAttributesAll && canEditPrices;
|
|
1087
|
+
}, [canManageProducts, actionRights]);
|
|
1088
|
+
return {
|
|
1089
|
+
canImportProducts,
|
|
1090
|
+
canImportCategories,
|
|
1091
|
+
canImportDiscountCodes,
|
|
1092
|
+
canImportInventories: canManageProducts,
|
|
1093
|
+
canImportProductTypes: canManageProducts
|
|
1094
|
+
};
|
|
1095
|
+
};
|
|
1096
|
+
|
|
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; }
|
|
1012
1099
|
const FileDropArea = () => {
|
|
1013
1100
|
const intl = reactIntl.useIntl();
|
|
1014
1101
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1038,7 +1125,7 @@ const FileDropArea = () => {
|
|
|
1038
1125
|
showNotification({
|
|
1039
1126
|
kind: 'error',
|
|
1040
1127
|
domain: constants.DOMAINS.PAGE,
|
|
1041
|
-
text: intl.formatMessage(messages$
|
|
1128
|
+
text: intl.formatMessage(messages$7.tooManyFilesError)
|
|
1042
1129
|
});
|
|
1043
1130
|
return;
|
|
1044
1131
|
}
|
|
@@ -1046,13 +1133,13 @@ const FileDropArea = () => {
|
|
|
1046
1133
|
showNotification({
|
|
1047
1134
|
kind: 'error',
|
|
1048
1135
|
domain: constants.DOMAINS.PAGE,
|
|
1049
|
-
text: intl.formatMessage(messages$
|
|
1136
|
+
text: intl.formatMessage(messages$7.fileFormatNotSupported)
|
|
1050
1137
|
});
|
|
1051
1138
|
} else {
|
|
1052
1139
|
showNotification({
|
|
1053
1140
|
kind: 'error',
|
|
1054
1141
|
domain: constants.DOMAINS.PAGE,
|
|
1055
|
-
text: intl.formatMessage(messages$
|
|
1142
|
+
text: intl.formatMessage(messages$7.genericError)
|
|
1056
1143
|
});
|
|
1057
1144
|
}
|
|
1058
1145
|
}
|
|
@@ -1070,11 +1157,11 @@ const FileDropArea = () => {
|
|
|
1070
1157
|
resourceType: 'category',
|
|
1071
1158
|
isFileDropped: Boolean(state.droppedFile)
|
|
1072
1159
|
});
|
|
1073
|
-
return jsxRuntime.jsxs(DropWrapper, _objectSpread$
|
|
1160
|
+
return jsxRuntime.jsxs(DropWrapper, _objectSpread$c(_objectSpread$c({
|
|
1074
1161
|
role: "presentation"
|
|
1075
1162
|
}, getRootProps()), {}, {
|
|
1076
1163
|
dropAreaState: dropAreaState,
|
|
1077
|
-
children: [jsxRuntime.jsx("input", _objectSpread$
|
|
1164
|
+
children: [jsxRuntime.jsx("input", _objectSpread$c({
|
|
1078
1165
|
"data-testid": "file-input"
|
|
1079
1166
|
}, getInputProps())), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1080
1167
|
children: dropArea
|
|
@@ -1082,6 +1169,41 @@ const FileDropArea = () => {
|
|
|
1082
1169
|
}));
|
|
1083
1170
|
};
|
|
1084
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
|
+
|
|
1085
1207
|
var sharedMessages = reactIntl.defineMessages({
|
|
1086
1208
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
1087
1209
|
id: 'ImportResourcesModal.modalTitle.category',
|
|
@@ -1166,21 +1288,23 @@ const Upload = () => {
|
|
|
1166
1288
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1167
1289
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1168
1290
|
isBold: true,
|
|
1169
|
-
intlMessage: messages$
|
|
1291
|
+
intlMessage: messages$7.dataType
|
|
1170
1292
|
})
|
|
1171
1293
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1172
1294
|
children: jsxRuntime.jsx(ResourceTypeSelection, {})
|
|
1173
1295
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1174
1296
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1175
1297
|
isBold: true,
|
|
1176
|
-
intlMessage: messages$
|
|
1298
|
+
intlMessage: messages$7.instructions
|
|
1177
1299
|
})
|
|
1178
1300
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1179
1301
|
children: jsxRuntime.jsx(Instructions, {})
|
|
1180
1302
|
})]
|
|
1181
|
-
}) : jsxRuntime.jsx(
|
|
1303
|
+
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1304
|
+
children: jsxRuntime.jsx(Instructions, {})
|
|
1305
|
+
}), jsxRuntime.jsx(InfoBox, {}), jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1182
1306
|
children: jsxRuntime.jsx(FileDropArea, {})
|
|
1183
|
-
})]
|
|
1307
|
+
}), jsxRuntime.jsx(UploadSettings, {})]
|
|
1184
1308
|
})
|
|
1185
1309
|
})
|
|
1186
1310
|
});
|
|
@@ -1460,21 +1584,6 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1460
1584
|
description: 'Label for the modal Start import button',
|
|
1461
1585
|
defaultMessage: 'Start import'
|
|
1462
1586
|
},
|
|
1463
|
-
BodyText: {
|
|
1464
|
-
id: 'ImportResourcesModal.BodyText',
|
|
1465
|
-
description: 'Confirmation dialog text',
|
|
1466
|
-
defaultMessage: 'You are about to import <bold>{count}</bold> rows to the project: <bold>{projectName}</bold>.'
|
|
1467
|
-
},
|
|
1468
|
-
BodyNote: {
|
|
1469
|
-
id: 'ImportResourcesModal.BodyNote',
|
|
1470
|
-
description: 'Confirmation dialog text',
|
|
1471
|
-
defaultMessage: 'Please be aware that existing values with the same keys will be overwritten by the data included in the CSV.'
|
|
1472
|
-
},
|
|
1473
|
-
BodyQuestion: {
|
|
1474
|
-
id: 'ImportResourcesModal.BodyQuestion',
|
|
1475
|
-
description: 'Confirmation question',
|
|
1476
|
-
defaultMessage: 'Proceed with the import?'
|
|
1477
|
-
},
|
|
1478
1587
|
importNotificationSuccessMessage: {
|
|
1479
1588
|
id: 'ImportResourcesModal.successMessage',
|
|
1480
1589
|
description: 'Notification success message',
|
|
@@ -1493,7 +1602,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1493
1602
|
rowsToBeImported: {
|
|
1494
1603
|
id: 'ImportResourcesModal.rowsToBeImported',
|
|
1495
1604
|
description: 'This message indicates the number of rows that are ready to be imported into the system.',
|
|
1496
|
-
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 {}}'
|
|
1497
1606
|
},
|
|
1498
1607
|
columnsToBeImported: {
|
|
1499
1608
|
id: 'ImportResourcesModal.columnsToBeImported',
|
|
@@ -1523,7 +1632,7 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1523
1632
|
confirmationBodyText: {
|
|
1524
1633
|
id: 'ImportResourcesModal.confirmationBodyText',
|
|
1525
1634
|
description: 'Confirmation dialog text',
|
|
1526
|
-
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>.'
|
|
1527
1636
|
},
|
|
1528
1637
|
confirmationBodyNote: {
|
|
1529
1638
|
id: 'ImportResourcesModal.confirmationBodyNote',
|
|
@@ -1538,38 +1647,57 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1538
1647
|
});
|
|
1539
1648
|
|
|
1540
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; }
|
|
1541
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
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" ? {
|
|
1546
1667
|
target: "e1amawj90"
|
|
1547
1668
|
} : {
|
|
1548
1669
|
target: "e1amawj90",
|
|
1549
|
-
label: "
|
|
1550
|
-
})(
|
|
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
|
+
});
|
|
1551
1680
|
const ColumnList = props => {
|
|
1681
|
+
var _context;
|
|
1552
1682
|
const _React$useState = React__default["default"].useState(false),
|
|
1553
1683
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1554
1684
|
isExpanded = _React$useState2[0],
|
|
1555
1685
|
setIsExpanded = _React$useState2[1];
|
|
1556
1686
|
const shouldShowExpandButton = props.columns.length > INITIAL_COLUMN_DISPLAY_COUNT;
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
children: [
|
|
1560
|
-
|
|
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: "",
|
|
1561
1695
|
tone: "secondary",
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
e.preventDefault();
|
|
1568
|
-
setIsExpanded(!isExpanded);
|
|
1569
|
-
},
|
|
1570
|
-
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.showMore))
|
|
1571
|
-
})
|
|
1572
|
-
})]
|
|
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))
|
|
1573
1701
|
})
|
|
1574
1702
|
})]
|
|
1575
1703
|
});
|
|
@@ -1614,30 +1742,34 @@ function UploadPreviewModal() {
|
|
|
1614
1742
|
}), jsxRuntime.jsx(uiKit.Card, {
|
|
1615
1743
|
insetScale: "xl",
|
|
1616
1744
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1617
|
-
scale: "
|
|
1618
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.
|
|
1619
|
-
|
|
1620
|
-
children: [jsxRuntime.
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
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
|
+
})]
|
|
1641
1773
|
})]
|
|
1642
1774
|
}), jsxRuntime.jsx(ColumnList, {
|
|
1643
1775
|
columns: validatedColumns
|
|
@@ -1646,7 +1778,7 @@ function UploadPreviewModal() {
|
|
|
1646
1778
|
}), ignoredColumns.length > 0 && jsxRuntime.jsx(uiKit.Card, {
|
|
1647
1779
|
insetScale: "xl",
|
|
1648
1780
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1649
|
-
scale: "
|
|
1781
|
+
scale: "s",
|
|
1650
1782
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1651
1783
|
alignItems: "center",
|
|
1652
1784
|
children: [jsxRuntime.jsx(uiKit.EyeCrossedIcon, {
|
|
@@ -2078,19 +2210,19 @@ const getChunkImport = locale => {
|
|
|
2078
2210
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
2079
2211
|
switch (intlLocale) {
|
|
2080
2212
|
case 'de':
|
|
2081
|
-
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'); });
|
|
2082
2214
|
case 'es':
|
|
2083
|
-
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'); });
|
|
2084
2216
|
case 'fr-FR':
|
|
2085
|
-
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'); });
|
|
2086
2218
|
case 'zh-CN':
|
|
2087
2219
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-zh-CN" */'./zh-CN-d4bc6d26.cjs.dev.js'); });
|
|
2088
2220
|
case 'ja':
|
|
2089
2221
|
return Promise.resolve().then(function () { return require(/* webpackChunkName: "import-resources-modal-i18n-ja" */'./ja-9bd5f452.cjs.dev.js'); });
|
|
2090
2222
|
case 'pt-BR':
|
|
2091
|
-
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'); });
|
|
2092
2224
|
default:
|
|
2093
|
-
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-0b96b221.cjs.dev.js'); });
|
|
2094
2226
|
}
|
|
2095
2227
|
};
|
|
2096
2228
|
const loadMessages = async locale => {
|
|
@@ -2173,5 +2305,6 @@ ImportResourcesModal.displayName = 'ImportResourcesModal';
|
|
|
2173
2305
|
exports.EnabledDropArea = EnabledDropArea;
|
|
2174
2306
|
exports.FileDropped = FileDropped;
|
|
2175
2307
|
exports.ImportResourcesModal = ImportResourcesModal;
|
|
2176
|
-
exports.messages = messages$
|
|
2308
|
+
exports.messages = messages$7;
|
|
2309
|
+
exports.useImportPermission = useImportPermission;
|
|
2177
2310
|
exports.useImportResourcesContext = useImportResourcesContext;
|