@commercetools-frontend-extensions/delete-resources-modal 1.7.4 → 2.0.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/commercetools-frontend-extensions-delete-resources-modal.cjs.dev.js +31 -48
- package/dist/commercetools-frontend-extensions-delete-resources-modal.cjs.prod.js +31 -48
- package/dist/commercetools-frontend-extensions-delete-resources-modal.esm.js +32 -49
- package/dist/{de-7fb72ea5.esm.js → de-55d31e4d.esm.js} +2 -2
- package/dist/{de-514f5517.cjs.dev.js → de-6e42f5e4.cjs.dev.js} +2 -2
- package/dist/{de-e1c2fd10.cjs.prod.js → de-d9c3271b.cjs.prod.js} +2 -2
- package/dist/{es-8afa38be.cjs.prod.js → es-34154b4a.cjs.dev.js} +2 -2
- package/dist/{es-581c06c3.cjs.dev.js → es-c58b0c92.cjs.prod.js} +2 -2
- package/dist/{es-0688779c.esm.js → es-cf022d7c.esm.js} +2 -2
- package/dist/{fr-FR-5c3709b9.cjs.prod.js → fr-FR-121838d3.cjs.prod.js} +2 -2
- package/dist/{fr-FR-e14138a4.esm.js → fr-FR-48733cd9.esm.js} +2 -2
- package/dist/{fr-FR-e6efe9d4.cjs.dev.js → fr-FR-7b966279.cjs.dev.js} +2 -2
- package/dist/{pt-BR-ed3157de.esm.js → pt-BR-8716fb53.esm.js} +2 -2
- package/dist/{pt-BR-08955393.cjs.prod.js → pt-BR-f38c2a7e.cjs.dev.js} +2 -2
- package/dist/{pt-BR-1cdf9b63.cjs.dev.js → pt-BR-f67d7ad3.cjs.prod.js} +2 -2
- package/package.json +2 -2
|
@@ -29,7 +29,6 @@ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibl
|
|
|
29
29
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
30
30
|
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
31
31
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
32
|
-
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
33
32
|
var sentry = require('@commercetools-frontend/sentry');
|
|
34
33
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
35
34
|
require('@emotion/react');
|
|
@@ -49,17 +48,17 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
49
48
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
50
49
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
51
50
|
|
|
52
|
-
function ownKeys$
|
|
53
|
-
function _objectSpread$
|
|
51
|
+
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; }
|
|
52
|
+
function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
54
53
|
function reducer(state, action) {
|
|
55
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
54
|
+
if (action.type === 'setCurrentStep') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
56
55
|
currentStep: action.currentStep,
|
|
57
56
|
progress: 0
|
|
58
57
|
});
|
|
59
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
58
|
+
if (action.type === 'setContainerKey') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
60
59
|
containerKey: action.containerKey
|
|
61
60
|
});
|
|
62
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
61
|
+
if (action.type === 'cancelImport') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
63
62
|
currentStep: 'upload',
|
|
64
63
|
containerKey: undefined,
|
|
65
64
|
droppedFile: undefined,
|
|
@@ -69,7 +68,7 @@ function reducer(state, action) {
|
|
|
69
68
|
validationProcessed: undefined,
|
|
70
69
|
isValidating: false
|
|
71
70
|
});
|
|
72
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
71
|
+
if (action.type === 'uploadNewFile') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
73
72
|
currentStep: 'upload',
|
|
74
73
|
containerKey: undefined,
|
|
75
74
|
droppedFile: undefined,
|
|
@@ -80,37 +79,37 @@ function reducer(state, action) {
|
|
|
80
79
|
isValidating: false
|
|
81
80
|
});
|
|
82
81
|
if (action.type === 'setDroppedFile') {
|
|
83
|
-
return _objectSpread$
|
|
82
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
84
83
|
droppedFile: action.droppedFile
|
|
85
84
|
});
|
|
86
85
|
}
|
|
87
86
|
if (action.type === 'setAbortController') {
|
|
88
|
-
return _objectSpread$
|
|
87
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
89
88
|
abortController: action.abortController
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
91
|
if (action.type === 'setProgress') {
|
|
93
|
-
return _objectSpread$
|
|
92
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
94
93
|
progress: action.progress
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
if (action.type === 'setUploadFileResponse') {
|
|
98
|
-
return _objectSpread$
|
|
97
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
99
98
|
uploadFileResponse: action.uploadFileResponse
|
|
100
99
|
});
|
|
101
100
|
}
|
|
102
101
|
if (action.type === 'setFileUploadErrors') {
|
|
103
|
-
return _objectSpread$
|
|
102
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
104
103
|
fileUploadErrors: action.fileUploadErrors
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
106
|
if (action.type === 'setJobId') {
|
|
108
|
-
return _objectSpread$
|
|
107
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
109
108
|
jobId: action.jobId
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
111
|
if (action.type === 'setValidationProgress') {
|
|
113
|
-
return _objectSpread$
|
|
112
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
114
113
|
validationProcessed: action.processed,
|
|
115
114
|
isValidating: action.isValidating
|
|
116
115
|
});
|
|
@@ -465,22 +464,6 @@ var messages$4 = reactIntl.defineMessages({
|
|
|
465
464
|
}
|
|
466
465
|
});
|
|
467
466
|
|
|
468
|
-
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; }
|
|
469
|
-
function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
470
|
-
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
471
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
472
|
-
[FILE_IMPORT_JOB_FLOW]: false
|
|
473
|
-
};
|
|
474
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
475
|
-
_objectSpread$6(_objectSpread$6({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
476
|
-
|
|
477
|
-
const DOCUMENTATION_LINKS = {
|
|
478
|
-
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
479
|
-
};
|
|
480
|
-
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
481
|
-
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
482
|
-
};
|
|
483
|
-
|
|
484
467
|
const useUpload = () => {
|
|
485
468
|
const intl = reactIntl.useIntl();
|
|
486
469
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -492,25 +475,21 @@ const useUpload = () => {
|
|
|
492
475
|
state = _useDeleteResourcesCo.state,
|
|
493
476
|
actions = _useDeleteResourcesCo.actions;
|
|
494
477
|
const showNotification = actionsGlobal.useShowNotification();
|
|
495
|
-
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
496
478
|
const _useFileUpload = operations.useFileUpload({
|
|
497
|
-
projectKey: projectKey
|
|
498
|
-
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
479
|
+
projectKey: projectKey
|
|
499
480
|
}),
|
|
500
481
|
upload = _useFileUpload.upload;
|
|
501
482
|
const isFileValid = async file => {
|
|
502
483
|
const errors = [];
|
|
503
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
504
|
-
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
505
484
|
const rowCount = await operations.getRowCount(file);
|
|
506
485
|
if (rowCount < 1) errors.push({
|
|
507
486
|
title: intl.formatMessage(messages$4.dropAreaNotEnoughRowsTitle),
|
|
508
487
|
description: intl.formatMessage(messages$4.dropAreaNotEnoughRowsDescription)
|
|
509
488
|
});
|
|
510
|
-
if (file.size > operations.toBytes(
|
|
489
|
+
if (file.size > operations.toBytes(operations.IMPORT_MAX_FILE_SIZE_MB)) errors.push({
|
|
511
490
|
title: intl.formatMessage(messages$4.fileSizeExceededTitle),
|
|
512
491
|
description: intl.formatMessage(messages$4.fileSizeExceededDescription, {
|
|
513
|
-
fileSizeLimit: intl.formatNumber(
|
|
492
|
+
fileSizeLimit: intl.formatNumber(operations.IMPORT_MAX_FILE_SIZE_MB)
|
|
514
493
|
})
|
|
515
494
|
});
|
|
516
495
|
if (!(await operations.hasSingleKeyColumn(file))) {
|
|
@@ -519,10 +498,10 @@ const useUpload = () => {
|
|
|
519
498
|
description: intl.formatMessage(messages$4.csvFormatErrorDescription)
|
|
520
499
|
});
|
|
521
500
|
}
|
|
522
|
-
if (rowCount >
|
|
501
|
+
if (rowCount > operations.IMPORT_MAX_ITEM_COUNT) errors.push({
|
|
523
502
|
title: intl.formatMessage(messages$4.rowLimitExceededTitle),
|
|
524
503
|
description: intl.formatMessage(messages$4.rowLimitExceededDescription, {
|
|
525
|
-
rowLimit: intl.formatNumber(
|
|
504
|
+
rowLimit: intl.formatNumber(operations.IMPORT_MAX_ITEM_COUNT)
|
|
526
505
|
})
|
|
527
506
|
});
|
|
528
507
|
if (errors.length > 0) {
|
|
@@ -869,6 +848,13 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
869
848
|
}
|
|
870
849
|
});
|
|
871
850
|
|
|
851
|
+
const DOCUMENTATION_LINKS = {
|
|
852
|
+
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
853
|
+
};
|
|
854
|
+
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
855
|
+
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
856
|
+
};
|
|
857
|
+
|
|
872
858
|
function resourceTypeToMessage(resourceType) {
|
|
873
859
|
const resourceTypeMap = {
|
|
874
860
|
category: sharedMessages.category,
|
|
@@ -926,11 +912,8 @@ const Instructions = () => {
|
|
|
926
912
|
const intl = reactIntl.useIntl();
|
|
927
913
|
const _useDeleteResourcesCo = useDeleteResourcesContext(),
|
|
928
914
|
resourceType = _useDeleteResourcesCo.resourceType;
|
|
929
|
-
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
930
915
|
const documentTemplateLink = TEMPLATE_DOWNLOAD_LINKS[resourceType];
|
|
931
916
|
const documentationLink = DOCUMENTATION_LINKS[resourceType];
|
|
932
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
933
|
-
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
934
917
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
935
918
|
scale: "m",
|
|
936
919
|
children: [jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
@@ -944,8 +927,8 @@ const Instructions = () => {
|
|
|
944
927
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
945
928
|
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.fileUploadInstructionForMaxFileSize), {}, {
|
|
946
929
|
values: {
|
|
947
|
-
maxFileSize: intl.formatNumber(
|
|
948
|
-
maxRowCount: intl.formatNumber(
|
|
930
|
+
maxFileSize: intl.formatNumber(operations.IMPORT_MAX_FILE_SIZE_MB),
|
|
931
|
+
maxRowCount: intl.formatNumber(operations.IMPORT_MAX_ITEM_COUNT),
|
|
949
932
|
csvTemplateLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
950
933
|
tone: "secondary",
|
|
951
934
|
isExternal: true,
|
|
@@ -1454,15 +1437,15 @@ const getChunkImport = locale => {
|
|
|
1454
1437
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
1455
1438
|
switch (intlLocale) {
|
|
1456
1439
|
case 'de':
|
|
1457
|
-
return Promise.resolve().then(function () { return require('./de-
|
|
1440
|
+
return Promise.resolve().then(function () { return require('./de-6e42f5e4.cjs.dev.js'); });
|
|
1458
1441
|
case 'es':
|
|
1459
|
-
return Promise.resolve().then(function () { return require('./es-
|
|
1442
|
+
return Promise.resolve().then(function () { return require('./es-34154b4a.cjs.dev.js'); });
|
|
1460
1443
|
case 'fr-FR':
|
|
1461
|
-
return Promise.resolve().then(function () { return require('./fr-FR-
|
|
1444
|
+
return Promise.resolve().then(function () { return require('./fr-FR-7b966279.cjs.dev.js'); });
|
|
1462
1445
|
case 'ja':
|
|
1463
1446
|
return Promise.resolve().then(function () { return require('./ja-9bd5f452.cjs.dev.js'); });
|
|
1464
1447
|
case 'pt-BR':
|
|
1465
|
-
return Promise.resolve().then(function () { return require('./pt-BR-
|
|
1448
|
+
return Promise.resolve().then(function () { return require('./pt-BR-f38c2a7e.cjs.dev.js'); });
|
|
1466
1449
|
default:
|
|
1467
1450
|
return Promise.resolve().then(function () { return require('./en-b42e748c.cjs.dev.js'); });
|
|
1468
1451
|
}
|
|
@@ -29,7 +29,6 @@ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibl
|
|
|
29
29
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
30
30
|
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
31
31
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
32
|
-
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
33
32
|
var sentry = require('@commercetools-frontend/sentry');
|
|
34
33
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
35
34
|
require('@emotion/react');
|
|
@@ -49,17 +48,17 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
49
48
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
50
49
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
51
50
|
|
|
52
|
-
function ownKeys$
|
|
53
|
-
function _objectSpread$
|
|
51
|
+
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; }
|
|
52
|
+
function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
54
53
|
function reducer(state, action) {
|
|
55
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
54
|
+
if (action.type === 'setCurrentStep') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
56
55
|
currentStep: action.currentStep,
|
|
57
56
|
progress: 0
|
|
58
57
|
});
|
|
59
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
58
|
+
if (action.type === 'setContainerKey') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
60
59
|
containerKey: action.containerKey
|
|
61
60
|
});
|
|
62
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
61
|
+
if (action.type === 'cancelImport') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
63
62
|
currentStep: 'upload',
|
|
64
63
|
containerKey: undefined,
|
|
65
64
|
droppedFile: undefined,
|
|
@@ -69,7 +68,7 @@ function reducer(state, action) {
|
|
|
69
68
|
validationProcessed: undefined,
|
|
70
69
|
isValidating: false
|
|
71
70
|
});
|
|
72
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
71
|
+
if (action.type === 'uploadNewFile') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
73
72
|
currentStep: 'upload',
|
|
74
73
|
containerKey: undefined,
|
|
75
74
|
droppedFile: undefined,
|
|
@@ -80,37 +79,37 @@ function reducer(state, action) {
|
|
|
80
79
|
isValidating: false
|
|
81
80
|
});
|
|
82
81
|
if (action.type === 'setDroppedFile') {
|
|
83
|
-
return _objectSpread$
|
|
82
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
84
83
|
droppedFile: action.droppedFile
|
|
85
84
|
});
|
|
86
85
|
}
|
|
87
86
|
if (action.type === 'setAbortController') {
|
|
88
|
-
return _objectSpread$
|
|
87
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
89
88
|
abortController: action.abortController
|
|
90
89
|
});
|
|
91
90
|
}
|
|
92
91
|
if (action.type === 'setProgress') {
|
|
93
|
-
return _objectSpread$
|
|
92
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
94
93
|
progress: action.progress
|
|
95
94
|
});
|
|
96
95
|
}
|
|
97
96
|
if (action.type === 'setUploadFileResponse') {
|
|
98
|
-
return _objectSpread$
|
|
97
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
99
98
|
uploadFileResponse: action.uploadFileResponse
|
|
100
99
|
});
|
|
101
100
|
}
|
|
102
101
|
if (action.type === 'setFileUploadErrors') {
|
|
103
|
-
return _objectSpread$
|
|
102
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
104
103
|
fileUploadErrors: action.fileUploadErrors
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
106
|
if (action.type === 'setJobId') {
|
|
108
|
-
return _objectSpread$
|
|
107
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
109
108
|
jobId: action.jobId
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
111
|
if (action.type === 'setValidationProgress') {
|
|
113
|
-
return _objectSpread$
|
|
112
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
114
113
|
validationProcessed: action.processed,
|
|
115
114
|
isValidating: action.isValidating
|
|
116
115
|
});
|
|
@@ -465,22 +464,6 @@ var messages$4 = reactIntl.defineMessages({
|
|
|
465
464
|
}
|
|
466
465
|
});
|
|
467
466
|
|
|
468
|
-
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; }
|
|
469
|
-
function _objectSpread$6(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$6(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$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
470
|
-
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
471
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
472
|
-
[FILE_IMPORT_JOB_FLOW]: false
|
|
473
|
-
};
|
|
474
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
475
|
-
_objectSpread$6(_objectSpread$6({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
476
|
-
|
|
477
|
-
const DOCUMENTATION_LINKS = {
|
|
478
|
-
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
479
|
-
};
|
|
480
|
-
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
481
|
-
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
482
|
-
};
|
|
483
|
-
|
|
484
467
|
const useUpload = () => {
|
|
485
468
|
const intl = reactIntl.useIntl();
|
|
486
469
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -492,25 +475,21 @@ const useUpload = () => {
|
|
|
492
475
|
state = _useDeleteResourcesCo.state,
|
|
493
476
|
actions = _useDeleteResourcesCo.actions;
|
|
494
477
|
const showNotification = actionsGlobal.useShowNotification();
|
|
495
|
-
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
496
478
|
const _useFileUpload = operations.useFileUpload({
|
|
497
|
-
projectKey: projectKey
|
|
498
|
-
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
479
|
+
projectKey: projectKey
|
|
499
480
|
}),
|
|
500
481
|
upload = _useFileUpload.upload;
|
|
501
482
|
const isFileValid = async file => {
|
|
502
483
|
const errors = [];
|
|
503
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
504
|
-
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
505
484
|
const rowCount = await operations.getRowCount(file);
|
|
506
485
|
if (rowCount < 1) errors.push({
|
|
507
486
|
title: intl.formatMessage(messages$4.dropAreaNotEnoughRowsTitle),
|
|
508
487
|
description: intl.formatMessage(messages$4.dropAreaNotEnoughRowsDescription)
|
|
509
488
|
});
|
|
510
|
-
if (file.size > operations.toBytes(
|
|
489
|
+
if (file.size > operations.toBytes(operations.IMPORT_MAX_FILE_SIZE_MB)) errors.push({
|
|
511
490
|
title: intl.formatMessage(messages$4.fileSizeExceededTitle),
|
|
512
491
|
description: intl.formatMessage(messages$4.fileSizeExceededDescription, {
|
|
513
|
-
fileSizeLimit: intl.formatNumber(
|
|
492
|
+
fileSizeLimit: intl.formatNumber(operations.IMPORT_MAX_FILE_SIZE_MB)
|
|
514
493
|
})
|
|
515
494
|
});
|
|
516
495
|
if (!(await operations.hasSingleKeyColumn(file))) {
|
|
@@ -519,10 +498,10 @@ const useUpload = () => {
|
|
|
519
498
|
description: intl.formatMessage(messages$4.csvFormatErrorDescription)
|
|
520
499
|
});
|
|
521
500
|
}
|
|
522
|
-
if (rowCount >
|
|
501
|
+
if (rowCount > operations.IMPORT_MAX_ITEM_COUNT) errors.push({
|
|
523
502
|
title: intl.formatMessage(messages$4.rowLimitExceededTitle),
|
|
524
503
|
description: intl.formatMessage(messages$4.rowLimitExceededDescription, {
|
|
525
|
-
rowLimit: intl.formatNumber(
|
|
504
|
+
rowLimit: intl.formatNumber(operations.IMPORT_MAX_ITEM_COUNT)
|
|
526
505
|
})
|
|
527
506
|
});
|
|
528
507
|
if (errors.length > 0) {
|
|
@@ -869,6 +848,13 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
869
848
|
}
|
|
870
849
|
});
|
|
871
850
|
|
|
851
|
+
const DOCUMENTATION_LINKS = {
|
|
852
|
+
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
853
|
+
};
|
|
854
|
+
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
855
|
+
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
856
|
+
};
|
|
857
|
+
|
|
872
858
|
function resourceTypeToMessage(resourceType) {
|
|
873
859
|
const resourceTypeMap = {
|
|
874
860
|
category: sharedMessages.category,
|
|
@@ -926,11 +912,8 @@ const Instructions = () => {
|
|
|
926
912
|
const intl = reactIntl.useIntl();
|
|
927
913
|
const _useDeleteResourcesCo = useDeleteResourcesContext(),
|
|
928
914
|
resourceType = _useDeleteResourcesCo.resourceType;
|
|
929
|
-
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
930
915
|
const documentTemplateLink = TEMPLATE_DOWNLOAD_LINKS[resourceType];
|
|
931
916
|
const documentationLink = DOCUMENTATION_LINKS[resourceType];
|
|
932
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
933
|
-
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
934
917
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
935
918
|
scale: "m",
|
|
936
919
|
children: [jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
@@ -944,8 +927,8 @@ const Instructions = () => {
|
|
|
944
927
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
945
928
|
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.fileUploadInstructionForMaxFileSize), {}, {
|
|
946
929
|
values: {
|
|
947
|
-
maxFileSize: intl.formatNumber(
|
|
948
|
-
maxRowCount: intl.formatNumber(
|
|
930
|
+
maxFileSize: intl.formatNumber(operations.IMPORT_MAX_FILE_SIZE_MB),
|
|
931
|
+
maxRowCount: intl.formatNumber(operations.IMPORT_MAX_ITEM_COUNT),
|
|
949
932
|
csvTemplateLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
950
933
|
tone: "secondary",
|
|
951
934
|
isExternal: true,
|
|
@@ -1445,15 +1428,15 @@ const getChunkImport = locale => {
|
|
|
1445
1428
|
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
1446
1429
|
switch (intlLocale) {
|
|
1447
1430
|
case 'de':
|
|
1448
|
-
return Promise.resolve().then(function () { return require('./de-
|
|
1431
|
+
return Promise.resolve().then(function () { return require('./de-d9c3271b.cjs.prod.js'); });
|
|
1449
1432
|
case 'es':
|
|
1450
|
-
return Promise.resolve().then(function () { return require('./es-
|
|
1433
|
+
return Promise.resolve().then(function () { return require('./es-c58b0c92.cjs.prod.js'); });
|
|
1451
1434
|
case 'fr-FR':
|
|
1452
|
-
return Promise.resolve().then(function () { return require('./fr-FR-
|
|
1435
|
+
return Promise.resolve().then(function () { return require('./fr-FR-121838d3.cjs.prod.js'); });
|
|
1453
1436
|
case 'ja':
|
|
1454
1437
|
return Promise.resolve().then(function () { return require('./ja-37632763.cjs.prod.js'); });
|
|
1455
1438
|
case 'pt-BR':
|
|
1456
|
-
return Promise.resolve().then(function () { return require('./pt-BR-
|
|
1439
|
+
return Promise.resolve().then(function () { return require('./pt-BR-f67d7ad3.cjs.prod.js'); });
|
|
1457
1440
|
default:
|
|
1458
1441
|
return Promise.resolve().then(function () { return require('./en-1a981743.cjs.prod.js'); });
|
|
1459
1442
|
}
|
|
@@ -11,7 +11,7 @@ import { defineMessages, useIntl, FormattedMessage, IntlProvider } from 'react-i
|
|
|
11
11
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
12
12
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
13
13
|
import React, { useContext, useState, useEffect } from 'react';
|
|
14
|
-
import { deleteImportContainer, EnabledDropArea, FileDroppedArea, ActiveDragDropArea, useFileUpload, getRowCount, toBytes, hasSingleKeyColumn, isAbortError, HttpError, PollingTimeoutError,
|
|
14
|
+
import { deleteImportContainer, EnabledDropArea, FileDroppedArea, ActiveDragDropArea, useFileUpload, getRowCount, toBytes, IMPORT_MAX_FILE_SIZE_MB, hasSingleKeyColumn, IMPORT_MAX_ITEM_COUNT, isAbortError, HttpError, PollingTimeoutError, FileDropArea as FileDropArea$1, UploadingModal, mapFileUploadErrorsToUploadFileErrorRows, processFileImportJob, processUploadedFile } from '@commercetools-frontend-extensions/operations';
|
|
15
15
|
import { jsx, jsxs } from '@emotion/react/jsx-runtime';
|
|
16
16
|
import { FormDialog, InfoDialog } from '@commercetools-frontend/application-components';
|
|
17
17
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
@@ -25,23 +25,22 @@ import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possi
|
|
|
25
25
|
import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
26
26
|
import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
|
|
27
27
|
import _wrapNativeSuper from '@babel/runtime-corejs3/helpers/esm/wrapNativeSuper';
|
|
28
|
-
import { useFeatureToggle } from '@commercetools-frontend/application-shell';
|
|
29
28
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
30
29
|
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
31
30
|
import '@emotion/react';
|
|
32
31
|
import { parseChunkImport, mapLocaleToIntlLocale } from '@commercetools-frontend/i18n';
|
|
33
32
|
|
|
34
|
-
function ownKeys$
|
|
35
|
-
function _objectSpread$
|
|
33
|
+
function ownKeys$6(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; }
|
|
34
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
35
|
function reducer(state, action) {
|
|
37
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
36
|
+
if (action.type === 'setCurrentStep') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
38
37
|
currentStep: action.currentStep,
|
|
39
38
|
progress: 0
|
|
40
39
|
});
|
|
41
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
40
|
+
if (action.type === 'setContainerKey') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
42
41
|
containerKey: action.containerKey
|
|
43
42
|
});
|
|
44
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
43
|
+
if (action.type === 'cancelImport') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
45
44
|
currentStep: 'upload',
|
|
46
45
|
containerKey: undefined,
|
|
47
46
|
droppedFile: undefined,
|
|
@@ -51,7 +50,7 @@ function reducer(state, action) {
|
|
|
51
50
|
validationProcessed: undefined,
|
|
52
51
|
isValidating: false
|
|
53
52
|
});
|
|
54
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
53
|
+
if (action.type === 'uploadNewFile') return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
55
54
|
currentStep: 'upload',
|
|
56
55
|
containerKey: undefined,
|
|
57
56
|
droppedFile: undefined,
|
|
@@ -62,37 +61,37 @@ function reducer(state, action) {
|
|
|
62
61
|
isValidating: false
|
|
63
62
|
});
|
|
64
63
|
if (action.type === 'setDroppedFile') {
|
|
65
|
-
return _objectSpread$
|
|
64
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
66
65
|
droppedFile: action.droppedFile
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
68
|
if (action.type === 'setAbortController') {
|
|
70
|
-
return _objectSpread$
|
|
69
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
71
70
|
abortController: action.abortController
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
73
|
if (action.type === 'setProgress') {
|
|
75
|
-
return _objectSpread$
|
|
74
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
76
75
|
progress: action.progress
|
|
77
76
|
});
|
|
78
77
|
}
|
|
79
78
|
if (action.type === 'setUploadFileResponse') {
|
|
80
|
-
return _objectSpread$
|
|
79
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
81
80
|
uploadFileResponse: action.uploadFileResponse
|
|
82
81
|
});
|
|
83
82
|
}
|
|
84
83
|
if (action.type === 'setFileUploadErrors') {
|
|
85
|
-
return _objectSpread$
|
|
84
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
86
85
|
fileUploadErrors: action.fileUploadErrors
|
|
87
86
|
});
|
|
88
87
|
}
|
|
89
88
|
if (action.type === 'setJobId') {
|
|
90
|
-
return _objectSpread$
|
|
89
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
91
90
|
jobId: action.jobId
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
if (action.type === 'setValidationProgress') {
|
|
95
|
-
return _objectSpread$
|
|
94
|
+
return _objectSpread$6(_objectSpread$6({}, state), {}, {
|
|
96
95
|
validationProcessed: action.processed,
|
|
97
96
|
isValidating: action.isValidating
|
|
98
97
|
});
|
|
@@ -447,22 +446,6 @@ var messages$4 = defineMessages({
|
|
|
447
446
|
}
|
|
448
447
|
});
|
|
449
448
|
|
|
450
|
-
function ownKeys$6(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; }
|
|
451
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
452
|
-
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
453
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
454
|
-
[FILE_IMPORT_JOB_FLOW]: false
|
|
455
|
-
};
|
|
456
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
457
|
-
_objectSpread$6(_objectSpread$6({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
458
|
-
|
|
459
|
-
const DOCUMENTATION_LINKS = {
|
|
460
|
-
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
461
|
-
};
|
|
462
|
-
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
463
|
-
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
464
|
-
};
|
|
465
|
-
|
|
466
449
|
const useUpload = () => {
|
|
467
450
|
const intl = useIntl();
|
|
468
451
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
@@ -474,25 +457,21 @@ const useUpload = () => {
|
|
|
474
457
|
state = _useDeleteResourcesCo.state,
|
|
475
458
|
actions = _useDeleteResourcesCo.actions;
|
|
476
459
|
const showNotification = useShowNotification();
|
|
477
|
-
const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
478
460
|
const _useFileUpload = useFileUpload({
|
|
479
|
-
projectKey: projectKey
|
|
480
|
-
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
461
|
+
projectKey: projectKey
|
|
481
462
|
}),
|
|
482
463
|
upload = _useFileUpload.upload;
|
|
483
464
|
const isFileValid = async file => {
|
|
484
465
|
const errors = [];
|
|
485
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
486
|
-
const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
487
466
|
const rowCount = await getRowCount(file);
|
|
488
467
|
if (rowCount < 1) errors.push({
|
|
489
468
|
title: intl.formatMessage(messages$4.dropAreaNotEnoughRowsTitle),
|
|
490
469
|
description: intl.formatMessage(messages$4.dropAreaNotEnoughRowsDescription)
|
|
491
470
|
});
|
|
492
|
-
if (file.size > toBytes(
|
|
471
|
+
if (file.size > toBytes(IMPORT_MAX_FILE_SIZE_MB)) errors.push({
|
|
493
472
|
title: intl.formatMessage(messages$4.fileSizeExceededTitle),
|
|
494
473
|
description: intl.formatMessage(messages$4.fileSizeExceededDescription, {
|
|
495
|
-
fileSizeLimit: intl.formatNumber(
|
|
474
|
+
fileSizeLimit: intl.formatNumber(IMPORT_MAX_FILE_SIZE_MB)
|
|
496
475
|
})
|
|
497
476
|
});
|
|
498
477
|
if (!(await hasSingleKeyColumn(file))) {
|
|
@@ -501,10 +480,10 @@ const useUpload = () => {
|
|
|
501
480
|
description: intl.formatMessage(messages$4.csvFormatErrorDescription)
|
|
502
481
|
});
|
|
503
482
|
}
|
|
504
|
-
if (rowCount >
|
|
483
|
+
if (rowCount > IMPORT_MAX_ITEM_COUNT) errors.push({
|
|
505
484
|
title: intl.formatMessage(messages$4.rowLimitExceededTitle),
|
|
506
485
|
description: intl.formatMessage(messages$4.rowLimitExceededDescription, {
|
|
507
|
-
rowLimit: intl.formatNumber(
|
|
486
|
+
rowLimit: intl.formatNumber(IMPORT_MAX_ITEM_COUNT)
|
|
508
487
|
})
|
|
509
488
|
});
|
|
510
489
|
if (errors.length > 0) {
|
|
@@ -851,6 +830,13 @@ var messages$3 = defineMessages({
|
|
|
851
830
|
}
|
|
852
831
|
});
|
|
853
832
|
|
|
833
|
+
const DOCUMENTATION_LINKS = {
|
|
834
|
+
product: 'https://docs.commercetools.com/merchant-center/product-list#bulk-delete-via-csv-import'
|
|
835
|
+
};
|
|
836
|
+
const TEMPLATE_DOWNLOAD_LINKS = {
|
|
837
|
+
product: 'https://docs.commercetools.com/merchant-center/downloads/product_delete_import_template.csv'
|
|
838
|
+
};
|
|
839
|
+
|
|
854
840
|
function resourceTypeToMessage(resourceType) {
|
|
855
841
|
const resourceTypeMap = {
|
|
856
842
|
category: sharedMessages.category,
|
|
@@ -908,11 +894,8 @@ const Instructions = () => {
|
|
|
908
894
|
const intl = useIntl();
|
|
909
895
|
const _useDeleteResourcesCo = useDeleteResourcesContext(),
|
|
910
896
|
resourceType = _useDeleteResourcesCo.resourceType;
|
|
911
|
-
const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
912
897
|
const documentTemplateLink = TEMPLATE_DOWNLOAD_LINKS[resourceType];
|
|
913
898
|
const documentationLink = DOCUMENTATION_LINKS[resourceType];
|
|
914
|
-
const maxFileSizeMB = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
915
|
-
const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
916
899
|
return jsxs(Spacings.Stack, {
|
|
917
900
|
scale: "m",
|
|
918
901
|
children: [jsxs(Text.Body, {
|
|
@@ -926,8 +909,8 @@ const Instructions = () => {
|
|
|
926
909
|
}), jsx(Text.Body, {
|
|
927
910
|
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.fileUploadInstructionForMaxFileSize), {}, {
|
|
928
911
|
values: {
|
|
929
|
-
maxFileSize: intl.formatNumber(
|
|
930
|
-
maxRowCount: intl.formatNumber(
|
|
912
|
+
maxFileSize: intl.formatNumber(IMPORT_MAX_FILE_SIZE_MB),
|
|
913
|
+
maxRowCount: intl.formatNumber(IMPORT_MAX_ITEM_COUNT),
|
|
931
914
|
csvTemplateLink: msg => jsx(Link, {
|
|
932
915
|
tone: "secondary",
|
|
933
916
|
isExternal: true,
|
|
@@ -1436,15 +1419,15 @@ const getChunkImport = locale => {
|
|
|
1436
1419
|
const intlLocale = mapLocaleToIntlLocale(locale);
|
|
1437
1420
|
switch (intlLocale) {
|
|
1438
1421
|
case 'de':
|
|
1439
|
-
return import('./de-
|
|
1422
|
+
return import('./de-55d31e4d.esm.js');
|
|
1440
1423
|
case 'es':
|
|
1441
|
-
return import('./es-
|
|
1424
|
+
return import('./es-cf022d7c.esm.js');
|
|
1442
1425
|
case 'fr-FR':
|
|
1443
|
-
return import('./fr-FR-
|
|
1426
|
+
return import('./fr-FR-48733cd9.esm.js');
|
|
1444
1427
|
case 'ja':
|
|
1445
1428
|
return import('./ja-73c088a7.esm.js');
|
|
1446
1429
|
case 'pt-BR':
|
|
1447
|
-
return import('./pt-BR-
|
|
1430
|
+
return import('./pt-BR-8716fb53.esm.js');
|
|
1448
1431
|
default:
|
|
1449
1432
|
return import('./en-30a390dc.esm.js');
|
|
1450
1433
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var de = {
|
|
2
2
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
3
|
-
string: "{processed}
|
|
3
|
+
string: "{processed} validierte Ressourcen"
|
|
4
4
|
},
|
|
5
5
|
"DeleteResourcesModal.browseFile": {
|
|
6
6
|
string: "Datei durchsuchen"
|
|
@@ -260,7 +260,7 @@ var de = {
|
|
|
260
260
|
},
|
|
261
261
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
262
262
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
263
|
-
string: "
|
|
263
|
+
string: "Der Upload hat zu lange gedauert. Bitte reduzieren Sie die Dateigröße oder teilen Sie die Daten in kleinere Dateien auf."
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var de = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} validierte Ressourcen"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Datei durchsuchen"
|
|
@@ -262,7 +262,7 @@ var de = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Der Upload hat zu lange gedauert. Bitte reduzieren Sie die Dateigröße oder teilen Sie die Daten in kleinere Dateien auf."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var de = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} validierte Ressourcen"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Datei durchsuchen"
|
|
@@ -262,7 +262,7 @@ var de = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Der Upload hat zu lange gedauert. Bitte reduzieren Sie die Dateigröße oder teilen Sie die Daten in kleinere Dateien auf."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var es = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} recursos validados"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Explorar archivo"
|
|
@@ -262,7 +262,7 @@ var es = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Se ha tardado demasiado en subir. Reduce el tamaño del archivo o separa los datos en archivos más pequeños."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var es = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} recursos validados"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Explorar archivo"
|
|
@@ -262,7 +262,7 @@ var es = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Se ha tardado demasiado en subir. Reduce el tamaño del archivo o separa los datos en archivos más pequeños."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var es = {
|
|
2
2
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
3
|
-
string: "{processed}
|
|
3
|
+
string: "{processed} recursos validados"
|
|
4
4
|
},
|
|
5
5
|
"DeleteResourcesModal.browseFile": {
|
|
6
6
|
string: "Explorar archivo"
|
|
@@ -260,7 +260,7 @@ var es = {
|
|
|
260
260
|
},
|
|
261
261
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
262
262
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
263
|
-
string: "
|
|
263
|
+
string: "Se ha tardado demasiado en subir. Reduce el tamaño del archivo o separa los datos en archivos más pequeños."
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var frFR = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} ressources validées"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Parcourir le fichier"
|
|
@@ -262,7 +262,7 @@ var frFR = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Le téléchargement a pris trop de temps. Veuillez réduire la taille du fichier ou répartir les données dans des fichiers plus petits."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var frFR = {
|
|
2
2
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
3
|
-
string: "{processed}
|
|
3
|
+
string: "{processed} ressources validées"
|
|
4
4
|
},
|
|
5
5
|
"DeleteResourcesModal.browseFile": {
|
|
6
6
|
string: "Parcourir le fichier"
|
|
@@ -260,7 +260,7 @@ var frFR = {
|
|
|
260
260
|
},
|
|
261
261
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
262
262
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
263
|
-
string: "
|
|
263
|
+
string: "Le téléchargement a pris trop de temps. Veuillez réduire la taille du fichier ou répartir les données dans des fichiers plus petits."
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var frFR = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} ressources validées"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Parcourir le fichier"
|
|
@@ -262,7 +262,7 @@ var frFR = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "Le téléchargement a pris trop de temps. Veuillez réduire la taille du fichier ou répartir les données dans des fichiers plus petits."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var ptBR = {
|
|
2
2
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
3
|
-
string: "{processed}
|
|
3
|
+
string: "{processed} recursos validados"
|
|
4
4
|
},
|
|
5
5
|
"DeleteResourcesModal.browseFile": {
|
|
6
6
|
string: "Procurar arquivo"
|
|
@@ -260,7 +260,7 @@ var ptBR = {
|
|
|
260
260
|
},
|
|
261
261
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
262
262
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
263
|
-
string: "
|
|
263
|
+
string: "A operação de carregamento levou muito tempo. Reduza o tamanho do arquivo ou divida os dados em arquivos menores."
|
|
264
264
|
}
|
|
265
265
|
};
|
|
266
266
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var ptBR = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} recursos validados"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Procurar arquivo"
|
|
@@ -262,7 +262,7 @@ var ptBR = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "A operação de carregamento levou muito tempo. Reduza o tamanho do arquivo ou divida os dados em arquivos menores."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var ptBR = {
|
|
4
4
|
"DeleteResourcesModal.Uploading.validatingResources": {
|
|
5
|
-
string: "{processed}
|
|
5
|
+
string: "{processed} recursos validados"
|
|
6
6
|
},
|
|
7
7
|
"DeleteResourcesModal.browseFile": {
|
|
8
8
|
string: "Procurar arquivo"
|
|
@@ -262,7 +262,7 @@ var ptBR = {
|
|
|
262
262
|
},
|
|
263
263
|
"operations.import.resource.upload.uploadIsTakingTooLong": {
|
|
264
264
|
developer_comment: "Notification message when file upload is taking longer than expected",
|
|
265
|
-
string: "
|
|
265
|
+
string: "A operação de carregamento levou muito tempo. Reduza o tamanho do arquivo ou divida os dados em arquivos menores."
|
|
266
266
|
}
|
|
267
267
|
};
|
|
268
268
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend-extensions/delete-resources-modal",
|
|
3
3
|
"description": "Shared import modal for deleting resources",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.0",
|
|
5
5
|
"license": "BSD-3-Clause",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"pluralize": "8.0.0",
|
|
32
32
|
"prop-types": "15.8.1",
|
|
33
33
|
"ramda": "^0.32.0",
|
|
34
|
-
"@commercetools-frontend-extensions/operations": "
|
|
34
|
+
"@commercetools-frontend-extensions/operations": "4.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@commercetools-frontend/actions-global": "27.2.0",
|