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