@commercetools-frontend-extensions/unpublish-products-modal 1.2.6 → 1.2.7
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 +1140 -43
- package/dist/commercetools-frontend-extensions-unpublish-products-modal.cjs.prod.js +1131 -43
- package/dist/commercetools-frontend-extensions-unpublish-products-modal.esm.js +1129 -42
- package/dist/declarations/src/@types/index.d.ts +0 -2
- package/package.json +3 -2
- package/dist/active-drag-drop-area-272fc575.esm.js +0 -51
- package/dist/active-drag-drop-area-d4747efc.cjs.dev.js +0 -53
- package/dist/active-drag-drop-area-fc551a0e.cjs.prod.js +0 -53
- package/dist/declarations/src/@types/file-upload.d.ts +0 -42
- package/dist/declarations/src/@types/import-container.d.ts +0 -11
- package/dist/enabled-drop-area-a750ea18.cjs.prod.js +0 -70
- package/dist/enabled-drop-area-c3902695.esm.js +0 -68
- package/dist/enabled-drop-area-c750b6ba.cjs.dev.js +0 -70
- package/dist/file-dropped-area-0d73f0f6.cjs.dev.js +0 -73
- package/dist/file-dropped-area-23cc482a.cjs.prod.js +0 -73
- package/dist/file-dropped-area-dad90f26.esm.js +0 -71
- package/dist/index-21e8e348.cjs.dev.js +0 -1547
- package/dist/index-7a25a6ee.esm.js +0 -1517
- package/dist/index-a2aa0229.cjs.prod.js +0 -1535
|
@@ -1,1547 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
4
|
-
var _Object$getOwnPropertySymbols = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols');
|
|
5
|
-
var _filterInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/filter');
|
|
6
|
-
var _Object$getOwnPropertyDescriptor = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor');
|
|
7
|
-
var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
|
|
8
|
-
var _Object$getOwnPropertyDescriptors = require('@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors');
|
|
9
|
-
var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/object/define-properties');
|
|
10
|
-
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
11
|
-
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
12
|
-
var reactIntl = require('react-intl');
|
|
13
|
-
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
14
|
-
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
15
|
-
var React = require('react');
|
|
16
|
-
var sdk = require('@commercetools-frontend/sdk');
|
|
17
|
-
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
18
|
-
var constants = require('@commercetools-frontend/constants');
|
|
19
|
-
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
20
|
-
var _Promise = require('@babel/runtime-corejs3/core-js-stable/promise');
|
|
21
|
-
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
22
|
-
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
23
|
-
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
24
|
-
var Papa = require('papaparse');
|
|
25
|
-
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
26
|
-
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
27
|
-
var fullstory = require('@commercetools-frontend/fullstory');
|
|
28
|
-
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
29
|
-
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
30
|
-
var reactDropzone = require('react-dropzone');
|
|
31
|
-
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
32
|
-
var _styled = require('@emotion/styled/base');
|
|
33
|
-
var react = require('@emotion/react');
|
|
34
|
-
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
35
|
-
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
36
|
-
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
37
|
-
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
38
|
-
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
39
|
-
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
40
|
-
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
41
|
-
var sentry = require('@commercetools-frontend/sentry');
|
|
42
|
-
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
43
|
-
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
44
|
-
var i18n = require('@commercetools-frontend/i18n');
|
|
45
|
-
|
|
46
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
47
|
-
|
|
48
|
-
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
49
|
-
var _Object$getOwnPropertySymbols__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertySymbols);
|
|
50
|
-
var _filterInstanceProperty__default = /*#__PURE__*/_interopDefault(_filterInstanceProperty);
|
|
51
|
-
var _Object$getOwnPropertyDescriptor__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptor);
|
|
52
|
-
var _forEachInstanceProperty__default = /*#__PURE__*/_interopDefault(_forEachInstanceProperty);
|
|
53
|
-
var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_Object$getOwnPropertyDescriptors);
|
|
54
|
-
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
55
|
-
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
56
|
-
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
57
|
-
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
58
|
-
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
59
|
-
var _Promise__default = /*#__PURE__*/_interopDefault(_Promise);
|
|
60
|
-
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
61
|
-
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
62
|
-
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
63
|
-
var Papa__default = /*#__PURE__*/_interopDefault(Papa);
|
|
64
|
-
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
65
|
-
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
66
|
-
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
67
|
-
var _sliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_sliceInstanceProperty);
|
|
68
|
-
|
|
69
|
-
function ownKeys$b(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
70
|
-
function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$b(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$b(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
71
|
-
function reducer(state, action) {
|
|
72
|
-
if (action.type === 'setCurrentStep') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
73
|
-
currentStep: action.currentStep,
|
|
74
|
-
progress: 0
|
|
75
|
-
});
|
|
76
|
-
if (action.type === 'setContainerKey') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
77
|
-
containerKey: action.containerKey
|
|
78
|
-
});
|
|
79
|
-
if (action.type === 'cancelImport') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
80
|
-
currentStep: 'upload',
|
|
81
|
-
containerKey: undefined,
|
|
82
|
-
droppedFile: undefined,
|
|
83
|
-
dropAreaState: 'ready-for-drop',
|
|
84
|
-
progress: 0
|
|
85
|
-
});
|
|
86
|
-
if (action.type === 'uploadNewFile') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
87
|
-
currentStep: 'upload',
|
|
88
|
-
containerKey: undefined,
|
|
89
|
-
droppedFile: undefined,
|
|
90
|
-
dropAreaState: 'ready-for-drop',
|
|
91
|
-
progress: 0
|
|
92
|
-
});
|
|
93
|
-
if (action.type === 'setDroppedFile') {
|
|
94
|
-
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
95
|
-
droppedFile: action.droppedFile
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if (action.type === 'setAbortController') {
|
|
99
|
-
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
100
|
-
abortController: action.abortController
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
if (action.type === 'setProgress') {
|
|
104
|
-
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
105
|
-
progress: action.progress
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if (action.type === 'setUploadFileResponse') {
|
|
109
|
-
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
110
|
-
uploadFileResponse: action.uploadFileResponse
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
if (action.type === 'setFileUploadErrors') {
|
|
114
|
-
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
115
|
-
fileUploadErrors: action.fileUploadErrors
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
throw new Error(getUnknownActionError(action));
|
|
119
|
-
}
|
|
120
|
-
function getUnknownActionError(actionType) {
|
|
121
|
-
return `Unkown type: ${actionType}`;
|
|
122
|
-
}
|
|
123
|
-
const initialState = {
|
|
124
|
-
currentStep: 'upload',
|
|
125
|
-
abortController: new AbortController(),
|
|
126
|
-
dropAreaState: 'ready-for-drop',
|
|
127
|
-
containerKey: undefined,
|
|
128
|
-
progress: 0,
|
|
129
|
-
uploadFileResponse: undefined,
|
|
130
|
-
fileUploadErrors: []
|
|
131
|
-
};
|
|
132
|
-
const initialActions = {
|
|
133
|
-
setCurrentStep(_currentStep) {
|
|
134
|
-
/**/
|
|
135
|
-
},
|
|
136
|
-
cancelImport() {
|
|
137
|
-
/**/
|
|
138
|
-
},
|
|
139
|
-
uploadNewFile() {
|
|
140
|
-
/**/
|
|
141
|
-
},
|
|
142
|
-
setDroppedFile(_nextDroppedFile) {
|
|
143
|
-
/**/
|
|
144
|
-
},
|
|
145
|
-
setUploadFileResponse(_uploadFileResponse) {
|
|
146
|
-
/**/
|
|
147
|
-
},
|
|
148
|
-
setFileUploadErrors(_fileUploadErrors) {
|
|
149
|
-
/**/
|
|
150
|
-
},
|
|
151
|
-
setContainerKey(_containerKey) {
|
|
152
|
-
/**/
|
|
153
|
-
},
|
|
154
|
-
setAbortController(_abortController) {
|
|
155
|
-
/**/
|
|
156
|
-
},
|
|
157
|
-
setProgress(_progress) {
|
|
158
|
-
/**/
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
function getCreateImportContainerURL(projectKey) {
|
|
163
|
-
return `/${projectKey}/import-containers`;
|
|
164
|
-
}
|
|
165
|
-
function getDeleteImportContainerURL(projectKey, containerKey) {
|
|
166
|
-
return `/${projectKey}/import-containers/${containerKey}`;
|
|
167
|
-
}
|
|
168
|
-
function getFileUploadURL(projectKey, containerKey) {
|
|
169
|
-
return `/${projectKey}/products/import-containers/${containerKey}/file-upload`;
|
|
170
|
-
}
|
|
171
|
-
function getProccessFileURL(projectKey, containerKey) {
|
|
172
|
-
return `/${projectKey}/products/import-containers/${containerKey}/process-file`;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
function ownKeys$a(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; }
|
|
176
|
-
function _objectSpread$a(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$a(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$a(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
177
|
-
function createImportContainerForFileUpload(importContainerDraft, projectKey, asyncDispatch) {
|
|
178
|
-
return asyncDispatch(sdk.actions.post({
|
|
179
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
180
|
-
uri: getCreateImportContainerURL(projectKey),
|
|
181
|
-
headers: {
|
|
182
|
-
accept: 'application/json',
|
|
183
|
-
'Content-Type': 'application/json'
|
|
184
|
-
},
|
|
185
|
-
payload: _JSON$stringify__default["default"](_objectSpread$a({
|
|
186
|
-
retentionPolicy: {
|
|
187
|
-
strategy: 'ttl',
|
|
188
|
-
config: {
|
|
189
|
-
timeToLive: '54h' // 2 days and 6 hours
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}, importContainerDraft))
|
|
193
|
-
}));
|
|
194
|
-
}
|
|
195
|
-
function deleteImportContainer(projectKey, containerKey, asyncDispatch) {
|
|
196
|
-
return asyncDispatch(sdk.actions.del({
|
|
197
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
198
|
-
uri: getDeleteImportContainerURL(projectKey, containerKey),
|
|
199
|
-
headers: {
|
|
200
|
-
accept: 'application/json'
|
|
201
|
-
}
|
|
202
|
-
}));
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function convertFileSizeToKB(sizeInBytes) {
|
|
206
|
-
return sizeInBytes / 1000;
|
|
207
|
-
}
|
|
208
|
-
function hasOwnProperty(obj, prop) {
|
|
209
|
-
return typeof obj === 'object' && obj !== null && obj.hasOwnProperty(prop);
|
|
210
|
-
}
|
|
211
|
-
function hasRequiredFields(maybeValidObject, requiredFields) {
|
|
212
|
-
return typeof maybeValidObject === 'object' && maybeValidObject !== null && _everyInstanceProperty__default["default"](requiredFields).call(requiredFields, property => hasOwnProperty(maybeValidObject, property));
|
|
213
|
-
}
|
|
214
|
-
function isAbortError(error) {
|
|
215
|
-
return error instanceof DOMException && error.name === 'AbortError';
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const encodeFileNameWithTimestampToContainerKey = fileName => {
|
|
219
|
-
return btoa(_JSON$stringify__default["default"]({
|
|
220
|
-
timestamp: new Date().getTime(),
|
|
221
|
-
fileName
|
|
222
|
-
})).replace(/=+$/g, '');
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
function ownKeys$9(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; }
|
|
226
|
-
function _objectSpread$9(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$9(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$9(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
227
|
-
/**
|
|
228
|
-
* Returns the number of rows in a CSV file excluding the header
|
|
229
|
-
* @param file The CSV file to process.
|
|
230
|
-
* @returns A promise that resolves to the number of rows
|
|
231
|
-
*/
|
|
232
|
-
const getRowCount = file => {
|
|
233
|
-
return new _Promise__default["default"](resolve => {
|
|
234
|
-
let lineCount = 0;
|
|
235
|
-
Papa__default["default"].parse(file, {
|
|
236
|
-
step: _ref => {
|
|
237
|
-
let data = _ref.data;
|
|
238
|
-
// empty lines at the end of the file should not be counted
|
|
239
|
-
if (_Array$isArray__default["default"](data) && _findInstanceProperty__default["default"](data).call(data, Boolean)) lineCount++;
|
|
240
|
-
},
|
|
241
|
-
complete: () => {
|
|
242
|
-
// Subtract 1 for the header row
|
|
243
|
-
// We use Math.max to make sure the count is not less than 0, this is needed for empty files
|
|
244
|
-
resolve(Math.max(0, lineCount - 1));
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
};
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Checks if the CSV file only contains a single column named 'key'
|
|
252
|
-
* @param file The CSV file to process
|
|
253
|
-
* @returns A promise that resolves to true if the file contains only one column named 'key', otherwise false
|
|
254
|
-
*/
|
|
255
|
-
const hasSingleKeyColumn = file => {
|
|
256
|
-
return new _Promise__default["default"](resolve => {
|
|
257
|
-
Papa__default["default"].parse(file, {
|
|
258
|
-
header: true,
|
|
259
|
-
// Only parse the first row (header)
|
|
260
|
-
preview: 1,
|
|
261
|
-
complete: results => {
|
|
262
|
-
const fields = results?.meta?.fields;
|
|
263
|
-
resolve(fields?.length === 1 && fields[0] === 'key');
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
const toBytes = megabytes => megabytes * 1024 * 1024;
|
|
269
|
-
const mapFileUploadErrorsToUploadFileErrorRows = uploadFileErrors => {
|
|
270
|
-
let idCounter = 1;
|
|
271
|
-
return _mapInstanceProperty__default["default"](uploadFileErrors).call(uploadFileErrors, uploadFileError => _objectSpread$9(_objectSpread$9({}, uploadFileError), {}, {
|
|
272
|
-
id: String(idCounter++)
|
|
273
|
-
}));
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
async function processUploadedFile(_ref) {
|
|
277
|
-
let projectKey = _ref.projectKey,
|
|
278
|
-
containerKey = _ref.containerKey,
|
|
279
|
-
asyncDispatch = _ref.asyncDispatch;
|
|
280
|
-
const uri = getProccessFileURL(projectKey, containerKey);
|
|
281
|
-
const response = await asyncDispatch(sdk.actions.post({
|
|
282
|
-
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
283
|
-
uri: uri,
|
|
284
|
-
headers: {
|
|
285
|
-
accept: 'application/json',
|
|
286
|
-
'Content-Type': 'application/json'
|
|
287
|
-
},
|
|
288
|
-
payload: {}
|
|
289
|
-
}));
|
|
290
|
-
assertProcessFileResponse(response);
|
|
291
|
-
return response;
|
|
292
|
-
}
|
|
293
|
-
function assertProcessFileResponse(maybeProcessFileResponse) {
|
|
294
|
-
const requiredFields = ['message'];
|
|
295
|
-
if (hasRequiredFields(maybeProcessFileResponse, requiredFields)) return;
|
|
296
|
-
throw new Error('Invalid response');
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const UnpublishProductsContext = /*#__PURE__*/React__default["default"].createContext({
|
|
300
|
-
state: initialState,
|
|
301
|
-
actions: initialActions,
|
|
302
|
-
onClose: () => {}
|
|
303
|
-
});
|
|
304
|
-
const UnpublishProductsProvider = props => {
|
|
305
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
306
|
-
projectKey: context.project?.key
|
|
307
|
-
})),
|
|
308
|
-
projectKey = _useApplicationContex.projectKey;
|
|
309
|
-
const asyncDispatch = sdk.useAsyncDispatch();
|
|
310
|
-
const _React$useReducer = React__default["default"].useReducer(reducer, initialState),
|
|
311
|
-
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
312
|
-
state = _React$useReducer2[0],
|
|
313
|
-
dispatch = _React$useReducer2[1];
|
|
314
|
-
const setCurrentStep = currentStep => dispatch({
|
|
315
|
-
type: 'setCurrentStep',
|
|
316
|
-
currentStep
|
|
317
|
-
});
|
|
318
|
-
const setContainerKey = containerKey => dispatch({
|
|
319
|
-
type: 'setContainerKey',
|
|
320
|
-
containerKey
|
|
321
|
-
});
|
|
322
|
-
const cancelImport = () => dispatch({
|
|
323
|
-
type: 'cancelImport'
|
|
324
|
-
});
|
|
325
|
-
const uploadNewFile = () => dispatch({
|
|
326
|
-
type: 'uploadNewFile'
|
|
327
|
-
});
|
|
328
|
-
const setDroppedFile = droppedFile => dispatch({
|
|
329
|
-
type: 'setDroppedFile',
|
|
330
|
-
droppedFile: droppedFile
|
|
331
|
-
});
|
|
332
|
-
const setFileUploadErrors = fileUploadErrors => {
|
|
333
|
-
dispatch({
|
|
334
|
-
type: 'setFileUploadErrors',
|
|
335
|
-
fileUploadErrors
|
|
336
|
-
});
|
|
337
|
-
};
|
|
338
|
-
const setAbortController = abortController => dispatch({
|
|
339
|
-
type: 'setAbortController',
|
|
340
|
-
abortController: abortController
|
|
341
|
-
});
|
|
342
|
-
const setProgress = progress => dispatch({
|
|
343
|
-
type: 'setProgress',
|
|
344
|
-
progress
|
|
345
|
-
});
|
|
346
|
-
const setUploadFileResponse = uploadFileResponse => {
|
|
347
|
-
dispatch({
|
|
348
|
-
type: 'setUploadFileResponse',
|
|
349
|
-
uploadFileResponse
|
|
350
|
-
});
|
|
351
|
-
};
|
|
352
|
-
const handleClose = function () {
|
|
353
|
-
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
354
|
-
if (state.abortController) state.abortController.abort();
|
|
355
|
-
if (typeof props.onClose === 'function') props.onClose();
|
|
356
|
-
// Removes the associated import container when the import is closed
|
|
357
|
-
if (options.shouldDeleteImportContainer && projectKey && state.containerKey) deleteImportContainer(projectKey, state.containerKey, asyncDispatch);
|
|
358
|
-
};
|
|
359
|
-
return jsxRuntime.jsx(UnpublishProductsContext.Provider, {
|
|
360
|
-
value: {
|
|
361
|
-
state,
|
|
362
|
-
onClose: handleClose,
|
|
363
|
-
actions: {
|
|
364
|
-
setCurrentStep,
|
|
365
|
-
cancelImport,
|
|
366
|
-
uploadNewFile,
|
|
367
|
-
setDroppedFile,
|
|
368
|
-
setUploadFileResponse,
|
|
369
|
-
setFileUploadErrors,
|
|
370
|
-
setContainerKey,
|
|
371
|
-
setAbortController,
|
|
372
|
-
setProgress
|
|
373
|
-
}
|
|
374
|
-
},
|
|
375
|
-
children: props.children
|
|
376
|
-
});
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
const getBorderColor = state => {
|
|
380
|
-
const borderColors = {
|
|
381
|
-
default: '#909dbc',
|
|
382
|
-
error: '#e60050',
|
|
383
|
-
active: uiKit.customProperties.colorPrimary
|
|
384
|
-
};
|
|
385
|
-
return borderColors[state] || borderColors.default;
|
|
386
|
-
};
|
|
387
|
-
const getDashedBorder = function () {
|
|
388
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
389
|
-
const color = getBorderColor(state);
|
|
390
|
-
const svgContent = `
|
|
391
|
-
<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
|
|
392
|
-
<rect width="100%" height="100%" fill="none" stroke="${color}" stroke-width="2px" stroke-dasharray="6,6" stroke-dashoffset="0" stroke-linecap="square"/>
|
|
393
|
-
</svg>
|
|
394
|
-
`;
|
|
395
|
-
return `data:image/svg+xml,${encodeURIComponent(svgContent)}`;
|
|
396
|
-
};
|
|
397
|
-
const base = /*#__PURE__*/react.css("border-radius:", uiKit.customProperties.borderRadius6, ";min-height:136px;display:flex;justify-content:center;align-items:center;" + (process.env.NODE_ENV === "production" ? "" : ";label:base;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5QmdCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxudHlwZSBEcm9wQXJlYVN0YXRlID0gJ2RlZmF1bHQnIHwgJ2Vycm9yJyB8ICdhY3RpdmUnXG5cbmNvbnN0IGdldEJvcmRlckNvbG9yID0gKHN0YXRlOiBEcm9wQXJlYVN0YXRlKSA9PiB7XG4gIGNvbnN0IGJvcmRlckNvbG9ycyA9IHtcbiAgICBkZWZhdWx0OiAnIzkwOWRiYycsXG4gICAgZXJyb3I6ICcjZTYwMDUwJyxcbiAgICBhY3RpdmU6IGN1c3RvbVByb3BlcnRpZXMuY29sb3JQcmltYXJ5LFxuICB9XG5cbiAgcmV0dXJuIGJvcmRlckNvbG9yc1tzdGF0ZV0gfHwgYm9yZGVyQ29sb3JzLmRlZmF1bHRcbn1cblxuY29uc3QgZ2V0RGFzaGVkQm9yZGVyID0gKHN0YXRlOiBEcm9wQXJlYVN0YXRlID0gJ2RlZmF1bHQnKSA9PiB7XG4gIGNvbn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ScpfVxcXCIpO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JQcmltYXJ5OTV9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcbmNvbnN0IGZpbGVEcm9wcGVkID0gY3NzYFxuICBiYWNrZ3JvdW5kLWltYWdlOiB1cmwoXFxcIiR7Z2V0RGFzaGVkQm9yZGVyKCl9XFxcIik7XG4gIGJhY2tncm91bmQtY29sb3I6ICR7Y3VzdG9tUHJvcGVydGllcy5jb2xvclN1cmZhY2V9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgYmFzZSxcbiAgcmVhZHlGb3JEcm9wLFxuICBmaWxlRHJvcHBlZCxcbiAgYWN0aXZlRHJhZyxcbn1cbiJdfQ== */");
|
|
398
|
-
const readyForDrop = /*#__PURE__*/react.css("background-image:url(\"", getDashedBorder(), "\");background-color:", uiKit.customProperties.colorSurface, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:readyForDrop;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFnQ3dCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxudHlwZSBEcm9wQXJlYVN0YXRlID0gJ2RlZmF1bHQnIHwgJ2Vycm9yJyB8ICdhY3RpdmUnXG5cbmNvbnN0I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EzNnB4O1xuICBkaXNwbGF5OiBmbGV4O1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbmBcbmNvbnN0IHJlYWR5Rm9yRHJvcCA9IGNzc2BcbiAgYmFja2dyb3VuZC1pbWFnZTogdXJsKFxcXCIke2dldERhc2hlZEJvcmRlcigpfVxcXCIpO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JTdXJmYWNlfTtcbmBcbmNvbnN0IGFjdGl2ZURyYWcgPSBjc3NgXG4gIGJhY2tncm91bmQtaW1hZ2U6IHVybChcXFwiJHtnZXREYXNoZWRCb3JkZXIoJ2FjdGl2ZScpfVxcXCIpO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JQcmltYXJ5OTV9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcbmNvbnN0IGZpbGVEcm9wcGVkID0gY3NzYFxuICBiYWNrZ3JvdW5kLWltYWdlOiB1cmwoXFxcIiR7Z2V0RGFzaGVkQm9yZGVyKCl9XFxcIik7XG4gIGJhY2tncm91bmQtY29sb3I6ICR7Y3VzdG9tUHJvcGVydGllcy5jb2xvclN1cmZhY2V9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgYmFzZSxcbiAgcmVhZHlGb3JEcm9wLFxuICBmaWxlRHJvcHBlZCxcbiAgYWN0aXZlRHJhZyxcbn1cbiJdfQ== */");
|
|
399
|
-
const activeDrag = /*#__PURE__*/react.css("background-image:url(\"", getDashedBorder('active'), "\");background-color:", uiKit.customProperties.colorPrimary95, ";padding:", uiKit.customProperties.spacing50, " 100px;" + (process.env.NODE_ENV === "production"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R7Z2V0RGFzaGVkQm9yZGVyKCl9XFxcIik7XG4gIGJhY2tncm91bmQtY29sb3I6ICR7Y3VzdG9tUHJvcGVydGllcy5jb2xvclN1cmZhY2V9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgYmFzZSxcbiAgcmVhZHlGb3JEcm9wLFxuICBmaWxlRHJvcHBlZCxcbiAgYWN0aXZlRHJhZyxcbn1cbiJdfQ== */");
|
|
400
|
-
const fileDropped = /*#__PURE__*/react.css("background-image:url(\"", getDashedBorder(), "\");background-color:", uiKit.customProperties.colorSurface, ";padding:", uiKit.customProperties.spacing50, " 100px;" + (process.env.NODE_ENV === "production" ? "" : ";label:fileDropped;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5Q3VCIiwiZmlsZSI6InN0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGN1c3RvbVByb3BlcnRpZXMgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxudHlwZSBEcm9wQXJlYVN0YXRlID0gJ2RlZmF1bHQnIHwgJ2Vycm9yJyB8ICdhY3RpdmUnXG5cbmNvbnN0IGdldEJvcmRlckNvbG9yID0gKHN0YXRlOiBEcm9wQXJlYVN0YXRlKSA9PiB7XG4gIGNvbnN0IGJvcmRlckNvbG9ycyA9IHtcbiAgICBkZWZhdWx0OiAnIzkwOWRiYycsXG4gICAgZXJyb3I6ICcjZTYwMDUwJyxcbiAgICBhY3RpdmU6IGN1c3RvbVByb3BlcnRpZXMuY29sb3JQcmlt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fVxcXCIpO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JTdXJmYWNlfTtcbmBcbmNvbnN0IGFjdGl2ZURyYWcgPSBjc3NgXG4gIGJhY2tncm91bmQtaW1hZ2U6IHVybChcXFwiJHtnZXREYXNoZWRCb3JkZXIoJ2FjdGl2ZScpfVxcXCIpO1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAke2N1c3RvbVByb3BlcnRpZXMuY29sb3JQcmltYXJ5OTV9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcbmNvbnN0IGZpbGVEcm9wcGVkID0gY3NzYFxuICBiYWNrZ3JvdW5kLWltYWdlOiB1cmwoXFxcIiR7Z2V0RGFzaGVkQm9yZGVyKCl9XFxcIik7XG4gIGJhY2tncm91bmQtY29sb3I6ICR7Y3VzdG9tUHJvcGVydGllcy5jb2xvclN1cmZhY2V9O1xuICBwYWRkaW5nOiAke2N1c3RvbVByb3BlcnRpZXMuc3BhY2luZzUwfSAxMDBweDtcbmBcblxuZXhwb3J0IGNvbnN0IHN0eWxlcyA9IHtcbiAgYmFzZSxcbiAgcmVhZHlGb3JEcm9wLFxuICBmaWxlRHJvcHBlZCxcbiAgYWN0aXZlRHJhZyxcbn1cbiJdfQ== */");
|
|
401
|
-
const styles = {
|
|
402
|
-
base,
|
|
403
|
-
readyForDrop,
|
|
404
|
-
fileDropped,
|
|
405
|
-
activeDrag
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
const DropWrapper = /*#__PURE__*/_styled__default["default"]("div", process.env.NODE_ENV === "production" ? {
|
|
409
|
-
target: "e19vac9v0"
|
|
410
|
-
} : {
|
|
411
|
-
target: "e19vac9v0",
|
|
412
|
-
label: "DropWrapper"
|
|
413
|
-
})(styles.base, " ", props => {
|
|
414
|
-
if (props.dropAreaState === 'ready-for-drop') {
|
|
415
|
-
return styles.readyForDrop;
|
|
416
|
-
}
|
|
417
|
-
if (props.dropAreaState === 'active-drag') {
|
|
418
|
-
return styles.activeDrag;
|
|
419
|
-
}
|
|
420
|
-
if (props.dropAreaState === 'file-dropped') {
|
|
421
|
-
return styles.fileDropped;
|
|
422
|
-
}
|
|
423
|
-
return getDefaultDropWrapperStyles(props.dropAreaState);
|
|
424
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFTdUQiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */"));
|
|
425
|
-
function getDefaultDropWrapperStyles(_dropAreaState) {
|
|
426
|
-
return /*#__PURE__*/react.css(process.env.NODE_ENV === "production" ? "" : ";label:getDefaultDropWrapperStyles;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRyb3AtYXJlYS13cmFwcGVyLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF5QlkiLCJmaWxlIjoiZHJvcC1hcmVhLXdyYXBwZXIudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdHlwZSBEcm9wem9uZVJvb3RQcm9wcyB9IGZyb20gJ3JlYWN0LWRyb3B6b25lJ1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IHN0eWxlcyB9IGZyb20gJy4vc3R5bGVzJ1xuaW1wb3J0IHsgdHlwZSBEcm9wQXJlYVN0YXRlIH0gZnJvbSAnLi4vLi4vLi4vQHR5cGVzJ1xuXG5pbnRlcmZhY2UgRHJvcFdyYXBwZXJQcm9wcyBleHRlbmRzIERyb3B6b25lUm9vdFByb3BzIHtcbiAgZHJvcEFyZWFTdGF0ZTogRHJvcEFyZWFTdGF0ZVxufVxuZXhwb3J0IGNvbnN0IERyb3BXcmFwcGVyID0gc3R5bGVkLmRpdjxEcm9wV3JhcHBlclByb3BzPmBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHsocHJvcHMpID0+IHtcbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ3JlYWR5LWZvci1kcm9wJykge1xuICAgICAgcmV0dXJuIHN0eWxlcy5yZWFkeUZvckRyb3BcbiAgICB9XG4gICAgaWYgKHByb3BzLmRyb3BBcmVhU3RhdGUgPT09ICdhY3RpdmUtZHJhZycpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuYWN0aXZlRHJhZ1xuICAgIH1cbiAgICBpZiAocHJvcHMuZHJvcEFyZWFTdGF0ZSA9PT0gJ2ZpbGUtZHJvcHBlZCcpIHtcbiAgICAgIHJldHVybiBzdHlsZXMuZmlsZURyb3BwZWRcbiAgICB9XG4gICAgcmV0dXJuIGdldERlZmF1bHREcm9wV3JhcHBlclN0eWxlcyhwcm9wcy5kcm9wQXJlYVN0YXRlKVxuICB9fVxuYFxuZnVuY3Rpb24gZ2V0RGVmYXVsdERyb3BXcmFwcGVyU3R5bGVzKF9kcm9wQXJlYVN0YXRlOiBuZXZlcikge1xuICByZXR1cm4gY3NzYGBcbn1cbiJdfQ== */");
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
var ActiveDragDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./active-drag-drop-area-d4747efc.cjs.dev.js'); }));
|
|
430
|
-
|
|
431
|
-
var EnabledDropArea = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./enabled-drop-area-c750b6ba.cjs.dev.js'); }));
|
|
432
|
-
|
|
433
|
-
var FileDropped = /*#__PURE__*/React.lazy(() => Promise.resolve().then(function () { return require('./file-dropped-area-0d73f0f6.cjs.dev.js'); }));
|
|
434
|
-
|
|
435
|
-
function getDropArea(_ref) {
|
|
436
|
-
let dropAreaState = _ref.dropAreaState,
|
|
437
|
-
isFileDropped = _ref.isFileDropped;
|
|
438
|
-
if (dropAreaState === 'ready-for-drop') {
|
|
439
|
-
return jsxRuntime.jsx(EnabledDropArea, {});
|
|
440
|
-
}
|
|
441
|
-
if (dropAreaState === 'file-dropped') {
|
|
442
|
-
return jsxRuntime.jsx(FileDropped, {});
|
|
443
|
-
}
|
|
444
|
-
if (dropAreaState === 'active-drag') {
|
|
445
|
-
return jsxRuntime.jsx(ActiveDragDropArea, {
|
|
446
|
-
isFileDropped: isFileDropped
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
return fallbackDropArea();
|
|
450
|
-
}
|
|
451
|
-
function fallbackDropArea(_invalidDropAreaState) {
|
|
452
|
-
return jsxRuntime.jsx(FileDropped, {});
|
|
453
|
-
}
|
|
454
|
-
function getDropAreaState(flags) {
|
|
455
|
-
if (flags.isDragActive) {
|
|
456
|
-
return 'active-drag';
|
|
457
|
-
}
|
|
458
|
-
if (flags.isReady) {
|
|
459
|
-
return 'file-dropped';
|
|
460
|
-
}
|
|
461
|
-
return 'ready-for-drop';
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
var messages$4 = reactIntl.defineMessages({
|
|
465
|
-
dragAndDropCSV: {
|
|
466
|
-
id: 'UnpublishProductsModal.dragAndDropCSV',
|
|
467
|
-
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
468
|
-
defaultMessage: 'Drag and drop CSV'
|
|
469
|
-
},
|
|
470
|
-
or: {
|
|
471
|
-
id: 'UnpublishProductsModal.or',
|
|
472
|
-
description: 'The word "or" in the drag and drop message',
|
|
473
|
-
defaultMessage: 'or'
|
|
474
|
-
},
|
|
475
|
-
browseButton: {
|
|
476
|
-
id: 'UnpublishProductsModal.browseFile',
|
|
477
|
-
defaultMessage: 'Browse file'
|
|
478
|
-
},
|
|
479
|
-
uploadAndPreview: {
|
|
480
|
-
id: 'UnpublishProductsModal.uploadAndPreview',
|
|
481
|
-
description: 'Label for the button that uploads the file and shows the preview',
|
|
482
|
-
defaultMessage: 'Upload and preview'
|
|
483
|
-
},
|
|
484
|
-
chooseFile: {
|
|
485
|
-
id: 'UnpublishProductsModal.chooseFile',
|
|
486
|
-
description: 'Label for a button on the file upload page, shown on ready to upload state',
|
|
487
|
-
defaultMessage: 'Choose file'
|
|
488
|
-
},
|
|
489
|
-
fileUploadFailed: {
|
|
490
|
-
id: 'UnpublishProductsModal.fileUploadFailed',
|
|
491
|
-
description: 'A title on the file upload page, shown on file upload error state',
|
|
492
|
-
defaultMessage: 'File upload failed'
|
|
493
|
-
},
|
|
494
|
-
fileFormatNotSupported: {
|
|
495
|
-
id: 'UnpublishProductsModal.fileFormatNotSupported',
|
|
496
|
-
description: 'Error message displayed when a user drags and drops a non-CSV file',
|
|
497
|
-
defaultMessage: 'Invalid file format: The file is not in CSV format and cannot be processed.'
|
|
498
|
-
},
|
|
499
|
-
tooManyFilesError: {
|
|
500
|
-
id: 'UnpublishProductsModal.tooManyFilesError',
|
|
501
|
-
description: 'Error message displayed when a user drags and drops multiple files at once',
|
|
502
|
-
defaultMessage: 'Multiple files detected: You can only drag and drop one file at a time.'
|
|
503
|
-
},
|
|
504
|
-
genericError: {
|
|
505
|
-
id: 'UnpublishProductsModal.genericError',
|
|
506
|
-
description: 'Default error message for unexpected file upload issues (for unhandled cases)',
|
|
507
|
-
defaultMessage: 'Error occurred: Please try uploading the file again or contact our support team for assistance.'
|
|
508
|
-
},
|
|
509
|
-
dataType: {
|
|
510
|
-
id: 'UnpublishProductsModal.dataType',
|
|
511
|
-
description: 'Label for the data type selection dropdown',
|
|
512
|
-
defaultMessage: 'Data type'
|
|
513
|
-
},
|
|
514
|
-
instructions: {
|
|
515
|
-
id: 'UnpublishProductsModal.instructions',
|
|
516
|
-
description: 'Label for the instructions section',
|
|
517
|
-
defaultMessage: 'Instructions'
|
|
518
|
-
}
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
522
|
-
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function () { return !!t; })(); }
|
|
523
|
-
let HttpError = /*#__PURE__*/function (_Error) {
|
|
524
|
-
function HttpError(statusCode, statusText, errorData) {
|
|
525
|
-
var _this;
|
|
526
|
-
_classCallCheck(this, HttpError);
|
|
527
|
-
_this = _callSuper$1(this, HttpError, [`HTTP Error! Status code: ${statusCode}, message: "${statusText ? statusText : ''}"`]);
|
|
528
|
-
_this.statusCode = void 0;
|
|
529
|
-
_this.errorData = void 0;
|
|
530
|
-
_this.name = 'HttpError';
|
|
531
|
-
_this.statusCode = statusCode;
|
|
532
|
-
_this.errorData = errorData;
|
|
533
|
-
return _this;
|
|
534
|
-
}
|
|
535
|
-
_inherits(HttpError, _Error);
|
|
536
|
-
return _createClass(HttpError);
|
|
537
|
-
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
538
|
-
|
|
539
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
540
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
541
|
-
let MissingUnpublishProductsProviderError = /*#__PURE__*/function (_Error) {
|
|
542
|
-
function MissingUnpublishProductsProviderError() {
|
|
543
|
-
var _this;
|
|
544
|
-
_classCallCheck(this, MissingUnpublishProductsProviderError);
|
|
545
|
-
_this = _callSuper(this, MissingUnpublishProductsProviderError, ['useUnpublishProductsProviderError must be used within MissingUnpublishProductsProviderError']);
|
|
546
|
-
_this.name = 'MissingUnpublishProductsProviderError';
|
|
547
|
-
return _this;
|
|
548
|
-
}
|
|
549
|
-
_inherits(MissingUnpublishProductsProviderError, _Error);
|
|
550
|
-
return _createClass(MissingUnpublishProductsProviderError);
|
|
551
|
-
}(/*#__PURE__*/_wrapNativeSuper(Error));
|
|
552
|
-
|
|
553
|
-
const useUnpublishProductsContext = () => {
|
|
554
|
-
const context = React.useContext(UnpublishProductsContext);
|
|
555
|
-
if (!context) {
|
|
556
|
-
throw new MissingUnpublishProductsProviderError();
|
|
557
|
-
}
|
|
558
|
-
return context;
|
|
559
|
-
};
|
|
560
|
-
|
|
561
|
-
var messages$3 = reactIntl.defineMessages({
|
|
562
|
-
fileSizeExceededTitle: {
|
|
563
|
-
id: 'UnpublishProductsModal.sizeExceededTitle',
|
|
564
|
-
defaultMessage: 'File size exceeded'
|
|
565
|
-
},
|
|
566
|
-
fileSizeExceededDescription: {
|
|
567
|
-
id: 'UnpublishProductsModal.sizeExceededDescription',
|
|
568
|
-
description: 'Error description when the file size exceeds the allowable limit',
|
|
569
|
-
defaultMessage: 'The file exceeds the maximum allowed size of {fileSizeLimit} MB'
|
|
570
|
-
},
|
|
571
|
-
rowLimitExceededTitle: {
|
|
572
|
-
id: 'UnpublishProductsModal.rowLimitExceededTitle',
|
|
573
|
-
defaultMessage: 'Row limit exceeded'
|
|
574
|
-
},
|
|
575
|
-
rowLimitExceededDescription: {
|
|
576
|
-
id: 'UnpublishProductsModal.rowLimitExceededDescription',
|
|
577
|
-
description: 'Error description when the file contains more rows than the allowable maximum',
|
|
578
|
-
defaultMessage: 'The file contains more than the allowable maximum of {rowLimit} rows'
|
|
579
|
-
},
|
|
580
|
-
dropAreaNotEnoughRowsTitle: {
|
|
581
|
-
id: 'UnpublishProductsModal.dropAreaNotEnoughRowsTitle',
|
|
582
|
-
description: 'Error title shown when the uploaded CSV file does not contain a header and at least one row of data',
|
|
583
|
-
defaultMessage: 'Invalid CSV file'
|
|
584
|
-
},
|
|
585
|
-
dropAreaNotEnoughRowsDescription: {
|
|
586
|
-
id: 'UnpublishProductsModal.dropAreaNotEnoughRowsDescription',
|
|
587
|
-
description: 'Error description shown when the uploaded CSV file does not contain a header and at least one row of data',
|
|
588
|
-
defaultMessage: 'Make sure the file contains a header and at least one row of data'
|
|
589
|
-
},
|
|
590
|
-
unexpectedError: {
|
|
591
|
-
id: 'UnpublishProductsModal.unexpectedError',
|
|
592
|
-
description: 'Generic notification message when file upload fails',
|
|
593
|
-
defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
|
|
594
|
-
},
|
|
595
|
-
missingRequiredField: {
|
|
596
|
-
id: 'UnpublishProductsModal.missingRequiredField',
|
|
597
|
-
description: 'Error message displayed when a required field is missing',
|
|
598
|
-
defaultMessage: 'Missing required field'
|
|
599
|
-
},
|
|
600
|
-
missingKeyError: {
|
|
601
|
-
id: 'UnpublishProductsModal.missingKeyError',
|
|
602
|
-
description: 'Error message displayed when the uploaded file is missing the key field',
|
|
603
|
-
defaultMessage: "The 'key' field is missing or incomplete in some rows. Please ensure every row has a 'key' value."
|
|
604
|
-
},
|
|
605
|
-
csvFormatErrorTitle: {
|
|
606
|
-
id: 'UnpublishProductsModal.csvFormatErrorTitle',
|
|
607
|
-
description: 'Error title shown when the uploaded CSV file is not formatted correctly',
|
|
608
|
-
defaultMessage: 'Invalid CSV file'
|
|
609
|
-
},
|
|
610
|
-
csvFormatErrorDescription: {
|
|
611
|
-
id: 'UnpublishProductsModal.csvFormatErrorDescription',
|
|
612
|
-
description: 'Error message displayed when the CSV file is not formatted correctly',
|
|
613
|
-
defaultMessage: "Your CSV file is not formatted correctly. Make sure the file contains only one column named 'key', which includes the product keys"
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
|
|
617
|
-
const IMPORT_TAG_KEYS = {
|
|
618
|
-
source: 'source'
|
|
619
|
-
};
|
|
620
|
-
const IMPORT_TAG_VALUES = {
|
|
621
|
-
fileUpload: 'file-upload'
|
|
622
|
-
};
|
|
623
|
-
const TAG_KEY_SOURCE_FILE_UPLOAD = `${IMPORT_TAG_KEYS.source}:${IMPORT_TAG_VALUES.fileUpload}`;
|
|
624
|
-
const FILE_SIZE_LIMIT_MB = 35;
|
|
625
|
-
const ROW_COUNT_LIMIT = 80_000;
|
|
626
|
-
const DOCUMENTATION_LINK = 'https://docs.commercetools.com/merchant-center/product-list#bulk-unpublish-via-csv-import';
|
|
627
|
-
const TEMPLATE_DOWNLOAD_LINK = 'https://docs.commercetools.com/merchant-center/downloads/product_unpublish_import_template.csv';
|
|
628
|
-
|
|
629
|
-
function ownKeys$8(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; }
|
|
630
|
-
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$8(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$8(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
631
|
-
const addProxyPrefixToUrl = (uri, proxy) => {
|
|
632
|
-
return proxy ? `/proxy/${proxy}${uri}` : uri;
|
|
633
|
-
};
|
|
634
|
-
const fetchUsingXhr = _ref2 => {
|
|
635
|
-
let url = _ref2.url,
|
|
636
|
-
payload = _ref2.payload,
|
|
637
|
-
config = _ref2.config,
|
|
638
|
-
onProgress = _ref2.onProgress,
|
|
639
|
-
onSuccess = _ref2.onSuccess,
|
|
640
|
-
onError = _ref2.onError;
|
|
641
|
-
const options = applicationShell.createHttpClientOptions({
|
|
642
|
-
headers: _objectSpread$8({
|
|
643
|
-
'Content-Type': 'application/json'
|
|
644
|
-
}, config?.headers)
|
|
645
|
-
});
|
|
646
|
-
const xhr = new XMLHttpRequest();
|
|
647
|
-
xhr.open(config?.method, applicationShell.buildApiUrl(addProxyPrefixToUrl(url, config?.proxy)), true);
|
|
648
|
-
// Include cookies in the request
|
|
649
|
-
xhr.withCredentials = true;
|
|
650
|
-
if (options.headers) {
|
|
651
|
-
var _context;
|
|
652
|
-
_forEachInstanceProperty__default["default"](_context = _Object$keys__default["default"](options.headers)).call(_context, key => {
|
|
653
|
-
xhr.setRequestHeader(key, options.headers[key]);
|
|
654
|
-
});
|
|
655
|
-
}
|
|
656
|
-
xhr.upload.onprogress = function (event) {
|
|
657
|
-
if (event.lengthComputable) {
|
|
658
|
-
const percentComplete = event.loaded / event.total * 100;
|
|
659
|
-
onProgress(percentComplete);
|
|
660
|
-
}
|
|
661
|
-
};
|
|
662
|
-
xhr.onload = function () {
|
|
663
|
-
const data = JSON.parse(xhr.responseText);
|
|
664
|
-
// Code copied from `executeHttpClientRequest` to replicate the same behavior
|
|
665
|
-
const refreshedSessionToken = xhr.getResponseHeader('x-refreshed-session-token');
|
|
666
|
-
if (refreshedSessionToken) {
|
|
667
|
-
applicationShellConnectors.oidcStorage.setActiveSession(refreshedSessionToken);
|
|
668
|
-
}
|
|
669
|
-
if (xhr.status >= 200 && xhr.status < 300) {
|
|
670
|
-
onSuccess(data);
|
|
671
|
-
} else {
|
|
672
|
-
onError(new HttpError(xhr.status, xhr.statusText, data));
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
xhr.onerror = function () {
|
|
676
|
-
const errorData = JSON.parse(xhr.responseText);
|
|
677
|
-
onError(new HttpError(xhr.status, xhr.statusText, errorData));
|
|
678
|
-
};
|
|
679
|
-
xhr.onabort = function () {
|
|
680
|
-
onError(new DOMException('Aborted', 'AbortError'));
|
|
681
|
-
};
|
|
682
|
-
xhr.send(payload);
|
|
683
|
-
return xhr;
|
|
684
|
-
};
|
|
685
|
-
|
|
686
|
-
function uploadFileForImport(_ref) {
|
|
687
|
-
let projectKey = _ref.projectKey,
|
|
688
|
-
containerKey = _ref.containerKey,
|
|
689
|
-
file = _ref.file,
|
|
690
|
-
abortSignal = _ref.abortSignal,
|
|
691
|
-
onSuccess = _ref.onSuccess,
|
|
692
|
-
onProgress = _ref.onProgress,
|
|
693
|
-
onError = _ref.onError;
|
|
694
|
-
const uri = getFileUploadURL(projectKey, containerKey);
|
|
695
|
-
const formData = new FormData();
|
|
696
|
-
formData.append('file', file, file.name);
|
|
697
|
-
return fetchUsingXhr({
|
|
698
|
-
url: uri,
|
|
699
|
-
payload: formData,
|
|
700
|
-
config: {
|
|
701
|
-
abortSignal,
|
|
702
|
-
proxy: constants.MC_API_PROXY_TARGETS.IMPORT,
|
|
703
|
-
method: 'POST',
|
|
704
|
-
headers: {
|
|
705
|
-
'Content-Type': null
|
|
706
|
-
}
|
|
707
|
-
},
|
|
708
|
-
onProgress,
|
|
709
|
-
onSuccess,
|
|
710
|
-
onError
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
const useUpload = () => {
|
|
715
|
-
const intl = reactIntl.useIntl();
|
|
716
|
-
const projectKey = applicationShellConnectors.useApplicationContext(context => context.project?.key);
|
|
717
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
718
|
-
state = _useUnpublishProducts.state,
|
|
719
|
-
actions = _useUnpublishProducts.actions;
|
|
720
|
-
const asyncDispatch = sdk.useAsyncDispatch();
|
|
721
|
-
const showNotification = actionsGlobal.useShowNotification();
|
|
722
|
-
React__default["default"].useEffect(() => {
|
|
723
|
-
return () => {
|
|
724
|
-
if (state.abortController) state.abortController.abort();
|
|
725
|
-
};
|
|
726
|
-
}, [state.abortController]);
|
|
727
|
-
const isFileValid = async file => {
|
|
728
|
-
const errors = [];
|
|
729
|
-
const rowCount = await getRowCount(file);
|
|
730
|
-
if (rowCount < 1) errors.push({
|
|
731
|
-
title: intl.formatMessage(messages$3.dropAreaNotEnoughRowsTitle),
|
|
732
|
-
description: intl.formatMessage(messages$3.dropAreaNotEnoughRowsDescription)
|
|
733
|
-
});
|
|
734
|
-
if (file.size > toBytes(FILE_SIZE_LIMIT_MB)) errors.push({
|
|
735
|
-
title: intl.formatMessage(messages$3.fileSizeExceededTitle),
|
|
736
|
-
description: intl.formatMessage(messages$3.fileSizeExceededDescription, {
|
|
737
|
-
fileSizeLimit: intl.formatNumber(FILE_SIZE_LIMIT_MB)
|
|
738
|
-
})
|
|
739
|
-
});
|
|
740
|
-
if (!(await hasSingleKeyColumn(file))) {
|
|
741
|
-
errors.push({
|
|
742
|
-
title: intl.formatMessage(messages$3.csvFormatErrorTitle),
|
|
743
|
-
description: intl.formatMessage(messages$3.csvFormatErrorDescription)
|
|
744
|
-
});
|
|
745
|
-
}
|
|
746
|
-
if (rowCount > ROW_COUNT_LIMIT) errors.push({
|
|
747
|
-
title: intl.formatMessage(messages$3.rowLimitExceededTitle),
|
|
748
|
-
description: intl.formatMessage(messages$3.rowLimitExceededDescription, {
|
|
749
|
-
rowLimit: intl.formatNumber(ROW_COUNT_LIMIT)
|
|
750
|
-
})
|
|
751
|
-
});
|
|
752
|
-
if (errors.length > 0) {
|
|
753
|
-
actions.setFileUploadErrors(errors);
|
|
754
|
-
actions.setCurrentStep('upload-error');
|
|
755
|
-
return false;
|
|
756
|
-
}
|
|
757
|
-
return true;
|
|
758
|
-
};
|
|
759
|
-
const handleUploadError = error => {
|
|
760
|
-
if (isAbortError(error)) {
|
|
761
|
-
actions.cancelImport();
|
|
762
|
-
return;
|
|
763
|
-
}
|
|
764
|
-
if (error instanceof HttpError) {
|
|
765
|
-
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
766
|
-
actions.setFileUploadErrors([{
|
|
767
|
-
title: intl.formatMessage(messages$3.missingRequiredField),
|
|
768
|
-
description: intl.formatMessage(messages$3.missingKeyError)
|
|
769
|
-
}]);
|
|
770
|
-
actions.setCurrentStep('upload-error');
|
|
771
|
-
} else {
|
|
772
|
-
actions.cancelImport();
|
|
773
|
-
showNotification({
|
|
774
|
-
kind: 'error',
|
|
775
|
-
domain: constants.DOMAINS.PAGE,
|
|
776
|
-
text: intl.formatMessage(messages$3.unexpectedError)
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
} else {
|
|
780
|
-
actions.cancelImport();
|
|
781
|
-
showNotification({
|
|
782
|
-
kind: 'error',
|
|
783
|
-
domain: constants.DOMAINS.PAGE,
|
|
784
|
-
text: String(error)
|
|
785
|
-
});
|
|
786
|
-
sentry.reportErrorToSentry(new Error('Upload File Error: An unexpected issue occurred while uploading the file'), {
|
|
787
|
-
extra: {
|
|
788
|
-
error,
|
|
789
|
-
projectKey,
|
|
790
|
-
containerKey: state.containerKey,
|
|
791
|
-
fileSizeInBytes: state.droppedFile?.size
|
|
792
|
-
}
|
|
793
|
-
});
|
|
794
|
-
}
|
|
795
|
-
};
|
|
796
|
-
const handleUploadAndValidation = async () => {
|
|
797
|
-
if (!projectKey || !state.droppedFile) return;
|
|
798
|
-
const canUpload = await isFileValid(state.droppedFile);
|
|
799
|
-
if (!canUpload) return;
|
|
800
|
-
actions.setCurrentStep('uploading');
|
|
801
|
-
const containerKey = encodeFileNameWithTimestampToContainerKey(state.droppedFile.name);
|
|
802
|
-
actions.setContainerKey(containerKey);
|
|
803
|
-
try {
|
|
804
|
-
await createImportContainerForFileUpload({
|
|
805
|
-
key: containerKey,
|
|
806
|
-
tags: [TAG_KEY_SOURCE_FILE_UPLOAD],
|
|
807
|
-
resourceType: 'product',
|
|
808
|
-
settings: {
|
|
809
|
-
resourceType: 'product-draft',
|
|
810
|
-
format: 'CSV',
|
|
811
|
-
options: {
|
|
812
|
-
unpublishAllChanges: true
|
|
813
|
-
}
|
|
814
|
-
}
|
|
815
|
-
}, projectKey, asyncDispatch);
|
|
816
|
-
const newAbortController = uploadFileForImport({
|
|
817
|
-
projectKey,
|
|
818
|
-
containerKey,
|
|
819
|
-
file: state.droppedFile,
|
|
820
|
-
onSuccess: fileUploadResponse => {
|
|
821
|
-
actions.setUploadFileResponse(fileUploadResponse);
|
|
822
|
-
actions.setCurrentStep('upload-preview');
|
|
823
|
-
},
|
|
824
|
-
onProgress: progress => {
|
|
825
|
-
actions.setProgress(progress);
|
|
826
|
-
},
|
|
827
|
-
onError: error => {
|
|
828
|
-
deleteImportContainer(projectKey, containerKey, asyncDispatch);
|
|
829
|
-
handleUploadError(error);
|
|
830
|
-
}
|
|
831
|
-
});
|
|
832
|
-
actions.setAbortController(newAbortController);
|
|
833
|
-
} catch (error) {
|
|
834
|
-
deleteImportContainer(projectKey, containerKey, asyncDispatch);
|
|
835
|
-
handleUploadError(error);
|
|
836
|
-
}
|
|
837
|
-
};
|
|
838
|
-
return {
|
|
839
|
-
handleUploadAndValidation
|
|
840
|
-
};
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
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; }
|
|
844
|
-
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$7(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$7(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
845
|
-
const FileDropArea = () => {
|
|
846
|
-
const intl = reactIntl.useIntl();
|
|
847
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
848
|
-
state = _useUnpublishProducts.state,
|
|
849
|
-
actions = _useUnpublishProducts.actions;
|
|
850
|
-
const showNotification = actionsGlobal.useShowNotification();
|
|
851
|
-
const onDrop = React__default["default"].useCallback(_ref => {
|
|
852
|
-
let _ref2 = _slicedToArray(_ref, 1),
|
|
853
|
-
file = _ref2[0];
|
|
854
|
-
if (!file) return;
|
|
855
|
-
actions.setDroppedFile(file);
|
|
856
|
-
}, [actions]);
|
|
857
|
-
const _useDropzone = reactDropzone.useDropzone({
|
|
858
|
-
onDrop,
|
|
859
|
-
multiple: false,
|
|
860
|
-
accept: {
|
|
861
|
-
'text/csv': ['.csv']
|
|
862
|
-
},
|
|
863
|
-
onDropRejected: _ref3 => {
|
|
864
|
-
var _context, _context2;
|
|
865
|
-
let _ref4 = _slicedToArray(_ref3, 1),
|
|
866
|
-
rejectedFile = _ref4[0];
|
|
867
|
-
if (_someInstanceProperty__default["default"](_context = rejectedFile.errors).call(_context, error => error.code === 'too-many-files')) {
|
|
868
|
-
showNotification({
|
|
869
|
-
kind: 'error',
|
|
870
|
-
domain: constants.DOMAINS.PAGE,
|
|
871
|
-
text: intl.formatMessage(messages$4.tooManyFilesError)
|
|
872
|
-
});
|
|
873
|
-
return;
|
|
874
|
-
}
|
|
875
|
-
if (_someInstanceProperty__default["default"](_context2 = rejectedFile.errors).call(_context2, error => error.code === 'file-invalid-type')) {
|
|
876
|
-
showNotification({
|
|
877
|
-
kind: 'error',
|
|
878
|
-
domain: constants.DOMAINS.PAGE,
|
|
879
|
-
text: intl.formatMessage(messages$4.fileFormatNotSupported)
|
|
880
|
-
});
|
|
881
|
-
} else {
|
|
882
|
-
showNotification({
|
|
883
|
-
kind: 'error',
|
|
884
|
-
domain: constants.DOMAINS.PAGE,
|
|
885
|
-
text: intl.formatMessage(messages$4.genericError)
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
}
|
|
889
|
-
}),
|
|
890
|
-
getRootProps = _useDropzone.getRootProps,
|
|
891
|
-
getInputProps = _useDropzone.getInputProps,
|
|
892
|
-
isDragActive = _useDropzone.isDragActive;
|
|
893
|
-
const dropAreaState = React__default["default"].useMemo(() => getDropAreaState({
|
|
894
|
-
isReady: Boolean(state.droppedFile),
|
|
895
|
-
isDragActive
|
|
896
|
-
}), [state.droppedFile, isDragActive]);
|
|
897
|
-
const dropArea = getDropArea({
|
|
898
|
-
dropAreaState,
|
|
899
|
-
isFileDropped: Boolean(state.droppedFile)
|
|
900
|
-
});
|
|
901
|
-
return jsxRuntime.jsxs(DropWrapper, _objectSpread$7(_objectSpread$7({
|
|
902
|
-
role: "presentation"
|
|
903
|
-
}, getRootProps()), {}, {
|
|
904
|
-
dropAreaState: dropAreaState,
|
|
905
|
-
children: [jsxRuntime.jsx("input", _objectSpread$7({
|
|
906
|
-
"data-testid": "file-input"
|
|
907
|
-
}, getInputProps())), jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
908
|
-
children: dropArea
|
|
909
|
-
})]
|
|
910
|
-
}));
|
|
911
|
-
};
|
|
912
|
-
|
|
913
|
-
var sharedMessages = reactIntl.defineMessages({
|
|
914
|
-
unpublishModalTitle: {
|
|
915
|
-
id: 'UnpublishProductsModal.unpublishModalTitle',
|
|
916
|
-
description: 'The title of the modal',
|
|
917
|
-
defaultMessage: 'Bulk unpublish via CSV'
|
|
918
|
-
},
|
|
919
|
-
startBulkUnpublish: {
|
|
920
|
-
id: 'UnpublishProductsModal.startBulkUnpublish',
|
|
921
|
-
description: 'Start bulk unpublish button',
|
|
922
|
-
defaultMessage: 'Start bulk unpublish'
|
|
923
|
-
},
|
|
924
|
-
cancel: {
|
|
925
|
-
id: 'UnpublishProductsModal.cancel',
|
|
926
|
-
description: 'The label for the cancel button',
|
|
927
|
-
defaultMessage: 'Cancel'
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
|
|
931
|
-
var messages$2 = reactIntl.defineMessages({
|
|
932
|
-
fileUploadInstructions: {
|
|
933
|
-
id: 'UnpublishProductsModal.fileUploadInstructions',
|
|
934
|
-
description: 'Instructions for uploading a CSV file with product keys to unpublish',
|
|
935
|
-
defaultMessage: "The CSV file must contain the product keys to be unpublished under the header 'key'. Maximum file size is {maxFileSize} MB with a limit of {maxRowCount} rows. Download <csvTemplateLink>the CSV template</csvTemplateLink> or refer to <documentationLink>the documentation</documentationLink>."
|
|
936
|
-
}
|
|
937
|
-
});
|
|
938
|
-
|
|
939
|
-
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; }
|
|
940
|
-
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; }
|
|
941
|
-
const Instructions = () => {
|
|
942
|
-
const intl = reactIntl.useIntl();
|
|
943
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
944
|
-
intlMessage: _objectSpread$6(_objectSpread$6({}, messages$2.fileUploadInstructions), {}, {
|
|
945
|
-
values: {
|
|
946
|
-
maxFileSize: intl.formatNumber(FILE_SIZE_LIMIT_MB),
|
|
947
|
-
maxRowCount: intl.formatNumber(ROW_COUNT_LIMIT),
|
|
948
|
-
csvTemplateLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
949
|
-
tone: "secondary",
|
|
950
|
-
isExternal: true,
|
|
951
|
-
to: TEMPLATE_DOWNLOAD_LINK,
|
|
952
|
-
children: msg
|
|
953
|
-
}, "csvTemplateLink"),
|
|
954
|
-
documentationLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
955
|
-
tone: "secondary",
|
|
956
|
-
isExternal: true,
|
|
957
|
-
to: DOCUMENTATION_LINK,
|
|
958
|
-
children: msg
|
|
959
|
-
}, "documentationLink")
|
|
960
|
-
}
|
|
961
|
-
})
|
|
962
|
-
});
|
|
963
|
-
};
|
|
964
|
-
|
|
965
|
-
const Upload = () => {
|
|
966
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
967
|
-
state = _useUnpublishProducts.state,
|
|
968
|
-
onClose = _useUnpublishProducts.onClose;
|
|
969
|
-
const intl = reactIntl.useIntl();
|
|
970
|
-
const _useUpload = useUpload(),
|
|
971
|
-
handleUploadAndValidation = _useUpload.handleUploadAndValidation;
|
|
972
|
-
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
973
|
-
size: 16,
|
|
974
|
-
isOpen: true,
|
|
975
|
-
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
976
|
-
labelPrimary: intl.formatMessage(messages$4.uploadAndPreview),
|
|
977
|
-
onPrimaryButtonClick: handleUploadAndValidation,
|
|
978
|
-
isPrimaryButtonDisabled: !Boolean(state.droppedFile),
|
|
979
|
-
onSecondaryButtonClick: () => onClose({
|
|
980
|
-
shouldDeleteImportContainer: true
|
|
981
|
-
}),
|
|
982
|
-
onClose: () => onClose({
|
|
983
|
-
shouldDeleteImportContainer: true
|
|
984
|
-
}),
|
|
985
|
-
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
986
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
987
|
-
scale: "m",
|
|
988
|
-
children: [jsxRuntime.jsx(Instructions, {}), jsxRuntime.jsx(FileDropArea, {})]
|
|
989
|
-
})
|
|
990
|
-
})
|
|
991
|
-
});
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
const Uploading = () => {
|
|
995
|
-
const intl = reactIntl.useIntl();
|
|
996
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
997
|
-
state = _useUnpublishProducts.state,
|
|
998
|
-
actions = _useUnpublishProducts.actions,
|
|
999
|
-
onClose = _useUnpublishProducts.onClose;
|
|
1000
|
-
if (state.droppedFile?.name) return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1001
|
-
size: 16,
|
|
1002
|
-
isOpen: true,
|
|
1003
|
-
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
1004
|
-
onClose: () => onClose({
|
|
1005
|
-
shouldDeleteImportContainer: true
|
|
1006
|
-
}),
|
|
1007
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1008
|
-
scale: "m",
|
|
1009
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1010
|
-
alignItems: "center",
|
|
1011
|
-
justifyContent: "space-between",
|
|
1012
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1013
|
-
alignItems: "center",
|
|
1014
|
-
children: [jsxRuntime.jsx(FileIcon, {}), jsxRuntime.jsx(uiKit.Spacings.Inline, {
|
|
1015
|
-
children: jsxRuntime.jsx(uiKit.Constraints.Horizontal, {
|
|
1016
|
-
max: 10,
|
|
1017
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1018
|
-
truncate: true,
|
|
1019
|
-
fontWeight: "bold",
|
|
1020
|
-
children: state.droppedFile.name
|
|
1021
|
-
})
|
|
1022
|
-
})
|
|
1023
|
-
}), jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
1024
|
-
tone: "secondary",
|
|
1025
|
-
children: ["(", intl.formatNumber(convertFileSizeToKB(state.droppedFile.size)), ' ', "KB)"]
|
|
1026
|
-
})]
|
|
1027
|
-
}), jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
1028
|
-
tone: "secondary",
|
|
1029
|
-
size: "medium",
|
|
1030
|
-
label: intl.formatMessage(sharedMessages.cancel),
|
|
1031
|
-
onClick: () => {
|
|
1032
|
-
actions.setCurrentStep('upload');
|
|
1033
|
-
state.abortController.abort();
|
|
1034
|
-
}
|
|
1035
|
-
})]
|
|
1036
|
-
}), jsxRuntime.jsx(uiKit.ProgressBar, {
|
|
1037
|
-
barWidth: "scale",
|
|
1038
|
-
height: "10",
|
|
1039
|
-
progress: state.progress
|
|
1040
|
-
}), jsxRuntime.jsx("div", {})]
|
|
1041
|
-
})
|
|
1042
|
-
});
|
|
1043
|
-
return null;
|
|
1044
|
-
};
|
|
1045
|
-
|
|
1046
|
-
var messages$1 = reactIntl.defineMessages({
|
|
1047
|
-
uploadNewFile: {
|
|
1048
|
-
id: 'UnpublishProductsModal.uploadNewFile',
|
|
1049
|
-
defaultMessage: 'Upload new file'
|
|
1050
|
-
},
|
|
1051
|
-
uploadErrorDescription: {
|
|
1052
|
-
id: 'UnpublishProductsModal.uploadError',
|
|
1053
|
-
description: 'Title when errors detected while uploading file',
|
|
1054
|
-
defaultMessage: 'There {errorsCount, plural, one {is <b>1</b> error} other {are <b>{errorsCount}</b> errors}} detected while uploading the file "{fileName}".'
|
|
1055
|
-
},
|
|
1056
|
-
errorType: {
|
|
1057
|
-
id: 'UnpublishProductsModal.errorType',
|
|
1058
|
-
description: 'Error type" column',
|
|
1059
|
-
defaultMessage: 'Error type'
|
|
1060
|
-
},
|
|
1061
|
-
details: {
|
|
1062
|
-
id: 'UnpublishProductsModal.details',
|
|
1063
|
-
description: '"Details" column',
|
|
1064
|
-
defaultMessage: 'Details'
|
|
1065
|
-
}
|
|
1066
|
-
});
|
|
1067
|
-
|
|
1068
|
-
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; }
|
|
1069
|
-
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$5(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1070
|
-
const getColumns = () => [{
|
|
1071
|
-
key: 'errorType',
|
|
1072
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages$1.errorType)),
|
|
1073
|
-
width: 'max-content'
|
|
1074
|
-
}, {
|
|
1075
|
-
key: 'details',
|
|
1076
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages$1.details))
|
|
1077
|
-
}];
|
|
1078
|
-
const UploadErrorTable = props => {
|
|
1079
|
-
var _context;
|
|
1080
|
-
const pagination = uiKit.usePaginationState({
|
|
1081
|
-
perPage: 10
|
|
1082
|
-
});
|
|
1083
|
-
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1084
|
-
const endIndex = startIndex + pagination.perPage.value;
|
|
1085
|
-
const currentPageRows = _sliceInstanceProperty__default["default"](_context = props.rows).call(_context, startIndex, endIndex);
|
|
1086
|
-
const shouldShowPagination = props.rows.length > pagination.perPage.value;
|
|
1087
|
-
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1088
|
-
scale: "l",
|
|
1089
|
-
children: [jsxRuntime.jsx(uiKit.DataTable, {
|
|
1090
|
-
verticalCellAlignment: "center",
|
|
1091
|
-
isCondensed: true,
|
|
1092
|
-
rows: currentPageRows,
|
|
1093
|
-
columns: getColumns(),
|
|
1094
|
-
itemRenderer: itemRenderer
|
|
1095
|
-
}), shouldShowPagination && jsxRuntime.jsx(uiKit.PageNavigator, {
|
|
1096
|
-
onPageChange: pagination.page.onChange,
|
|
1097
|
-
page: pagination.page.value,
|
|
1098
|
-
totalPages: Math.ceil(props.rows.length / pagination.perPage.value)
|
|
1099
|
-
})]
|
|
1100
|
-
});
|
|
1101
|
-
};
|
|
1102
|
-
function itemRenderer(item, column) {
|
|
1103
|
-
switch (column.key) {
|
|
1104
|
-
case 'errorType':
|
|
1105
|
-
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1106
|
-
isCondensed: true,
|
|
1107
|
-
label: item.title,
|
|
1108
|
-
tone: "critical"
|
|
1109
|
-
});
|
|
1110
|
-
case 'details':
|
|
1111
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1112
|
-
children: item.description
|
|
1113
|
-
});
|
|
1114
|
-
default:
|
|
1115
|
-
return null;
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
function ownKeys$4(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; }
|
|
1120
|
-
function _objectSpread$4(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$4(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$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1121
|
-
const UploadErrorsModal = () => {
|
|
1122
|
-
const intl = reactIntl.useIntl();
|
|
1123
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
1124
|
-
state = _useUnpublishProducts.state,
|
|
1125
|
-
actions = _useUnpublishProducts.actions,
|
|
1126
|
-
onClose = _useUnpublishProducts.onClose;
|
|
1127
|
-
const errorsCount = state.fileUploadErrors.length;
|
|
1128
|
-
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1129
|
-
size: 16,
|
|
1130
|
-
isOpen: true,
|
|
1131
|
-
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
1132
|
-
onClose: () => onClose(),
|
|
1133
|
-
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
1134
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1135
|
-
scale: "l",
|
|
1136
|
-
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1137
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1138
|
-
intlMessage: _objectSpread$4(_objectSpread$4({}, messages$1.uploadErrorDescription), {}, {
|
|
1139
|
-
values: {
|
|
1140
|
-
fileName: state.droppedFile?.name,
|
|
1141
|
-
errorsCount: intl.formatNumber(errorsCount),
|
|
1142
|
-
b: getBold$2
|
|
1143
|
-
}
|
|
1144
|
-
})
|
|
1145
|
-
})
|
|
1146
|
-
}), jsxRuntime.jsx(UploadErrorTable, {
|
|
1147
|
-
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1148
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1149
|
-
scale: "m",
|
|
1150
|
-
justifyContent: "flex-end",
|
|
1151
|
-
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
1152
|
-
label: intl.formatMessage(sharedMessages.cancel),
|
|
1153
|
-
onClick: () => onClose()
|
|
1154
|
-
}), jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
1155
|
-
iconLeft: jsxRuntime.jsx(uiKit.ImportIcon, {}),
|
|
1156
|
-
label: intl.formatMessage(messages$1.uploadNewFile),
|
|
1157
|
-
onClick: () => actions.uploadNewFile()
|
|
1158
|
-
})]
|
|
1159
|
-
})]
|
|
1160
|
-
})
|
|
1161
|
-
})
|
|
1162
|
-
});
|
|
1163
|
-
};
|
|
1164
|
-
function getBold$2(msg) {
|
|
1165
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1166
|
-
as: "span",
|
|
1167
|
-
isBold: true,
|
|
1168
|
-
children: msg
|
|
1169
|
-
}, crypto.randomUUID());
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
var messages = reactIntl.defineMessages({
|
|
1173
|
-
continue: {
|
|
1174
|
-
id: 'UnpublishProductsModal.continue',
|
|
1175
|
-
description: 'Continue button',
|
|
1176
|
-
defaultMessage: 'Continue'
|
|
1177
|
-
},
|
|
1178
|
-
heresAPreview: {
|
|
1179
|
-
id: 'UnpublishProductsModal.heresAPreview',
|
|
1180
|
-
description: 'Here is a preview',
|
|
1181
|
-
defaultMessage: "Here's a preview:"
|
|
1182
|
-
},
|
|
1183
|
-
productsToBeUnpublished: {
|
|
1184
|
-
id: 'UnpublishProductsModal.productsToBeUnpublished',
|
|
1185
|
-
description: 'Products to be unpublished',
|
|
1186
|
-
defaultMessage: '{count, plural, one {<b>{count}</b> product to be unpublished} other {<b>{count}</b> products to be unpublished}}'
|
|
1187
|
-
},
|
|
1188
|
-
confirmationQuestion: {
|
|
1189
|
-
id: 'UnpublishProductsModal.confirmationQuestion',
|
|
1190
|
-
description: 'Confirmation question',
|
|
1191
|
-
defaultMessage: 'Are you sure you want to unpublish the products? '
|
|
1192
|
-
},
|
|
1193
|
-
confirmationText: {
|
|
1194
|
-
id: 'UnpublishProductsModal.confirmationText',
|
|
1195
|
-
description: 'Confirmation text',
|
|
1196
|
-
defaultMessage: '{count, plural, one {You are about to unpublish <b>{count}</b> product in the project: <b>{projectName}</b>.} other {You are about to unpublish <b>{count}</b> products in the project: <b>{projectName}</b>.}}'
|
|
1197
|
-
},
|
|
1198
|
-
importStarted: {
|
|
1199
|
-
id: 'UnpublishProductsModal.importStarted',
|
|
1200
|
-
description: 'Import started',
|
|
1201
|
-
defaultMessage: '<b>Your import for bulk unpublish has started.</b><newline></newline>Go to <logsLink>Import logs</logsLink> to view the progress.'
|
|
1202
|
-
},
|
|
1203
|
-
preparingImport: {
|
|
1204
|
-
id: 'UnpublishProductsModal.preparingImport',
|
|
1205
|
-
description: 'Preparing import',
|
|
1206
|
-
defaultMessage: '<b>Prepare bulk unpublish.</b><newline></newline>Once preparation is complete, you can track the progress <logsLink>in the Import logs</logsLink>. The data will be unpublished after the import is finalized.'
|
|
1207
|
-
}
|
|
1208
|
-
});
|
|
1209
|
-
|
|
1210
|
-
function ownKeys$3(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; }
|
|
1211
|
-
function _objectSpread$3(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$3(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$3(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1212
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
1213
|
-
const getNewLine = () => jsxRuntime.jsx("br", {}, "break");
|
|
1214
|
-
const getImportLogsLink = (msg, projectKey) => jsxRuntime.jsx(uiKit.Link, {
|
|
1215
|
-
to: `/${projectKey}/operations/import/logs`,
|
|
1216
|
-
children: msg
|
|
1217
|
-
}, "link");
|
|
1218
|
-
var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
1219
|
-
name: "1vs9i7r",
|
|
1220
|
-
styles: "width:360px"
|
|
1221
|
-
} : {
|
|
1222
|
-
name: "g36yzl-ImportRunningTextNotification",
|
|
1223
|
-
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVucHVibGlzaC1wcm9kdWN0cy1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXVCWSIsImZpbGUiOiJ1bnB1Ymxpc2gtcHJvZHVjdHMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IH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dXR0b249e3tcbiAgICAgICAgJ2RhdGEtdGVzdC1pZCc6ICdjb25maXJtYXRpb24tZGlhbG9nLWNvbmZpcm0nLFxuICAgICAgfX1cbiAgICAgIGRhdGFBdHRyaWJ1dGVzU2Vjb25kYXJ5QnV0dG9uPXt7XG4gICAgICAgICdkYXRhLXRlc3QtaWQnOiAnY29uZmlybWF0aW9uLWRpYWxvZy1jYW5jZWwnLFxuICAgICAgfX1cbiAgICAgIG9uQ29uZmlybT17YXN5bmMgKCkgPT4ge1xuICAgICAgICB0cnkge1xuICAgICAgICAgIGNvbnN0IGNhbkNvbmZpcm0gPVxuICAgICAgICAgICAgcHJvamVjdEtleSAmJiBzdGF0ZS5jb250YWluZXJLZXkgJiYgc3RhdGUuZHJvcHBlZEZpbGU/Lm5hbWVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICAgIGNvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgIGFzeW5jRGlzcGF0Y2gsXG4gICAgICAgICAgfSlcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxUZXh0LkJvZHlcbiAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgIC4uLm1lc3NhZ2VzLmNvbmZpcm1hdGlvblRleHQsXG4gICAgICAgICAgICAgIHZhbHVlczoge1xuICAgICAgICAgICAgICAgIHByb2plY3ROYW1lOiBwcm9qZWN0TmFtZSxcbiAgICAgICAgICAgICAgICAvLyBUT0RPOiBSZXBsYWNlIHdpdGggYWN0dWFsIGNvdW50XG4gICAgICAgICAgICAgICAgY291bnQ6IGludGwuZm9ybWF0TnVtYmVyKHN0YXRlLnVwbG9hZEZpbGVSZXNwb25zZT8ucm93c0NvdW50KSxcbiAgICAgICAgICAgICAgICBiOiBnZXRCb2xkLFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAvPlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvblF1ZXN0aW9ufSAvPlxuICAgICAgICA8L1NwYWNpbmdzLlN0YWNrPlxuICAgICAgPC9GdWxsU3RvcnlNYXNraW5nLlVubWFzaz5cbiAgICA8L0NvbmZpcm1hdGlvbkRpYWxvZz5cbiAgKVxufVxuXG5mdW5jdGlvbiBnZXRCb2xkKG1zZykge1xuICByZXR1cm4gKFxuICAgIDxUZXh0LkJvZHkgYXM9XCJzcGFuXCIgaXNCb2xkIGtleT17Y3J5cHRvLnJhbmRvbVVVSUQoKX0+XG4gICAgICB7bXNnfVxuICAgIDwvVGV4dC5Cb2R5PlxuICApXG59XG4iXX0= */",
|
|
1224
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1225
|
-
};
|
|
1226
|
-
const ImportRunningTextNotification = props => jsxRuntime.jsx("div", {
|
|
1227
|
-
css: _ref2,
|
|
1228
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1229
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.importStarted), {}, {
|
|
1230
|
-
values: {
|
|
1231
|
-
newline: getNewLine,
|
|
1232
|
-
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
1233
|
-
b: getBold$1
|
|
1234
|
-
}
|
|
1235
|
-
})
|
|
1236
|
-
})
|
|
1237
|
-
});
|
|
1238
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
1239
|
-
name: "1vs9i7r",
|
|
1240
|
-
styles: "width:360px"
|
|
1241
|
-
} : {
|
|
1242
|
-
name: "mjwslu-ImportPreparingTextNotification",
|
|
1243
|
-
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVucHVibGlzaC1wcm9kdWN0cy1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBDWSIsImZpbGUiOiJ1bnB1Ymxpc2gtcHJvZHVjdHMtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnXG5pbXBvcnQgeyBET01BSU5TIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJ1xuaW1wb3J0IHsgTWFza2luZyBhcyBGdWxsU3RvcnlNYXNraW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvZnVsbHN0b3J5J1xuaW1wb3J0IHsgdXNlQXN5bmNEaXNwYXRjaCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL3NkaydcbmltcG9ydCB7IExpbmssIFNwYWNpbmdzLCBUZXh0IH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJ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mZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgcHJvamVjdEtleSxcbiAgICAgICAgICAgIGNvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgIGFzeW5jRGlzcGF0Y2gsXG4gICAgICAgICAgfSlcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbj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cb2R5PlxuICApXG59XG4iXX0= */",
|
|
1244
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1245
|
-
};
|
|
1246
|
-
const ImportPreparingTextNotification = props => jsxRuntime.jsx("div", {
|
|
1247
|
-
css: _ref,
|
|
1248
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1249
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.preparingImport), {}, {
|
|
1250
|
-
values: {
|
|
1251
|
-
newline: getNewLine,
|
|
1252
|
-
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
1253
|
-
b: getBold$1
|
|
1254
|
-
}
|
|
1255
|
-
})
|
|
1256
|
-
})
|
|
1257
|
-
});
|
|
1258
|
-
const UnpublishProductsConfirmationModal = () => {
|
|
1259
|
-
const intl = reactIntl.useIntl();
|
|
1260
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
1261
|
-
state = _useUnpublishProducts.state,
|
|
1262
|
-
onClose = _useUnpublishProducts.onClose;
|
|
1263
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
1264
|
-
projectKey: context.project?.key,
|
|
1265
|
-
projectName: context.project?.name
|
|
1266
|
-
})),
|
|
1267
|
-
projectKey = _useApplicationContex.projectKey,
|
|
1268
|
-
projectName = _useApplicationContex.projectName;
|
|
1269
|
-
const asyncDispatch = sdk.useAsyncDispatch();
|
|
1270
|
-
const showNotification = actionsGlobal.useShowNotification();
|
|
1271
|
-
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
1272
|
-
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
1273
|
-
labelPrimary: intl.formatMessage(sharedMessages.startBulkUnpublish),
|
|
1274
|
-
isOpen: true,
|
|
1275
|
-
onClose: () => onClose({
|
|
1276
|
-
shouldDeleteImportContainer: true
|
|
1277
|
-
}),
|
|
1278
|
-
onCancel: () => onClose({
|
|
1279
|
-
shouldDeleteImportContainer: true
|
|
1280
|
-
}),
|
|
1281
|
-
dataAttributesPrimaryButton: {
|
|
1282
|
-
'data-test-id': 'confirmation-dialog-confirm'
|
|
1283
|
-
},
|
|
1284
|
-
dataAttributesSecondaryButton: {
|
|
1285
|
-
'data-test-id': 'confirmation-dialog-cancel'
|
|
1286
|
-
},
|
|
1287
|
-
onConfirm: async () => {
|
|
1288
|
-
try {
|
|
1289
|
-
const canConfirm = projectKey && state.containerKey && state.droppedFile?.name;
|
|
1290
|
-
if (!canConfirm) return;
|
|
1291
|
-
onClose();
|
|
1292
|
-
showNotification({
|
|
1293
|
-
kind: 'info',
|
|
1294
|
-
domain: constants.DOMAINS.SIDE,
|
|
1295
|
-
// @ts-ignore
|
|
1296
|
-
text: jsxRuntime.jsx(ImportPreparingTextNotification, {
|
|
1297
|
-
projectKey: projectKey
|
|
1298
|
-
})
|
|
1299
|
-
}, {
|
|
1300
|
-
dismissAfter: 5000
|
|
1301
|
-
});
|
|
1302
|
-
await processUploadedFile({
|
|
1303
|
-
projectKey,
|
|
1304
|
-
containerKey: state.containerKey,
|
|
1305
|
-
asyncDispatch
|
|
1306
|
-
});
|
|
1307
|
-
showNotification({
|
|
1308
|
-
kind: 'info',
|
|
1309
|
-
domain: constants.DOMAINS.SIDE,
|
|
1310
|
-
// @ts-ignore
|
|
1311
|
-
text: jsxRuntime.jsx(ImportRunningTextNotification, {
|
|
1312
|
-
projectKey: projectKey
|
|
1313
|
-
})
|
|
1314
|
-
}, {
|
|
1315
|
-
dismissAfter: 5000
|
|
1316
|
-
});
|
|
1317
|
-
} catch (error) {
|
|
1318
|
-
onClose({
|
|
1319
|
-
shouldDeleteImportContainer: true
|
|
1320
|
-
});
|
|
1321
|
-
showNotification({
|
|
1322
|
-
kind: 'error',
|
|
1323
|
-
domain: constants.DOMAINS.PAGE,
|
|
1324
|
-
text: String(error)
|
|
1325
|
-
});
|
|
1326
|
-
}
|
|
1327
|
-
},
|
|
1328
|
-
size: 16,
|
|
1329
|
-
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
1330
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1331
|
-
scale: "xl",
|
|
1332
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1333
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages.confirmationText), {}, {
|
|
1334
|
-
values: {
|
|
1335
|
-
projectName: projectName,
|
|
1336
|
-
// TODO: Replace with actual count
|
|
1337
|
-
count: intl.formatNumber(state.uploadFileResponse?.rowsCount),
|
|
1338
|
-
b: getBold$1
|
|
1339
|
-
}
|
|
1340
|
-
})
|
|
1341
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1342
|
-
intlMessage: messages.confirmationQuestion
|
|
1343
|
-
})]
|
|
1344
|
-
})
|
|
1345
|
-
})
|
|
1346
|
-
});
|
|
1347
|
-
};
|
|
1348
|
-
function getBold$1(msg) {
|
|
1349
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1350
|
-
as: "span",
|
|
1351
|
-
isBold: true,
|
|
1352
|
-
children: msg
|
|
1353
|
-
}, crypto.randomUUID());
|
|
1354
|
-
}
|
|
1355
|
-
|
|
1356
|
-
function ownKeys$2(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; }
|
|
1357
|
-
function _objectSpread$2(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$2(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$2(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1358
|
-
function UploadPreviewModal() {
|
|
1359
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
1360
|
-
state = _useUnpublishProducts.state,
|
|
1361
|
-
onClose = _useUnpublishProducts.onClose,
|
|
1362
|
-
actions = _useUnpublishProducts.actions;
|
|
1363
|
-
const intl = reactIntl.useIntl();
|
|
1364
|
-
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
1365
|
-
size: 16,
|
|
1366
|
-
isOpen: true,
|
|
1367
|
-
title: intl.formatMessage(sharedMessages.unpublishModalTitle),
|
|
1368
|
-
labelPrimary: intl.formatMessage(messages.continue),
|
|
1369
|
-
onSecondaryButtonClick: () => onClose({
|
|
1370
|
-
shouldDeleteImportContainer: true
|
|
1371
|
-
}),
|
|
1372
|
-
onPrimaryButtonClick: () => {
|
|
1373
|
-
actions.setCurrentStep('unpublish-confirmation');
|
|
1374
|
-
},
|
|
1375
|
-
onClose: () => onClose({
|
|
1376
|
-
shouldDeleteImportContainer: true
|
|
1377
|
-
}),
|
|
1378
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1379
|
-
scale: "m",
|
|
1380
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1381
|
-
intlMessage: messages.heresAPreview
|
|
1382
|
-
}), jsxRuntime.jsx(uiKit.Card, {
|
|
1383
|
-
insetScale: "xl",
|
|
1384
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1385
|
-
scale: "m",
|
|
1386
|
-
alignItems: "center",
|
|
1387
|
-
children: [jsxRuntime.jsx(uiKit.CloseBoldIcon, {
|
|
1388
|
-
size: "40",
|
|
1389
|
-
color: "neutral60"
|
|
1390
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1391
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages.productsToBeUnpublished), {}, {
|
|
1392
|
-
values: {
|
|
1393
|
-
count: intl.formatNumber(state.uploadFileResponse?.rowsCount),
|
|
1394
|
-
b: getBold
|
|
1395
|
-
}
|
|
1396
|
-
})
|
|
1397
|
-
})]
|
|
1398
|
-
})
|
|
1399
|
-
})]
|
|
1400
|
-
})
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
function getBold(msg) {
|
|
1404
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1405
|
-
as: "span",
|
|
1406
|
-
isBold: true,
|
|
1407
|
-
children: msg
|
|
1408
|
-
}, crypto.randomUUID());
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
const steps = {
|
|
1412
|
-
upload: jsxRuntime.jsx(Upload, {}),
|
|
1413
|
-
uploading: jsxRuntime.jsx(Uploading, {}),
|
|
1414
|
-
'upload-preview': jsxRuntime.jsx(UploadPreviewModal, {}),
|
|
1415
|
-
'upload-error': jsxRuntime.jsx(UploadErrorsModal, {}),
|
|
1416
|
-
'unpublish-confirmation': jsxRuntime.jsx(UnpublishProductsConfirmationModal, {})
|
|
1417
|
-
};
|
|
1418
|
-
const CurrentStep = () => {
|
|
1419
|
-
const _useUnpublishProducts = useUnpublishProductsContext(),
|
|
1420
|
-
state = _useUnpublishProducts.state;
|
|
1421
|
-
return steps[state.currentStep] || null;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
function ownKeys$1(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; }
|
|
1425
|
-
function _objectSpread$1(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$1(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$1(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1426
|
-
const FileIcon = props => jsxRuntime.jsxs("svg", _objectSpread$1(_objectSpread$1({
|
|
1427
|
-
width: "32",
|
|
1428
|
-
height: "32",
|
|
1429
|
-
viewBox: "0 0 32 32",
|
|
1430
|
-
fill: "none",
|
|
1431
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1432
|
-
}, props), {}, {
|
|
1433
|
-
children: [jsxRuntime.jsx("mask", {
|
|
1434
|
-
id: "mask0_17_6643",
|
|
1435
|
-
style: {
|
|
1436
|
-
maskType: 'alpha'
|
|
1437
|
-
},
|
|
1438
|
-
maskUnits: "userSpaceOnUse",
|
|
1439
|
-
x: "0",
|
|
1440
|
-
y: "0",
|
|
1441
|
-
width: "32",
|
|
1442
|
-
height: "32",
|
|
1443
|
-
children: jsxRuntime.jsx("rect", {
|
|
1444
|
-
width: "32",
|
|
1445
|
-
height: "32",
|
|
1446
|
-
fill: "#D9D9D9"
|
|
1447
|
-
})
|
|
1448
|
-
}), jsxRuntime.jsx("g", {
|
|
1449
|
-
mask: "url(#mask0_17_6643)",
|
|
1450
|
-
children: jsxRuntime.jsx("path", {
|
|
1451
|
-
d: "M14.6667 25.3333H17.3333V19.7667L19.4667 21.9L21.3333 20L16 14.6667L10.6667 20L12.5667 21.8667L14.6667 19.7667V25.3333ZM8 29.3333C7.26667 29.3333 6.63889 29.0722 6.11667 28.55C5.59444 28.0278 5.33333 27.4 5.33333 26.6667V5.33332C5.33333 4.59999 5.59444 3.97221 6.11667 3.44999C6.63889 2.92777 7.26667 2.66666 8 2.66666H18.6667L26.6667 10.6667V26.6667C26.6667 27.4 26.4056 28.0278 25.8833 28.55C25.3611 29.0722 24.7333 29.3333 24 29.3333H8ZM17.3333 12H24L17.3333 5.33332V12Z",
|
|
1452
|
-
fill: "#B1ACFF"
|
|
1453
|
-
})
|
|
1454
|
-
})]
|
|
1455
|
-
}));
|
|
1456
|
-
|
|
1457
|
-
const getChunkImport = locale => {
|
|
1458
|
-
const intlLocale = i18n.mapLocaleToIntlLocale(locale);
|
|
1459
|
-
switch (intlLocale) {
|
|
1460
|
-
case 'de':
|
|
1461
|
-
return Promise.resolve().then(function () { return require('./de-d3d76e3c.cjs.dev.js'); });
|
|
1462
|
-
case 'es':
|
|
1463
|
-
return Promise.resolve().then(function () { return require('./es-4955e68e.cjs.dev.js'); });
|
|
1464
|
-
case 'fr-FR':
|
|
1465
|
-
return Promise.resolve().then(function () { return require('./fr-FR-01187000.cjs.dev.js'); });
|
|
1466
|
-
case 'ja':
|
|
1467
|
-
return Promise.resolve().then(function () { return require('./ja-9bd5f452.cjs.dev.js'); });
|
|
1468
|
-
case 'pt-BR':
|
|
1469
|
-
return Promise.resolve().then(function () { return require('./pt-BR-872a8cea.cjs.dev.js'); });
|
|
1470
|
-
default:
|
|
1471
|
-
return Promise.resolve().then(function () { return require('./en-b170969b.cjs.dev.js'); });
|
|
1472
|
-
}
|
|
1473
|
-
};
|
|
1474
|
-
const loadMessages = async locale => {
|
|
1475
|
-
try {
|
|
1476
|
-
const chunkImport = await getChunkImport(locale);
|
|
1477
|
-
return i18n.parseChunkImport(chunkImport);
|
|
1478
|
-
} catch (error) {
|
|
1479
|
-
// eslint-disable-next-line no-console
|
|
1480
|
-
console.warn(`Something went wrong while loading the unpublish-products-modal messages for ${locale}`, error);
|
|
1481
|
-
sentry.reportErrorToSentry(new Error(`Something went wrong while loading the unpublish-products-modal messages for ${locale}`), {
|
|
1482
|
-
extra: error
|
|
1483
|
-
});
|
|
1484
|
-
return {};
|
|
1485
|
-
}
|
|
1486
|
-
};
|
|
1487
|
-
|
|
1488
|
-
const useAsyncIntlMessages = (locale, loader) => {
|
|
1489
|
-
const _useState = React.useState({
|
|
1490
|
-
isLoading: true,
|
|
1491
|
-
messages: undefined,
|
|
1492
|
-
error: undefined
|
|
1493
|
-
}),
|
|
1494
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
1495
|
-
state = _useState2[0],
|
|
1496
|
-
setState = _useState2[1];
|
|
1497
|
-
React.useEffect(() => {
|
|
1498
|
-
let _isUnmounting = false;
|
|
1499
|
-
async function load() {
|
|
1500
|
-
try {
|
|
1501
|
-
if (!_isUnmounting) {
|
|
1502
|
-
const messages = await loader(locale);
|
|
1503
|
-
setState({
|
|
1504
|
-
isLoading: false,
|
|
1505
|
-
messages
|
|
1506
|
-
});
|
|
1507
|
-
}
|
|
1508
|
-
} catch (error) {
|
|
1509
|
-
setState({
|
|
1510
|
-
isLoading: false,
|
|
1511
|
-
error
|
|
1512
|
-
});
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1515
|
-
if (locale) load();
|
|
1516
|
-
return () => {
|
|
1517
|
-
_isUnmounting = true;
|
|
1518
|
-
};
|
|
1519
|
-
}, [locale, loader]);
|
|
1520
|
-
return state;
|
|
1521
|
-
};
|
|
1522
|
-
|
|
1523
|
-
function ownKeys(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; }
|
|
1524
|
-
function _objectSpread(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(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(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1525
|
-
const UnpublishProductsModal = props => {
|
|
1526
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
1527
|
-
locale: context.user && context.user.locale
|
|
1528
|
-
})),
|
|
1529
|
-
locale = _useApplicationContex.locale;
|
|
1530
|
-
const messages = useAsyncIntlMessages(locale, loadMessages);
|
|
1531
|
-
if (!props.isOpen || messages.isLoading) return null;
|
|
1532
|
-
return jsxRuntime.jsx(reactIntl.IntlProvider, {
|
|
1533
|
-
locale: locale,
|
|
1534
|
-
messages: messages.messages,
|
|
1535
|
-
children: jsxRuntime.jsx(UnpublishProductsProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1536
|
-
children: jsxRuntime.jsx(CurrentStep, {})
|
|
1537
|
-
}))
|
|
1538
|
-
});
|
|
1539
|
-
};
|
|
1540
|
-
UnpublishProductsModal.displayName = 'UnpublishProductsModal';
|
|
1541
|
-
|
|
1542
|
-
exports.EnabledDropArea = EnabledDropArea;
|
|
1543
|
-
exports.FileDropped = FileDropped;
|
|
1544
|
-
exports.FileIcon = FileIcon;
|
|
1545
|
-
exports.UnpublishProductsModal = UnpublishProductsModal;
|
|
1546
|
-
exports.messages = messages$4;
|
|
1547
|
-
exports.useUnpublishProductsContext = useUnpublishProductsContext;
|