@commercetools-frontend-extensions/unpublish-products-modal 1.2.9 → 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/commercetools-frontend-extensions-unpublish-products-modal.cjs.dev.js +230 -99
- package/dist/commercetools-frontend-extensions-unpublish-products-modal.cjs.prod.js +228 -97
- package/dist/commercetools-frontend-extensions-unpublish-products-modal.esm.js +231 -100
- package/package.json +15 -15
|
@@ -29,6 +29,7 @@ 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');
|
|
32
33
|
var sentry = require('@commercetools-frontend/sentry');
|
|
33
34
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
34
35
|
require('@emotion/react');
|
|
@@ -48,55 +49,79 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
48
49
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
49
50
|
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
50
51
|
|
|
51
|
-
function ownKeys$
|
|
52
|
-
function _objectSpread$
|
|
52
|
+
function ownKeys$7(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; }
|
|
53
|
+
function _objectSpread$7(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$7(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$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
53
54
|
function reducer(state, action) {
|
|
54
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
55
|
+
if (action.type === 'setCurrentStep') return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
55
56
|
currentStep: action.currentStep,
|
|
56
57
|
progress: 0
|
|
57
58
|
});
|
|
58
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
59
|
+
if (action.type === 'setContainerKey') return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
59
60
|
containerKey: action.containerKey
|
|
60
61
|
});
|
|
61
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
62
|
+
if (action.type === 'cancelImport') return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
62
63
|
currentStep: 'upload',
|
|
63
64
|
containerKey: undefined,
|
|
64
65
|
droppedFile: undefined,
|
|
65
66
|
dropAreaState: 'ready-for-drop',
|
|
66
|
-
progress: 0
|
|
67
|
+
progress: 0,
|
|
68
|
+
jobId: undefined,
|
|
69
|
+
totalResourceCount: undefined,
|
|
70
|
+
validationProcessed: undefined,
|
|
71
|
+
isValidating: false
|
|
67
72
|
});
|
|
68
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
73
|
+
if (action.type === 'uploadNewFile') return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
69
74
|
currentStep: 'upload',
|
|
70
75
|
containerKey: undefined,
|
|
71
76
|
droppedFile: undefined,
|
|
72
77
|
dropAreaState: 'ready-for-drop',
|
|
73
|
-
progress: 0
|
|
78
|
+
progress: 0,
|
|
79
|
+
jobId: undefined,
|
|
80
|
+
totalResourceCount: undefined,
|
|
81
|
+
validationProcessed: undefined,
|
|
82
|
+
isValidating: false
|
|
74
83
|
});
|
|
75
84
|
if (action.type === 'setDroppedFile') {
|
|
76
|
-
return _objectSpread$
|
|
85
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
77
86
|
droppedFile: action.droppedFile
|
|
78
87
|
});
|
|
79
88
|
}
|
|
80
89
|
if (action.type === 'setAbortController') {
|
|
81
|
-
return _objectSpread$
|
|
90
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
82
91
|
abortController: action.abortController
|
|
83
92
|
});
|
|
84
93
|
}
|
|
85
94
|
if (action.type === 'setProgress') {
|
|
86
|
-
return _objectSpread$
|
|
95
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
87
96
|
progress: action.progress
|
|
88
97
|
});
|
|
89
98
|
}
|
|
90
99
|
if (action.type === 'setUploadFileResponse') {
|
|
91
|
-
return _objectSpread$
|
|
100
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
92
101
|
uploadFileResponse: action.uploadFileResponse
|
|
93
102
|
});
|
|
94
103
|
}
|
|
95
104
|
if (action.type === 'setFileUploadErrors') {
|
|
96
|
-
return _objectSpread$
|
|
105
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
97
106
|
fileUploadErrors: action.fileUploadErrors
|
|
98
107
|
});
|
|
99
108
|
}
|
|
109
|
+
if (action.type === 'setJobId') {
|
|
110
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
111
|
+
jobId: action.jobId
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (action.type === 'setTotalResourceCount') {
|
|
115
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
116
|
+
totalResourceCount: action.totalResourceCount
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (action.type === 'setValidationProgress') {
|
|
120
|
+
return _objectSpread$7(_objectSpread$7({}, state), {}, {
|
|
121
|
+
validationProcessed: action.processed,
|
|
122
|
+
isValidating: action.isValidating
|
|
123
|
+
});
|
|
124
|
+
}
|
|
100
125
|
throw new Error(getUnknownActionError(action));
|
|
101
126
|
}
|
|
102
127
|
function getUnknownActionError(actionType) {
|
|
@@ -138,6 +163,15 @@ const initialActions = {
|
|
|
138
163
|
},
|
|
139
164
|
setProgress(_progress) {
|
|
140
165
|
/**/
|
|
166
|
+
},
|
|
167
|
+
setJobId(_jobId) {
|
|
168
|
+
/**/
|
|
169
|
+
},
|
|
170
|
+
setTotalResourceCount(_totalResourceCount) {
|
|
171
|
+
/**/
|
|
172
|
+
},
|
|
173
|
+
setValidationProgress(_params) {
|
|
174
|
+
/**/
|
|
141
175
|
}
|
|
142
176
|
};
|
|
143
177
|
|
|
@@ -193,6 +227,37 @@ const UnpublishProductsProvider = props => {
|
|
|
193
227
|
uploadFileResponse
|
|
194
228
|
});
|
|
195
229
|
};
|
|
230
|
+
const setJobId = jobId => dispatch({
|
|
231
|
+
type: 'setJobId',
|
|
232
|
+
jobId
|
|
233
|
+
});
|
|
234
|
+
const setTotalResourceCount = totalResourceCount => dispatch({
|
|
235
|
+
type: 'setTotalResourceCount',
|
|
236
|
+
totalResourceCount
|
|
237
|
+
});
|
|
238
|
+
const setValidationProgress = _ref => {
|
|
239
|
+
let processed = _ref.processed,
|
|
240
|
+
isValidating = _ref.isValidating;
|
|
241
|
+
return dispatch({
|
|
242
|
+
type: 'setValidationProgress',
|
|
243
|
+
processed,
|
|
244
|
+
isValidating
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
const actions = {
|
|
248
|
+
setCurrentStep,
|
|
249
|
+
cancelImport,
|
|
250
|
+
uploadNewFile,
|
|
251
|
+
setDroppedFile,
|
|
252
|
+
setUploadFileResponse,
|
|
253
|
+
setFileUploadErrors,
|
|
254
|
+
setContainerKey,
|
|
255
|
+
setAbortController,
|
|
256
|
+
setProgress,
|
|
257
|
+
setJobId,
|
|
258
|
+
setTotalResourceCount,
|
|
259
|
+
setValidationProgress
|
|
260
|
+
};
|
|
196
261
|
const handleClose = function () {
|
|
197
262
|
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
198
263
|
if (state.abortController) state.abortController.abort();
|
|
@@ -207,17 +272,7 @@ const UnpublishProductsProvider = props => {
|
|
|
207
272
|
value: {
|
|
208
273
|
state,
|
|
209
274
|
onClose: handleClose,
|
|
210
|
-
actions
|
|
211
|
-
setCurrentStep,
|
|
212
|
-
cancelImport,
|
|
213
|
-
uploadNewFile,
|
|
214
|
-
setDroppedFile,
|
|
215
|
-
setUploadFileResponse,
|
|
216
|
-
setFileUploadErrors,
|
|
217
|
-
setContainerKey,
|
|
218
|
-
setAbortController,
|
|
219
|
-
setProgress
|
|
220
|
-
}
|
|
275
|
+
actions
|
|
221
276
|
},
|
|
222
277
|
children: props.children
|
|
223
278
|
});
|
|
@@ -269,7 +324,7 @@ function getDropAreaState(flags) {
|
|
|
269
324
|
return 'ready-for-drop';
|
|
270
325
|
}
|
|
271
326
|
|
|
272
|
-
var messages$
|
|
327
|
+
var messages$5 = reactIntl.defineMessages({
|
|
273
328
|
dragAndDropCSV: {
|
|
274
329
|
id: 'UnpublishProductsModal.dragAndDropCSV',
|
|
275
330
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -348,7 +403,7 @@ const useUnpublishProductsContext = () => {
|
|
|
348
403
|
return context;
|
|
349
404
|
};
|
|
350
405
|
|
|
351
|
-
var messages$
|
|
406
|
+
var messages$4 = reactIntl.defineMessages({
|
|
352
407
|
fileSizeExceededTitle: {
|
|
353
408
|
id: 'UnpublishProductsModal.sizeExceededTitle',
|
|
354
409
|
defaultMessage: 'File size exceeded'
|
|
@@ -404,6 +459,18 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
404
459
|
}
|
|
405
460
|
});
|
|
406
461
|
|
|
462
|
+
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; }
|
|
463
|
+
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; }
|
|
464
|
+
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
465
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
466
|
+
[FILE_IMPORT_JOB_FLOW]: false
|
|
467
|
+
};
|
|
468
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
469
|
+
_objectSpread$6(_objectSpread$6({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
470
|
+
|
|
471
|
+
const DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/product-list#bulk-unpublish-via-csv-import';
|
|
472
|
+
const TEMPLATE_DOWNLOAD_LINK = 'https://docs.commercetools.com/merchant-center/downloads/product_unpublish_import_template.csv';
|
|
473
|
+
|
|
407
474
|
const useUpload = () => {
|
|
408
475
|
const intl = reactIntl.useIntl();
|
|
409
476
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -414,38 +481,37 @@ const useUpload = () => {
|
|
|
414
481
|
state = _useUnpublishProducts.state,
|
|
415
482
|
actions = _useUnpublishProducts.actions;
|
|
416
483
|
const showNotification = actionsGlobal.useShowNotification();
|
|
417
|
-
const
|
|
418
|
-
|
|
484
|
+
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
485
|
+
const _useFileUpload = operations.useFileUpload({
|
|
486
|
+
projectKey: projectKey,
|
|
487
|
+
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
419
488
|
}),
|
|
420
|
-
upload =
|
|
421
|
-
React__default["default"].useEffect(() => {
|
|
422
|
-
return () => {
|
|
423
|
-
if (state.abortController) state.abortController.abort();
|
|
424
|
-
};
|
|
425
|
-
}, [state.abortController]);
|
|
489
|
+
upload = _useFileUpload.upload;
|
|
426
490
|
const isFileValid = async file => {
|
|
427
491
|
const errors = [];
|
|
492
|
+
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
493
|
+
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
428
494
|
const rowCount = await operations.getRowCount(file);
|
|
429
495
|
if (rowCount < 1) errors.push({
|
|
430
|
-
title: intl.formatMessage(messages$
|
|
431
|
-
description: intl.formatMessage(messages$
|
|
496
|
+
title: intl.formatMessage(messages$4.dropAreaNotEnoughRowsTitle),
|
|
497
|
+
description: intl.formatMessage(messages$4.dropAreaNotEnoughRowsDescription)
|
|
432
498
|
});
|
|
433
|
-
if (file.size > operations.toBytes(
|
|
434
|
-
title: intl.formatMessage(messages$
|
|
435
|
-
description: intl.formatMessage(messages$
|
|
436
|
-
fileSizeLimit: intl.formatNumber(
|
|
499
|
+
if (file.size > operations.toBytes(maxFileSizeMB)) errors.push({
|
|
500
|
+
title: intl.formatMessage(messages$4.fileSizeExceededTitle),
|
|
501
|
+
description: intl.formatMessage(messages$4.fileSizeExceededDescription, {
|
|
502
|
+
fileSizeLimit: intl.formatNumber(maxFileSizeMB)
|
|
437
503
|
})
|
|
438
504
|
});
|
|
439
505
|
if (!(await operations.hasSingleKeyColumn(file))) {
|
|
440
506
|
errors.push({
|
|
441
|
-
title: intl.formatMessage(messages$
|
|
442
|
-
description: intl.formatMessage(messages$
|
|
507
|
+
title: intl.formatMessage(messages$4.csvFormatErrorTitle),
|
|
508
|
+
description: intl.formatMessage(messages$4.csvFormatErrorDescription)
|
|
443
509
|
});
|
|
444
510
|
}
|
|
445
|
-
if (rowCount >
|
|
446
|
-
title: intl.formatMessage(messages$
|
|
447
|
-
description: intl.formatMessage(messages$
|
|
448
|
-
rowLimit: intl.formatNumber(
|
|
511
|
+
if (rowCount > maxItemCount) errors.push({
|
|
512
|
+
title: intl.formatMessage(messages$4.rowLimitExceededTitle),
|
|
513
|
+
description: intl.formatMessage(messages$4.rowLimitExceededDescription, {
|
|
514
|
+
rowLimit: intl.formatNumber(maxItemCount)
|
|
449
515
|
})
|
|
450
516
|
});
|
|
451
517
|
if (errors.length > 0) {
|
|
@@ -453,6 +519,10 @@ const useUpload = () => {
|
|
|
453
519
|
actions.setCurrentStep('upload-error');
|
|
454
520
|
return false;
|
|
455
521
|
}
|
|
522
|
+
if (isFileImportJobFlowEnabled) {
|
|
523
|
+
const resourceCount = await operations.countUniqueResourcesInCsv(file);
|
|
524
|
+
actions.setTotalResourceCount(resourceCount);
|
|
525
|
+
}
|
|
456
526
|
return true;
|
|
457
527
|
};
|
|
458
528
|
const handleUploadError = error => {
|
|
@@ -461,18 +531,25 @@ const useUpload = () => {
|
|
|
461
531
|
return;
|
|
462
532
|
}
|
|
463
533
|
if (error instanceof operations.HttpError) {
|
|
534
|
+
actions.setValidationProgress({
|
|
535
|
+
processed: 0,
|
|
536
|
+
isValidating: false
|
|
537
|
+
});
|
|
464
538
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
465
539
|
actions.setFileUploadErrors([{
|
|
466
|
-
title: intl.formatMessage(messages$
|
|
467
|
-
description: intl.formatMessage(messages$
|
|
540
|
+
title: intl.formatMessage(messages$4.missingRequiredField),
|
|
541
|
+
description: intl.formatMessage(messages$4.missingKeyError)
|
|
468
542
|
}]);
|
|
469
543
|
actions.setCurrentStep('upload-error');
|
|
544
|
+
} else if (error.errorData?.invalid > 0) {
|
|
545
|
+
actions.setUploadFileResponse(error.errorData);
|
|
546
|
+
actions.setCurrentStep('upload-error');
|
|
470
547
|
} else {
|
|
471
548
|
actions.cancelImport();
|
|
472
549
|
showNotification({
|
|
473
550
|
kind: 'error',
|
|
474
551
|
domain: constants.DOMAINS.PAGE,
|
|
475
|
-
text: intl.formatMessage(messages$
|
|
552
|
+
text: intl.formatMessage(messages$4.unexpectedError)
|
|
476
553
|
});
|
|
477
554
|
}
|
|
478
555
|
} else {
|
|
@@ -494,32 +571,58 @@ const useUpload = () => {
|
|
|
494
571
|
if (!state.droppedFile) return;
|
|
495
572
|
const canUpload = await isFileValid(state.droppedFile);
|
|
496
573
|
if (!canUpload) return;
|
|
574
|
+
const abortController = new AbortController();
|
|
575
|
+
actions.setAbortController(abortController);
|
|
497
576
|
actions.setCurrentStep('uploading');
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
577
|
+
await upload({
|
|
578
|
+
file: state.droppedFile,
|
|
579
|
+
resourceType: 'product',
|
|
580
|
+
settings: {
|
|
581
|
+
format: 'CSV',
|
|
582
|
+
options: {
|
|
583
|
+
unpublishAllChanges: true
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
abortSignal: abortController.signal,
|
|
587
|
+
onSuccess: result => {
|
|
588
|
+
actions.setValidationProgress({
|
|
589
|
+
processed: 0,
|
|
590
|
+
isValidating: false
|
|
591
|
+
});
|
|
592
|
+
actions.setContainerKey(result.containerKey);
|
|
593
|
+
if (result.jobId) {
|
|
594
|
+
actions.setJobId(result.jobId);
|
|
595
|
+
}
|
|
596
|
+
const fileUploadResponse = {
|
|
597
|
+
results: result.summary.results,
|
|
598
|
+
invalid: result.summary.invalid,
|
|
599
|
+
valid: result.summary.valid,
|
|
600
|
+
fileName: state.droppedFile?.name || '',
|
|
601
|
+
itemsCount: result.summary.total,
|
|
602
|
+
rowsCount: result.summary.total,
|
|
603
|
+
columnsCount: result.summary.fieldsCount,
|
|
604
|
+
fields: result.summary.fields,
|
|
605
|
+
ignoredFields: result.summary.ignoredFields
|
|
606
|
+
};
|
|
607
|
+
actions.setUploadFileResponse(fileUploadResponse);
|
|
608
|
+
if (result.summary.invalid > 0) {
|
|
609
|
+
actions.setCurrentStep('upload-error');
|
|
610
|
+
} else {
|
|
512
611
|
actions.setCurrentStep('upload-preview');
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
onProgress: progress => {
|
|
615
|
+
actions.setProgress(progress);
|
|
616
|
+
},
|
|
617
|
+
onValidationProgress: job => {
|
|
618
|
+
const processed = job.summary?.total ?? 0;
|
|
619
|
+
actions.setValidationProgress({
|
|
620
|
+
processed,
|
|
621
|
+
isValidating: true
|
|
622
|
+
});
|
|
623
|
+
},
|
|
624
|
+
onError: handleUploadError
|
|
625
|
+
});
|
|
523
626
|
};
|
|
524
627
|
return {
|
|
525
628
|
handleUploadAndValidation
|
|
@@ -540,9 +643,9 @@ const FileDropArea = () => {
|
|
|
540
643
|
}, [actions]);
|
|
541
644
|
const handleDropRejected = React__default["default"].useCallback(errorType => {
|
|
542
645
|
const errorMessageMap = {
|
|
543
|
-
'too-many-files': messages$
|
|
544
|
-
'invalid-type': messages$
|
|
545
|
-
generic: messages$
|
|
646
|
+
'too-many-files': messages$5.tooManyFilesError,
|
|
647
|
+
'invalid-type': messages$5.fileFormatNotSupported,
|
|
648
|
+
generic: messages$5.genericError
|
|
546
649
|
};
|
|
547
650
|
showNotification({
|
|
548
651
|
kind: 'error',
|
|
@@ -566,10 +669,10 @@ const FileDropArea = () => {
|
|
|
566
669
|
isFileDropped: Boolean(state.droppedFile),
|
|
567
670
|
fileName: state.droppedFile?.name,
|
|
568
671
|
messages: {
|
|
569
|
-
dragAndDropCSV: intl.formatMessage(messages$
|
|
570
|
-
or: intl.formatMessage(messages$
|
|
571
|
-
browseButton: intl.formatMessage(messages$
|
|
572
|
-
chooseFile: intl.formatMessage(messages$
|
|
672
|
+
dragAndDropCSV: intl.formatMessage(messages$5.dragAndDropCSV),
|
|
673
|
+
or: intl.formatMessage(messages$5.or),
|
|
674
|
+
browseButton: intl.formatMessage(messages$5.browseButton),
|
|
675
|
+
chooseFile: intl.formatMessage(messages$5.chooseFile)
|
|
573
676
|
}
|
|
574
677
|
})
|
|
575
678
|
});
|
|
@@ -590,10 +693,15 @@ var sharedMessages = reactIntl.defineMessages({
|
|
|
590
693
|
id: 'UnpublishProductsModal.cancel',
|
|
591
694
|
description: 'The label for the cancel button',
|
|
592
695
|
defaultMessage: 'Cancel'
|
|
696
|
+
},
|
|
697
|
+
products: {
|
|
698
|
+
id: 'UnpublishProductsModal.products',
|
|
699
|
+
description: 'Products resource type label',
|
|
700
|
+
defaultMessage: 'Products'
|
|
593
701
|
}
|
|
594
702
|
});
|
|
595
703
|
|
|
596
|
-
var messages$
|
|
704
|
+
var messages$3 = reactIntl.defineMessages({
|
|
597
705
|
fileUploadInstructions: {
|
|
598
706
|
id: 'UnpublishProductsModal.fileUploadInstructions',
|
|
599
707
|
description: 'Instructions for uploading a CSV file with product keys to unpublish',
|
|
@@ -601,18 +709,18 @@ var messages$2 = reactIntl.defineMessages({
|
|
|
601
709
|
}
|
|
602
710
|
});
|
|
603
711
|
|
|
604
|
-
const DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/product-list#bulk-unpublish-via-csv-import';
|
|
605
|
-
const TEMPLATE_DOWNLOAD_LINK = 'https://docs.commercetools.com/merchant-center/downloads/product_unpublish_import_template.csv';
|
|
606
|
-
|
|
607
712
|
function ownKeys$5(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; }
|
|
608
713
|
function _objectSpread$5(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$5(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$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
609
714
|
const Instructions = () => {
|
|
610
715
|
const intl = reactIntl.useIntl();
|
|
716
|
+
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
717
|
+
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
718
|
+
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
611
719
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
612
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
720
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$3.fileUploadInstructions), {}, {
|
|
613
721
|
values: {
|
|
614
|
-
maxFileSize: intl.formatNumber(
|
|
615
|
-
maxRowCount: intl.formatNumber(
|
|
722
|
+
maxFileSize: intl.formatNumber(maxFileSizeMB),
|
|
723
|
+
maxRowCount: intl.formatNumber(maxItemCount),
|
|
616
724
|
csvTemplateLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
617
725
|
tone: "secondary",
|
|
618
726
|
isExternal: true,
|
|
@@ -641,7 +749,7 @@ const Upload = () => {
|
|
|
641
749
|
size: 16,
|
|
642
750
|
isOpen: true,
|
|
643
751
|
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
644
|
-
labelPrimary: intl.formatMessage(messages$
|
|
752
|
+
labelPrimary: intl.formatMessage(messages$5.uploadAndPreview),
|
|
645
753
|
onPrimaryButtonClick: handleUploadAndValidation,
|
|
646
754
|
isPrimaryButtonDisabled: !Boolean(state.droppedFile),
|
|
647
755
|
onSecondaryButtonClick: () => onClose({
|
|
@@ -659,6 +767,13 @@ const Upload = () => {
|
|
|
659
767
|
});
|
|
660
768
|
};
|
|
661
769
|
|
|
770
|
+
var messages$2 = reactIntl.defineMessages({
|
|
771
|
+
validatingResources: {
|
|
772
|
+
id: 'UnpublishProductsModal.Uploading.validatingResources',
|
|
773
|
+
defaultMessage: 'Validating {processed} / {total} {resourceType}'
|
|
774
|
+
}
|
|
775
|
+
});
|
|
776
|
+
|
|
662
777
|
const Uploading = () => {
|
|
663
778
|
const intl = reactIntl.useIntl();
|
|
664
779
|
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
@@ -666,12 +781,19 @@ const Uploading = () => {
|
|
|
666
781
|
actions = _useUnpublishProducts.actions,
|
|
667
782
|
onClose = _useUnpublishProducts.onClose;
|
|
668
783
|
if (!state.droppedFile?.name) return null;
|
|
784
|
+
const showValidationProgress = state.isValidating && state.totalResourceCount && (state.validationProcessed ?? 0) > 0;
|
|
785
|
+
const statusMessage = showValidationProgress ? intl.formatMessage(messages$2.validatingResources, {
|
|
786
|
+
processed: intl.formatNumber(state.validationProcessed ?? 0),
|
|
787
|
+
total: intl.formatNumber(state.totalResourceCount ?? 0),
|
|
788
|
+
resourceType: intl.formatMessage(sharedMessages.products)
|
|
789
|
+
}) : undefined;
|
|
669
790
|
return jsxRuntime.jsx(operations.UploadingModal, {
|
|
670
791
|
isOpen: true,
|
|
671
792
|
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
672
793
|
fileName: state.droppedFile.name,
|
|
673
794
|
fileSize: state.droppedFile.size,
|
|
674
795
|
progress: state.progress,
|
|
796
|
+
statusMessage: statusMessage,
|
|
675
797
|
cancelLabel: intl.formatMessage(sharedMessages.cancel),
|
|
676
798
|
onCancel: () => {
|
|
677
799
|
actions.setCurrentStep('upload');
|
|
@@ -764,7 +886,7 @@ const UploadErrorsModal = () => {
|
|
|
764
886
|
state = _useUnpublishProducts.state,
|
|
765
887
|
actions = _useUnpublishProducts.actions,
|
|
766
888
|
onClose = _useUnpublishProducts.onClose;
|
|
767
|
-
const errorsCount = state.fileUploadErrors
|
|
889
|
+
const errorsCount = state.fileUploadErrors?.length ?? 0;
|
|
768
890
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
769
891
|
size: 16,
|
|
770
892
|
isOpen: true,
|
|
@@ -784,7 +906,7 @@ const UploadErrorsModal = () => {
|
|
|
784
906
|
})
|
|
785
907
|
})
|
|
786
908
|
}), jsxRuntime.jsx(UploadErrorTable, {
|
|
787
|
-
rows: operations.mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
909
|
+
rows: operations.mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors ?? [])
|
|
788
910
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
789
911
|
scale: "m",
|
|
790
912
|
justifyContent: "flex-end",
|
|
@@ -860,7 +982,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
860
982
|
styles: "width:360px"
|
|
861
983
|
} : {
|
|
862
984
|
name: "g36yzl-ImportRunningTextNotification",
|
|
863
|
-
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
985
|
+
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVucHVibGlzaC1wcm9kdWN0cy1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCWSIsImZpbGUiOiJ1bnB1Ymxpc2gtcHJvZHVjdHMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnXG5pbXBvcnQgeyBET01BSU5TIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJ1xuaW1wb3J0IHsgTWFza2luZyBhcyBGdWxsU3RvcnlNYXNraW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvZnVsbHN0b3J5J1xuaW1wb3J0IHsgTGluaywgU3BhY2luZ3MsIFRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvc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YWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGlmIChzdGF0ZS5qb2JJZCkge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIGpvYklkOiBzdGF0ZS5qb2JJZCxcbiAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlOiAncHJvZHVjdCcsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhd2FpdCBwcm9jZXNzVXBsb2FkZWRGaWxlKHtcbiAgICAgICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlOiAncHJvZHVjdCcsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFJ1bm5pbmdUZXh0Tm90aWZpY2F0aW9uIHByb2plY3RLZXk9e3Byb2plY3RLZXl9IC8+LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgZGlzbWlzc0FmdGVyOiA1MDAwLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIClcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICBvbkNsb3NlKHsgc2hvdWxkRGVsZXRlSW1wb3J0Q29udGFpbmVyOiB0cnVlIH0pXG4gICAgICAgICAgc2hvd05vdGlmaWNhdGlvbih7XG4gICAgICAgICAgICBraW5kOiAnZXJyb3InLFxuICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlBBR0UsXG4gICAgICAgICAgICB0ZXh0OiBTdHJpbmcoZXJyb3IpLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH19XG4gICAgICBzaXplPXsxNn1cbiAgICA+XG4gICAgICA8RnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cInhsXCI+XG4gICAgICAgICAgPFRleHQuQm9keVxuICAgICAgICAgICAgaW50bE1lc3NhZ2U9e3tcbiAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uVGV4dCxcbiAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgcHJvamVjdE5hbWU6IHByb2plY3ROYW1lLFxuICAgICAgICAgICAgICAgIC8vIFRPRE86IFJlcGxhY2Ugd2l0aCBhY3R1YWwgY291bnRcbiAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICBzdGF0ZS51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCA/PyAwXG4gICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICBiOiBnZXRCb2xkLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAvPlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvblF1ZXN0aW9ufSAvPlxuICAgICAgICA8L1NwYWNpbmdzLlN0YWNrPlxuICAgICAgPC9GdWxsU3RvcnlNYXNraW5nLlVubWFzaz5cbiAgICA8L0NvbmZpcm1hdGlvbkRpYWxvZz5cbiAgKVxufVxuXG5mdW5jdGlvbiBnZXRCb2xkKG1zZykge1xuICByZXR1cm4gKFxuICAgIDxUZXh0LkJvZHkgYXM9XCJzcGFuXCIgaXNCb2xkIGtleT17Y3J5cHRvLnJhbmRvbVVVSUQoKX0+XG4gICAgICB7bXNnfVxuICAgIDwvVGV4dC5Cb2R5PlxuICApXG59XG4iXX0= */",
|
|
864
986
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
865
987
|
};
|
|
866
988
|
const ImportRunningTextNotification = props => jsxRuntime.jsx("div", {
|
|
@@ -880,7 +1002,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
880
1002
|
styles: "width:360px"
|
|
881
1003
|
} : {
|
|
882
1004
|
name: "mjwslu-ImportPreparingTextNotification",
|
|
883
|
-
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1005
|
+
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVucHVibGlzaC1wcm9kdWN0cy1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRDWSIsImZpbGUiOiJ1bnB1Ymxpc2gtcHJvZHVjdHMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05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nlCdXR0b249e3tcbiAgICAgICAgJ2RhdGEtdGVzdC1pZCc6ICdjb25maXJtYXRpb24tZGlhbG9nLWNvbmZpcm0nLFxuICAgICAgfX1cbiAgICAgIGRhdGFBdHRyaWJ1dGVzU2Vjb25kYXJ5QnV0dG9uPXt7XG4gICAgICAgICdkYXRhLXRlc3QtaWQnOiAnY29uZmlybWF0aW9uLWRpYWxvZy1jYW5jZWwnLFxuICAgICAgfX1cbiAgICAgIG9uQ29uZmlybT17YXN5bmMgKCkgPT4ge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IGNhbkNvbmZpcm0gPVxuICAgICAgICAgICAgcHJvamVjdEtleSAmJiBzdGF0ZS5jb250YWluZXJLZXkgJiYgc3RhdGUuZHJvcHBlZEZpbGU/Lm5hbWVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGlmIChzdGF0ZS5qb2JJZCkge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIGpvYklkOiBzdGF0ZS5qb2JJZCxcbiAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlOiAncHJvZHVjdCcsXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBhd2FpdCBwcm9jZXNzVXBsb2FkZWRGaWxlKHtcbiAgICAgICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICAgICAgcmVzb3VyY2VUeXBlOiAncHJvZHVjdCcsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFJ1bm5pbmdUZXh0Tm90aWZpY2F0aW9uIHByb2plY3RLZXk9e3Byb2plY3RLZXl9IC8+LFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgZGlzbWlzc0FmdGVyOiA1MDAwLFxuICAgICAgICAgICAgfVxuICAgICAgICAgIClcbiAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcbiAgICAgICAgICBvbkNsb3NlKHsgc2hvdWxkRGVsZXRlSW1wb3J0Q29udGFpbmVyOiB0cnVlIH0pXG4gICAgICAgICAgc2hvd05vdGlmaWNhdGlvbih7XG4gICAgICAgICAgICBraW5kOiAnZXJyb3InLFxuICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlBBR0UsXG4gICAgICAgICAgICB0ZXh0OiBTdHJpbmcoZXJyb3IpLFxuICAgICAgICAgIH0pXG4gICAgICAgIH1cbiAgICAgIH19XG4gICAgICBzaXplPXsxNn1cbiAgICA+XG4gICAgICA8RnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgICAgIDxTcGFjaW5ncy5TdGFjayBzY2FsZT1cInhsXCI+XG4gICAgICAgICAgPFRleHQuQm9keVxuICAgICAgICAgICAgaW50bE1lc3NhZ2U9e3tcbiAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uVGV4dCxcbiAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgcHJvamVjdE5hbWU6IHByb2plY3ROYW1lLFxuICAgICAgICAgICAgICAgIC8vIFRPRE86IFJlcGxhY2Ugd2l0aCBhY3R1YWwgY291bnRcbiAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICBzdGF0ZS51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCA/PyAwXG4gICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICBiOiBnZXRCb2xkLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAvPlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvblF1ZXN0aW9ufSAvPlxuICAgICAgICA8L1NwYWNpbmdzLlN0YWNrPlxuICAgICAgPC9GdWxsU3RvcnlNYXNraW5nLlVubWFzaz5cbiAgICA8L0NvbmZpcm1hdGlvbkRpYWxvZz5cbiAgKVxufVxuXG5mdW5jdGlvbiBnZXRCb2xkKG1zZykge1xuICByZXR1cm4gKFxuICAgIDxUZXh0LkJvZHkgYXM9XCJzcGFuXCIgaXNCb2xkIGtleT17Y3J5cHRvLnJhbmRvbVVVSUQoKX0+XG4gICAgICB7bXNnfVxuICAgIDwvVGV4dC5Cb2R5PlxuICApXG59XG4iXX0= */",
|
|
884
1006
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
885
1007
|
};
|
|
886
1008
|
const ImportPreparingTextNotification = props => jsxRuntime.jsx("div", {
|
|
@@ -938,11 +1060,20 @@ const UnpublishProductsConfirmationModal = () => {
|
|
|
938
1060
|
}, {
|
|
939
1061
|
dismissAfter: 5000
|
|
940
1062
|
});
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
1063
|
+
if (state.jobId) {
|
|
1064
|
+
await operations.processFileImportJob({
|
|
1065
|
+
projectKey,
|
|
1066
|
+
importContainerKey: state.containerKey,
|
|
1067
|
+
jobId: state.jobId,
|
|
1068
|
+
resourceType: 'product'
|
|
1069
|
+
});
|
|
1070
|
+
} else {
|
|
1071
|
+
await operations.processUploadedFile({
|
|
1072
|
+
projectKey,
|
|
1073
|
+
resourceType: 'product',
|
|
1074
|
+
importContainerKey: state.containerKey
|
|
1075
|
+
});
|
|
1076
|
+
}
|
|
946
1077
|
showNotification({
|
|
947
1078
|
kind: 'info',
|
|
948
1079
|
domain: constants.DOMAINS.SIDE,
|
|
@@ -973,7 +1104,7 @@ const UnpublishProductsConfirmationModal = () => {
|
|
|
973
1104
|
values: {
|
|
974
1105
|
projectName: projectName,
|
|
975
1106
|
// TODO: Replace with actual count
|
|
976
|
-
count: intl.formatNumber(state.uploadFileResponse?.rowsCount),
|
|
1107
|
+
count: intl.formatNumber(state.uploadFileResponse?.rowsCount ?? 0),
|
|
977
1108
|
b: getBold$1
|
|
978
1109
|
}
|
|
979
1110
|
})
|
|
@@ -1029,7 +1160,7 @@ function UploadPreviewModal() {
|
|
|
1029
1160
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1030
1161
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.productsToBeUnpublished), {}, {
|
|
1031
1162
|
values: {
|
|
1032
|
-
count: intl.formatNumber(state.uploadFileResponse?.rowsCount),
|
|
1163
|
+
count: intl.formatNumber(state.uploadFileResponse?.rowsCount ?? 0),
|
|
1033
1164
|
b: getBold
|
|
1034
1165
|
}
|
|
1035
1166
|
})
|