@commercetools-frontend-extensions/import-resources-modal 1.8.2 → 1.9.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-c8d1c499.cjs.dev.js → active-drag-drop-area-0467c118.cjs.dev.js} +1 -1
- package/dist/{active-drag-drop-area-08d8f60d.esm.js → active-drag-drop-area-294d353d.esm.js} +1 -1
- package/dist/{active-drag-drop-area-ea7d585c.cjs.prod.js → active-drag-drop-area-a995b09d.cjs.prod.js} +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +1 -1
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +1 -1
- package/dist/{de-ce1e957d.esm.js → de-19530b12.esm.js} +168 -20
- package/dist/{de-5181e779.cjs.dev.js → de-2836a9ae.cjs.prod.js} +168 -20
- package/dist/{de-3c758072.cjs.prod.js → de-db4fb974.cjs.dev.js} +168 -20
- package/dist/declarations/src/@hooks/use-import-permission.d.ts +2 -0
- package/dist/declarations/src/@types/resource-type.d.ts +2 -1
- package/dist/{disabled-drop-area-3e6427f5.cjs.prod.js → disabled-drop-area-16b58581.cjs.prod.js} +1 -1
- package/dist/{disabled-drop-area-d502e62b.cjs.dev.js → disabled-drop-area-4a639dbf.cjs.dev.js} +1 -1
- package/dist/{disabled-drop-area-0663121b.esm.js → disabled-drop-area-7ca6b04a.esm.js} +1 -1
- package/dist/{en-2f76b27a.esm.js → en-1f091237.esm.js} +168 -20
- package/dist/{en-d7cc7b15.cjs.prod.js → en-cb6893e4.cjs.prod.js} +168 -20
- package/dist/{en-7de3b07a.cjs.dev.js → en-f53130d1.cjs.dev.js} +168 -20
- package/dist/{enabled-drop-area-e0438b2d.cjs.prod.js → enabled-drop-area-1f50b766.cjs.prod.js} +1 -1
- package/dist/{enabled-drop-area-cc374582.esm.js → enabled-drop-area-9bf924fa.esm.js} +1 -1
- package/dist/{enabled-drop-area-314c679f.cjs.dev.js → enabled-drop-area-a4a76650.cjs.dev.js} +1 -1
- package/dist/{es-d9a57b63.cjs.dev.js → es-420f21e1.cjs.dev.js} +169 -21
- package/dist/{es-2b81e0cd.esm.js → es-a9aada13.esm.js} +169 -21
- package/dist/{es-a3c0e9b3.cjs.prod.js → es-f085026e.cjs.prod.js} +169 -21
- package/dist/{file-dropped-area-a31408ab.cjs.prod.js → file-dropped-area-84bc6912.cjs.prod.js} +1 -1
- package/dist/{file-dropped-area-6184d9a7.cjs.dev.js → file-dropped-area-9387283c.cjs.dev.js} +1 -1
- package/dist/{file-dropped-area-5b9a5695.esm.js → file-dropped-area-e6b5a3fa.esm.js} +1 -1
- package/dist/{fr-FR-084be771.esm.js → fr-FR-02bd52fb.esm.js} +169 -21
- package/dist/{fr-FR-cac38097.cjs.dev.js → fr-FR-342599f4.cjs.dev.js} +169 -21
- package/dist/{fr-FR-81499942.cjs.prod.js → fr-FR-dc40a55c.cjs.prod.js} +169 -21
- package/dist/{index-12a56d8e.esm.js → index-10a225f5.esm.js} +108 -47
- package/dist/{index-86e79ec0.cjs.dev.js → index-40da749a.cjs.dev.js} +108 -47
- package/dist/{index-9cf95c7a.cjs.prod.js → index-77194696.cjs.prod.js} +108 -47
- package/dist/{pt-BR-0fda1bcd.cjs.dev.js → pt-BR-31c46d23.cjs.prod.js} +169 -21
- package/dist/{pt-BR-0d2cb8bd.cjs.prod.js → pt-BR-339ed808.cjs.dev.js} +169 -21
- package/dist/{pt-BR-acd3f11d.esm.js → pt-BR-ac1fc192.esm.js} +169 -21
- package/package.json +21 -21
|
@@ -57,7 +57,8 @@ const EnabledResourceType = {
|
|
|
57
57
|
'discount-code': true,
|
|
58
58
|
customer: false,
|
|
59
59
|
order: false,
|
|
60
|
-
'product-type': false
|
|
60
|
+
'product-type': false,
|
|
61
|
+
'business-unit': true
|
|
61
62
|
};
|
|
62
63
|
function isResourceType(maybeResourceType) {
|
|
63
64
|
return typeof maybeResourceType === 'string' && maybeResourceType in EnabledResourceType;
|
|
@@ -87,27 +88,27 @@ let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
|
|
|
87
88
|
return CurrentStep;
|
|
88
89
|
}({});
|
|
89
90
|
|
|
90
|
-
function ownKeys$
|
|
91
|
-
function _objectSpread$
|
|
91
|
+
function ownKeys$j(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
92
|
+
function _objectSpread$j(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$j(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$j(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
92
93
|
|
|
93
94
|
// TODO: make this resource type specific
|
|
94
95
|
|
|
95
96
|
function reducer(state, action) {
|
|
96
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
97
|
+
if (action.type === 'setCurrentStep') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
97
98
|
currentStep: action.currentStep,
|
|
98
99
|
progress: 0
|
|
99
100
|
});
|
|
100
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
101
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
101
102
|
uploadFileResponse: action.uploadFileResponse
|
|
102
103
|
});
|
|
103
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
104
|
+
if (action.type === 'setResourceType') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
104
105
|
settings: undefined,
|
|
105
106
|
resourceType: action.resourceType
|
|
106
107
|
});
|
|
107
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
108
|
+
if (action.type === 'setContainerKey') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
108
109
|
containerKey: action.containerKey
|
|
109
110
|
});
|
|
110
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
111
|
+
if (action.type === 'cancelImport') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
111
112
|
currentStep: CurrentStep$1.Upload,
|
|
112
113
|
containerKey: undefined,
|
|
113
114
|
fileUploadErrors: [],
|
|
@@ -116,7 +117,7 @@ function reducer(state, action) {
|
|
|
116
117
|
dropAreaState: 'disabled',
|
|
117
118
|
progress: 0
|
|
118
119
|
});
|
|
119
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
120
|
+
if (action.type === 'uploadNewFile') return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
120
121
|
currentStep: CurrentStep$1.Upload,
|
|
121
122
|
containerKey: undefined,
|
|
122
123
|
fileUploadErrors: [],
|
|
@@ -126,28 +127,28 @@ function reducer(state, action) {
|
|
|
126
127
|
progress: 0
|
|
127
128
|
});
|
|
128
129
|
if (action.type === 'setDroppedFile') {
|
|
129
|
-
return _objectSpread$
|
|
130
|
+
return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
130
131
|
droppedFile: action.droppedFile
|
|
131
132
|
});
|
|
132
133
|
}
|
|
133
134
|
if (action.type === 'setFileUploadErrors') {
|
|
134
|
-
return _objectSpread$
|
|
135
|
+
return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
135
136
|
fileUploadErrors: action.fileUploadErrors
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
if (action.type === 'setAbortController') {
|
|
139
|
-
return _objectSpread$
|
|
140
|
+
return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
140
141
|
abortController: action.abortController
|
|
141
142
|
});
|
|
142
143
|
}
|
|
143
144
|
if (action.type === 'setProgress') {
|
|
144
|
-
return _objectSpread$
|
|
145
|
+
return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
145
146
|
progress: action.progress
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
149
|
if (action.type === 'setUploadSettings') {
|
|
149
|
-
return _objectSpread$
|
|
150
|
-
settings: _objectSpread$
|
|
150
|
+
return _objectSpread$j(_objectSpread$j({}, state), {}, {
|
|
151
|
+
settings: _objectSpread$j(_objectSpread$j({}, state.settings), action.settings)
|
|
151
152
|
});
|
|
152
153
|
}
|
|
153
154
|
throw new Error(getUnknownActionError(action));
|
|
@@ -212,8 +213,8 @@ let HttpError = /*#__PURE__*/function (_Error) {
|
|
|
212
213
|
return _createClass(HttpError);
|
|
213
214
|
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
214
215
|
|
|
215
|
-
function ownKeys$
|
|
216
|
-
function _objectSpread$
|
|
216
|
+
function ownKeys$i(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
217
|
+
function _objectSpread$i(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$i(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$i(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
217
218
|
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
218
219
|
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
219
220
|
};
|
|
@@ -225,7 +226,7 @@ const fetchUsingXhr = _ref2 => {
|
|
|
225
226
|
onSuccess = _ref2.onSuccess,
|
|
226
227
|
onError = _ref2.onError;
|
|
227
228
|
const options = createHttpClientOptions({
|
|
228
|
-
headers: _objectSpread$
|
|
229
|
+
headers: _objectSpread$i({
|
|
229
230
|
'Content-Type': 'application/json'
|
|
230
231
|
}, config?.headers)
|
|
231
232
|
});
|
|
@@ -286,7 +287,8 @@ const IMPORTABLE_RESOURCES = {
|
|
|
286
287
|
DISCOUNT_CODE: 'discount-code',
|
|
287
288
|
CUSTOMER: 'customer',
|
|
288
289
|
ORDER: 'order',
|
|
289
|
-
PRODUCT_TYPE: 'product-type'
|
|
290
|
+
PRODUCT_TYPE: 'product-type',
|
|
291
|
+
BUSINESS_UNIT: 'business-unit'
|
|
290
292
|
};
|
|
291
293
|
|
|
292
294
|
const FILE_SIZE_LIMITS_MB = {
|
|
@@ -296,7 +298,8 @@ const FILE_SIZE_LIMITS_MB = {
|
|
|
296
298
|
[IMPORTABLE_RESOURCES.DISCOUNT_CODE]: 35,
|
|
297
299
|
[IMPORTABLE_RESOURCES.CUSTOMER]: 0,
|
|
298
300
|
[IMPORTABLE_RESOURCES.ORDER]: 0,
|
|
299
|
-
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 35
|
|
301
|
+
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 35,
|
|
302
|
+
[IMPORTABLE_RESOURCES.BUSINESS_UNIT]: 35
|
|
300
303
|
};
|
|
301
304
|
const ROW_LIMITS = {
|
|
302
305
|
[IMPORTABLE_RESOURCES.CATEGORY]: 80_000,
|
|
@@ -305,7 +308,8 @@ const ROW_LIMITS = {
|
|
|
305
308
|
[IMPORTABLE_RESOURCES.DISCOUNT_CODE]: 80_000,
|
|
306
309
|
[IMPORTABLE_RESOURCES.CUSTOMER]: 0,
|
|
307
310
|
[IMPORTABLE_RESOURCES.ORDER]: 0,
|
|
308
|
-
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 80_000
|
|
311
|
+
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 80_000,
|
|
312
|
+
[IMPORTABLE_RESOURCES.BUSINESS_UNIT]: 80_000
|
|
309
313
|
};
|
|
310
314
|
const RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS = {
|
|
311
315
|
[IMPORTABLE_RESOURCES.CATEGORY]: 'https://docs.commercetools.com/merchant-center/downloads/category_import_template.csv',
|
|
@@ -314,7 +318,8 @@ const RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS = {
|
|
|
314
318
|
[IMPORTABLE_RESOURCES.DISCOUNT_CODE]: 'https://docs.commercetools.com/merchant-center/downloads/discount_code_import_template.csv',
|
|
315
319
|
[IMPORTABLE_RESOURCES.CUSTOMER]: 'https://docs.commercetools.com/merchant-center/import-data#download-a-template',
|
|
316
320
|
[IMPORTABLE_RESOURCES.ORDER]: 'https://docs.commercetools.com/merchant-center/import-data#download-a-template',
|
|
317
|
-
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 'https://docs.commercetools.com/merchant-center/downloads/product_type_import_template.csv'
|
|
321
|
+
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 'https://docs.commercetools.com/merchant-center/downloads/product_type_import_template.csv',
|
|
322
|
+
[IMPORTABLE_RESOURCES.BUSINESS_UNIT]: 'https://docs.commercetools.com/merchant-center/downloads/business_unit_import_template.csv'
|
|
318
323
|
};
|
|
319
324
|
const RESOURCE_TYPE_DOCUMENTATION_LINKS = {
|
|
320
325
|
[IMPORTABLE_RESOURCES.CATEGORY]: 'https://docs.commercetools.com/merchant-center/import-categories#supported-headers-and-values',
|
|
@@ -323,7 +328,8 @@ const RESOURCE_TYPE_DOCUMENTATION_LINKS = {
|
|
|
323
328
|
[IMPORTABLE_RESOURCES.DISCOUNT_CODE]: 'https://docs.commercetools.com/merchant-center/import-discount-codes#supported-headers-and-values',
|
|
324
329
|
[IMPORTABLE_RESOURCES.CUSTOMER]: 'https://docs.commercetools.com/merchant-center/import-customers#supported-headers-and-values',
|
|
325
330
|
[IMPORTABLE_RESOURCES.ORDER]: 'https://docs.commercetools.com/merchant-center/import-orders#supported-headers-and-values',
|
|
326
|
-
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 'https://docs.commercetools.com/merchant-center/import-product-types#supported-headers-and-values'
|
|
331
|
+
[IMPORTABLE_RESOURCES.PRODUCT_TYPE]: 'https://docs.commercetools.com/merchant-center/import-product-types#supported-headers-and-values',
|
|
332
|
+
[IMPORTABLE_RESOURCES.BUSINESS_UNIT]: 'https://docs.commercetools.com/merchant-center/import-business-units#supported-headers-and-values'
|
|
327
333
|
};
|
|
328
334
|
|
|
329
335
|
const CT_API_DOCS_URL = 'https://docs.commercetools.com/api/';
|
|
@@ -340,7 +346,19 @@ const PERMISSIONS = {
|
|
|
340
346
|
ViewProductTypes: 'ViewProductTypes',
|
|
341
347
|
// DiscountCodes
|
|
342
348
|
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
343
|
-
ViewDiscountCodes: 'ViewDiscountCodes'
|
|
349
|
+
ViewDiscountCodes: 'ViewDiscountCodes',
|
|
350
|
+
// Customers
|
|
351
|
+
ManageCustomers: 'ManageCustomers',
|
|
352
|
+
ViewCustomers: 'ViewCustomers',
|
|
353
|
+
// Orders
|
|
354
|
+
ManageOrders: 'ManageOrders',
|
|
355
|
+
ViewOrders: 'ViewOrders',
|
|
356
|
+
// KeyValueDocuments
|
|
357
|
+
ManageKeyValueDocuments: 'ManageKeyValueDocuments',
|
|
358
|
+
ViewKeyValueDocuments: 'ViewKeyValueDocuments',
|
|
359
|
+
// BusinessUnits
|
|
360
|
+
ManageBusinessUnits: 'ManageBusinessUnits',
|
|
361
|
+
ViewBusinessUnits: 'ViewBusinessUnits'
|
|
344
362
|
};
|
|
345
363
|
const ACTION_RIGHTS = {
|
|
346
364
|
PublishProducts: {
|
|
@@ -353,11 +371,11 @@ const ACTION_RIGHTS = {
|
|
|
353
371
|
}
|
|
354
372
|
};
|
|
355
373
|
|
|
356
|
-
function ownKeys$
|
|
357
|
-
function _objectSpread$
|
|
374
|
+
function ownKeys$h(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
375
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$h(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$h(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
358
376
|
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
359
377
|
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
360
|
-
_objectSpread$
|
|
378
|
+
_objectSpread$h(_objectSpread$h({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
361
379
|
|
|
362
380
|
var sharedMessages = defineMessages({
|
|
363
381
|
[`modalTitle.${IMPORTABLE_RESOURCES.CATEGORY}`]: {
|
|
@@ -380,6 +398,11 @@ var sharedMessages = defineMessages({
|
|
|
380
398
|
description: 'Label for the inventories modal title',
|
|
381
399
|
defaultMessage: 'Import discount codes by CSV'
|
|
382
400
|
},
|
|
401
|
+
[`modalTitle.${IMPORTABLE_RESOURCES.BUSINESS_UNIT}`]: {
|
|
402
|
+
id: 'ImportResourcesModal.modalTitle.businessUnit',
|
|
403
|
+
description: 'Label for the business units modal title',
|
|
404
|
+
defaultMessage: 'Import business units by CSV'
|
|
405
|
+
},
|
|
383
406
|
[`modalTitle.${IMPORTABLE_RESOURCES.CUSTOMER}`]: {
|
|
384
407
|
id: 'ImportResourcesModal.modalTitle.customer',
|
|
385
408
|
description: 'Label for the customers modal title',
|
|
@@ -586,6 +609,16 @@ var sharedMessages = defineMessages({
|
|
|
586
609
|
description: 'Label for the discount-codes resource type',
|
|
587
610
|
defaultMessage: 'Discount codes'
|
|
588
611
|
},
|
|
612
|
+
'business-unit': {
|
|
613
|
+
id: 'ImportResourcesModal.business-unit',
|
|
614
|
+
description: 'Label for the business-unit resource type',
|
|
615
|
+
defaultMessage: 'Business unit'
|
|
616
|
+
},
|
|
617
|
+
'business-units': {
|
|
618
|
+
id: 'ImportResourcesModal.business-units',
|
|
619
|
+
description: 'Label for the business-units resource type',
|
|
620
|
+
defaultMessage: 'Business units'
|
|
621
|
+
},
|
|
589
622
|
unknownResourceType: {
|
|
590
623
|
id: 'ImportResourcesModal.unknown-resource-type',
|
|
591
624
|
description: 'Label for the unknown resource type',
|
|
@@ -594,8 +627,8 @@ var sharedMessages = defineMessages({
|
|
|
594
627
|
//
|
|
595
628
|
});
|
|
596
629
|
|
|
597
|
-
function ownKeys$
|
|
598
|
-
function _objectSpread$
|
|
630
|
+
function ownKeys$g(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
631
|
+
function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context3 = ownKeys$g(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context4 = ownKeys$g(Object(t))).call(_context4, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
599
632
|
|
|
600
633
|
// Delimiters not included in this array may be treated as part of a column content
|
|
601
634
|
// potentially causing the file to be parsed as a single-column CSV and pass this validation
|
|
@@ -644,7 +677,7 @@ const mapUploadFileErrorsResponseToUploadFileErrorRows = uploadFileErrorsRespons
|
|
|
644
677
|
};
|
|
645
678
|
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
646
679
|
let idCounter = 1;
|
|
647
|
-
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$
|
|
680
|
+
return _mapInstanceProperty(uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$g(_objectSpread$g({}, uploadFileError), {}, {
|
|
648
681
|
id: String(idCounter++)
|
|
649
682
|
}));
|
|
650
683
|
};
|
|
@@ -757,6 +790,7 @@ function resourceTypeToMessage(resourceType) {
|
|
|
757
790
|
'product-variant-patch': sharedMessages['product-variant-patch'],
|
|
758
791
|
'standalone-price': sharedMessages['standalone-price'],
|
|
759
792
|
'custom-object': sharedMessages['custom-object'],
|
|
793
|
+
'business-unit': sharedMessages['business-unit'],
|
|
760
794
|
type: sharedMessages.type
|
|
761
795
|
};
|
|
762
796
|
const message = resourceTypeMap[resourceType];
|
|
@@ -782,7 +816,8 @@ function resourceTypeToPluralMessage(resourceType) {
|
|
|
782
816
|
'product-draft': sharedMessages['product-drafts'],
|
|
783
817
|
'product-variant': sharedMessages['product-variants'],
|
|
784
818
|
'product-variant-patch': sharedMessages['product-variant-patches'],
|
|
785
|
-
'standalone-price': sharedMessages['standalone-prices']
|
|
819
|
+
'standalone-price': sharedMessages['standalone-prices'],
|
|
820
|
+
'business-unit': sharedMessages['business-units']
|
|
786
821
|
};
|
|
787
822
|
const message = resourceTypePluralMap[resourceType];
|
|
788
823
|
if (!message) {
|
|
@@ -840,6 +875,8 @@ function uploadFileForImport(_ref) {
|
|
|
840
875
|
});
|
|
841
876
|
}
|
|
842
877
|
|
|
878
|
+
function ownKeys$f(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
879
|
+
function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context2 = ownKeys$f(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$f(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
843
880
|
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
844
881
|
return asyncDispatch(actions.post({
|
|
845
882
|
mcApiProxyTarget: MC_API_PROXY_TARGETS.IMPORT,
|
|
@@ -848,7 +885,14 @@ function createImportContainerForFileUpload(importContainerDraft, projectKey, as
|
|
|
848
885
|
accept: 'application/json',
|
|
849
886
|
'Content-Type': 'application/json'
|
|
850
887
|
},
|
|
851
|
-
payload: _JSON$stringify(
|
|
888
|
+
payload: _JSON$stringify(_objectSpread$f({
|
|
889
|
+
retentionPolicy: {
|
|
890
|
+
strategy: 'ttl',
|
|
891
|
+
config: {
|
|
892
|
+
timeToLive: '54h' // 2 days and 6 hours
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}, importContainerDraft))
|
|
852
896
|
}));
|
|
853
897
|
}
|
|
854
898
|
function deleteImportContainer(projectKey, containerKey, asyncDispatch) {
|
|
@@ -1034,13 +1078,13 @@ function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
|
1034
1078
|
return /*#__PURE__*/css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE0QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2Rpc2FibGVkJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5kaXNhYmxlZFxuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
1035
1079
|
}
|
|
1036
1080
|
|
|
1037
|
-
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-
|
|
1081
|
+
var ActiveDragDropArea = /*#__PURE__*/lazy(() => import('./active-drag-drop-area-294d353d.esm.js'));
|
|
1038
1082
|
|
|
1039
|
-
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-
|
|
1083
|
+
var DisabledDropArea = /*#__PURE__*/lazy(() => import('./disabled-drop-area-7ca6b04a.esm.js'));
|
|
1040
1084
|
|
|
1041
|
-
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-
|
|
1085
|
+
var EnabledDropArea = /*#__PURE__*/lazy(() => import('./enabled-drop-area-9bf924fa.esm.js'));
|
|
1042
1086
|
|
|
1043
|
-
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-
|
|
1087
|
+
var FileDropped = /*#__PURE__*/lazy(() => import('./file-dropped-area-e6b5a3fa.esm.js'));
|
|
1044
1088
|
|
|
1045
1089
|
function getDropArea(_ref) {
|
|
1046
1090
|
let dropAreaState = _ref.dropAreaState,
|
|
@@ -1362,12 +1406,24 @@ const useImportPermission = () => {
|
|
|
1362
1406
|
const canManageProducts = useIsAuthorized({
|
|
1363
1407
|
demandedPermissions: [PERMISSIONS.ManageProducts]
|
|
1364
1408
|
});
|
|
1365
|
-
const
|
|
1409
|
+
const canManageCustomers = useIsAuthorized({
|
|
1410
|
+
demandedPermissions: [PERMISSIONS.ManageCustomers]
|
|
1411
|
+
});
|
|
1412
|
+
const canManageOrders = useIsAuthorized({
|
|
1413
|
+
demandedPermissions: [PERMISSIONS.ManageOrders]
|
|
1414
|
+
});
|
|
1415
|
+
const canManageKeyValueDocuments = useIsAuthorized({
|
|
1416
|
+
demandedPermissions: [PERMISSIONS.ManageKeyValueDocuments]
|
|
1417
|
+
});
|
|
1418
|
+
const canMAnageCategories = useIsAuthorized({
|
|
1366
1419
|
demandedPermissions: [PERMISSIONS.ManageCategories]
|
|
1367
1420
|
});
|
|
1368
|
-
const
|
|
1421
|
+
const canManageDiscountCodes = useIsAuthorized({
|
|
1369
1422
|
demandedPermissions: [PERMISSIONS.ManageDiscountCodes]
|
|
1370
1423
|
});
|
|
1424
|
+
const canManageBusinessUnits = useIsAuthorized({
|
|
1425
|
+
demandedPermissions: [PERMISSIONS.ManageBusinessUnits]
|
|
1426
|
+
});
|
|
1371
1427
|
const canImportProducts = useMemo(() => {
|
|
1372
1428
|
if (!actionRights) return false;
|
|
1373
1429
|
const canAddPrices = actionRights.canAddPrices,
|
|
@@ -1376,12 +1432,17 @@ const useImportPermission = () => {
|
|
|
1376
1432
|
canEditPrices = actionRights.canEditPrices;
|
|
1377
1433
|
return canManageProducts && canAddPrices && canAddProducts && canEditAttributesAll && canEditPrices;
|
|
1378
1434
|
}, [canManageProducts, actionRights]);
|
|
1435
|
+
const canManageCustomObjects = useMemo(() => {
|
|
1436
|
+
return canManageProducts || canManageCustomers || canManageOrders || canManageKeyValueDocuments;
|
|
1437
|
+
}, [canManageCustomers, canManageOrders, canManageProducts, canManageKeyValueDocuments]);
|
|
1379
1438
|
return {
|
|
1380
1439
|
canImportProducts,
|
|
1381
|
-
canImportCategories,
|
|
1382
|
-
canImportDiscountCodes,
|
|
1440
|
+
canImportCategories: canMAnageCategories,
|
|
1441
|
+
canImportDiscountCodes: canManageDiscountCodes,
|
|
1442
|
+
canImportBusinessUnits: canManageBusinessUnits,
|
|
1383
1443
|
canImportInventories: canManageProducts,
|
|
1384
|
-
canImportProductTypes: canManageProducts
|
|
1444
|
+
canImportProductTypes: canManageProducts,
|
|
1445
|
+
canImportCustomObjects: canManageCustomObjects
|
|
1385
1446
|
};
|
|
1386
1447
|
};
|
|
1387
1448
|
|
|
@@ -2454,17 +2515,17 @@ const getChunkImport = locale => {
|
|
|
2454
2515
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
2455
2516
|
switch (intlLocale) {
|
|
2456
2517
|
case 'de':
|
|
2457
|
-
return import(
|
|
2518
|
+
return import('./de-19530b12.esm.js');
|
|
2458
2519
|
case 'es':
|
|
2459
|
-
return import(
|
|
2520
|
+
return import('./es-a9aada13.esm.js');
|
|
2460
2521
|
case 'fr-FR':
|
|
2461
|
-
return import(
|
|
2522
|
+
return import('./fr-FR-02bd52fb.esm.js');
|
|
2462
2523
|
case 'ja':
|
|
2463
|
-
return import(
|
|
2524
|
+
return import('./ja-73c088a7.esm.js');
|
|
2464
2525
|
case 'pt-BR':
|
|
2465
|
-
return import(
|
|
2526
|
+
return import('./pt-BR-ac1fc192.esm.js');
|
|
2466
2527
|
default:
|
|
2467
|
-
return import(
|
|
2528
|
+
return import('./en-1f091237.esm.js');
|
|
2468
2529
|
}
|
|
2469
2530
|
};
|
|
2470
2531
|
const loadMessages = async locale => {
|