@commercetools-frontend-extensions/import-resources-modal 1.11.6 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.dev.js +401 -279
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +399 -277
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +402 -280
- package/dist/declarations/src/@components/current-step.d.ts +1 -0
- package/dist/declarations/src/@components/import-resources-modal-provider/import-resources-modal-provider.d.ts +38 -0
- package/dist/declarations/src/@components/import-resources-modal-provider/index.d.ts +2 -0
- package/dist/declarations/src/@components/import-resources-modal-provider/reducer.d.ts +86 -0
- package/dist/declarations/src/@components/index.d.ts +6 -0
- package/dist/declarations/src/@components/instructions/index.d.ts +1 -0
- package/dist/declarations/src/@components/instructions/instructions.d.ts +1 -0
- package/dist/declarations/src/@components/resource-type-selection/index.d.ts +1 -0
- package/dist/declarations/src/@components/resource-type-selection/resource-type-selection.d.ts +1 -0
- package/dist/declarations/src/@components/upload/index.d.ts +1 -0
- package/dist/declarations/src/@components/upload/upload.d.ts +1 -0
- package/dist/declarations/src/@components/upload-result/index.d.ts +1 -0
- package/dist/declarations/src/@components/upload-result/upload-results.d.ts +1 -0
- package/dist/declarations/src/@hooks/use-import-resources-context.d.ts +2 -1
- package/package.json +15 -15
|
@@ -31,6 +31,7 @@ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibl
|
|
|
31
31
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
32
32
|
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
33
33
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
34
|
+
var applicationShell = require('@commercetools-frontend/application-shell');
|
|
34
35
|
var sentry = require('@commercetools-frontend/sentry');
|
|
35
36
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
36
37
|
var _sliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/slice');
|
|
@@ -63,66 +64,90 @@ let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
|
|
|
63
64
|
return CurrentStep;
|
|
64
65
|
}({});
|
|
65
66
|
|
|
66
|
-
function ownKeys$
|
|
67
|
-
function _objectSpread$
|
|
67
|
+
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; }
|
|
68
|
+
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; }
|
|
68
69
|
|
|
69
70
|
// TODO: make this resource type specific
|
|
70
71
|
|
|
71
72
|
function reducer(state, action) {
|
|
72
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
73
|
+
if (action.type === 'setCurrentStep') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
73
74
|
currentStep: action.currentStep,
|
|
74
75
|
progress: 0
|
|
75
76
|
});
|
|
76
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
77
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
77
78
|
uploadFileResponse: action.uploadFileResponse
|
|
78
79
|
});
|
|
79
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
80
|
+
if (action.type === 'setResourceType') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
80
81
|
resourceType: action.resourceType
|
|
81
82
|
});
|
|
82
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
83
|
+
if (action.type === 'setContainerKey') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
83
84
|
containerKey: action.containerKey
|
|
84
85
|
});
|
|
85
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
86
|
+
if (action.type === 'cancelImport') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
86
87
|
currentStep: CurrentStep$1.Upload,
|
|
87
88
|
containerKey: undefined,
|
|
89
|
+
jobId: undefined,
|
|
88
90
|
fileUploadErrors: [],
|
|
89
91
|
uploadFileResponse: undefined,
|
|
90
92
|
droppedFile: undefined,
|
|
91
93
|
dropAreaState: 'disabled',
|
|
92
|
-
progress: 0
|
|
94
|
+
progress: 0,
|
|
95
|
+
totalResourceCount: undefined,
|
|
96
|
+
validationProcessed: undefined,
|
|
97
|
+
isValidating: false
|
|
93
98
|
});
|
|
94
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
99
|
+
if (action.type === 'uploadNewFile') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
95
100
|
currentStep: CurrentStep$1.Upload,
|
|
96
101
|
containerKey: undefined,
|
|
102
|
+
jobId: undefined,
|
|
97
103
|
fileUploadErrors: [],
|
|
98
104
|
uploadFileResponse: undefined,
|
|
99
105
|
droppedFile: undefined,
|
|
100
106
|
dropAreaState: 'ready-for-drop',
|
|
101
|
-
progress: 0
|
|
107
|
+
progress: 0,
|
|
108
|
+
totalResourceCount: undefined,
|
|
109
|
+
validationProcessed: undefined,
|
|
110
|
+
isValidating: false
|
|
102
111
|
});
|
|
103
112
|
if (action.type === 'setDroppedFile') {
|
|
104
|
-
return _objectSpread$
|
|
113
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
105
114
|
droppedFile: action.droppedFile
|
|
106
115
|
});
|
|
107
116
|
}
|
|
108
117
|
if (action.type === 'setFileUploadErrors') {
|
|
109
|
-
return _objectSpread$
|
|
118
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
110
119
|
fileUploadErrors: action.fileUploadErrors
|
|
111
120
|
});
|
|
112
121
|
}
|
|
113
122
|
if (action.type === 'setAbortController') {
|
|
114
|
-
return _objectSpread$
|
|
123
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
115
124
|
abortController: action.abortController
|
|
116
125
|
});
|
|
117
126
|
}
|
|
118
127
|
if (action.type === 'setProgress') {
|
|
119
|
-
return _objectSpread$
|
|
128
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
120
129
|
progress: action.progress
|
|
121
130
|
});
|
|
122
131
|
}
|
|
123
132
|
if (action.type === 'setUploadSettings') {
|
|
124
|
-
return _objectSpread$
|
|
125
|
-
settings: _objectSpread$
|
|
133
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
134
|
+
settings: _objectSpread$a(_objectSpread$a({}, state.settings), action.settings)
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
if (action.type === 'setJobId') {
|
|
138
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
139
|
+
jobId: action.jobId
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
if (action.type === 'setTotalResourceCount') {
|
|
143
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
144
|
+
totalResourceCount: action.totalResourceCount
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
if (action.type === 'setValidationProgress') {
|
|
148
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
149
|
+
validationProcessed: action.validationProcessed,
|
|
150
|
+
isValidating: action.isValidating
|
|
126
151
|
});
|
|
127
152
|
}
|
|
128
153
|
throw new Error(getUnknownActionError(action));
|
|
@@ -138,21 +163,75 @@ const initialState = {
|
|
|
138
163
|
fileUploadErrors: [],
|
|
139
164
|
resourceType: 'category',
|
|
140
165
|
containerKey: undefined,
|
|
166
|
+
jobId: undefined,
|
|
141
167
|
progress: 0,
|
|
142
168
|
settings: {
|
|
143
169
|
decimalSeparator: '.'
|
|
170
|
+
},
|
|
171
|
+
totalResourceCount: undefined,
|
|
172
|
+
validationProcessed: undefined,
|
|
173
|
+
isValidating: false
|
|
174
|
+
};
|
|
175
|
+
const initialActions = {
|
|
176
|
+
setCurrentStep(_currentStep) {
|
|
177
|
+
/**/
|
|
178
|
+
},
|
|
179
|
+
cancelImport() {
|
|
180
|
+
/**/
|
|
181
|
+
},
|
|
182
|
+
uploadNewFile() {
|
|
183
|
+
/**/
|
|
184
|
+
},
|
|
185
|
+
setUploadFileResponse(_uploadFileResponse) {
|
|
186
|
+
/**/
|
|
187
|
+
},
|
|
188
|
+
setResourceType(_nextResourceType) {
|
|
189
|
+
/**/
|
|
190
|
+
},
|
|
191
|
+
setDroppedFile(_nextDroppedFile) {
|
|
192
|
+
/**/
|
|
193
|
+
},
|
|
194
|
+
setFileUploadErrors(_fileUploadErrors) {
|
|
195
|
+
/**/
|
|
196
|
+
},
|
|
197
|
+
setContainerKey(_containerKey) {
|
|
198
|
+
/**/
|
|
199
|
+
},
|
|
200
|
+
setAbortController(_abortController) {
|
|
201
|
+
/**/
|
|
202
|
+
},
|
|
203
|
+
setUploadSettings(_settings) {
|
|
204
|
+
/**/
|
|
205
|
+
},
|
|
206
|
+
setProgress(_progress) {
|
|
207
|
+
/**/
|
|
208
|
+
},
|
|
209
|
+
setJobId(_jobId) {
|
|
210
|
+
/**/
|
|
211
|
+
},
|
|
212
|
+
setTotalResourceCount(_totalResourceCount) {
|
|
213
|
+
/**/
|
|
214
|
+
},
|
|
215
|
+
setValidationProgress(_params) {
|
|
216
|
+
/**/
|
|
144
217
|
}
|
|
145
218
|
};
|
|
146
219
|
|
|
147
|
-
function ownKeys$
|
|
148
|
-
function _objectSpread$
|
|
149
|
-
const ImportResourcesContext = /*#__PURE__*/React__default["default"].createContext(
|
|
220
|
+
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; }
|
|
221
|
+
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; }
|
|
222
|
+
const ImportResourcesContext = /*#__PURE__*/React__default["default"].createContext({
|
|
223
|
+
state: initialState,
|
|
224
|
+
resourceTypes: [],
|
|
225
|
+
onClose: () => {},
|
|
226
|
+
onStartImportSuccess: () => {},
|
|
227
|
+
actions: initialActions
|
|
228
|
+
});
|
|
150
229
|
const ImportResourcesProvider = props => {
|
|
151
230
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
152
231
|
projectKey: context.project?.key
|
|
153
232
|
})),
|
|
154
233
|
projectKey = _useApplicationContex.projectKey;
|
|
155
|
-
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$
|
|
234
|
+
const _React$useReducer = React__default["default"].useReducer(reducer, _objectSpread$9(_objectSpread$9({}, initialState), {}, {
|
|
156
235
|
resourceType: props.resourceTypes[0]
|
|
157
236
|
})),
|
|
158
237
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -202,9 +281,26 @@ const ImportResourcesProvider = props => {
|
|
|
202
281
|
settings: nextSettings
|
|
203
282
|
});
|
|
204
283
|
};
|
|
284
|
+
const setJobId = jobId => dispatch({
|
|
285
|
+
type: 'setJobId',
|
|
286
|
+
jobId
|
|
287
|
+
});
|
|
288
|
+
const setTotalResourceCount = totalResourceCount => dispatch({
|
|
289
|
+
type: 'setTotalResourceCount',
|
|
290
|
+
totalResourceCount
|
|
291
|
+
});
|
|
292
|
+
const setValidationProgress = _ref => {
|
|
293
|
+
let processed = _ref.processed,
|
|
294
|
+
isValidating = _ref.isValidating;
|
|
295
|
+
return dispatch({
|
|
296
|
+
type: 'setValidationProgress',
|
|
297
|
+
validationProcessed: processed,
|
|
298
|
+
isValidating
|
|
299
|
+
});
|
|
300
|
+
};
|
|
205
301
|
const handleClose = function () {
|
|
206
|
-
let
|
|
207
|
-
shouldDeleteImportContainer =
|
|
302
|
+
let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
303
|
+
shouldDeleteImportContainer = _ref2.shouldDeleteImportContainer;
|
|
208
304
|
if (state.abortController) state.abortController.abort();
|
|
209
305
|
if (typeof props.onClose === 'function') props.onClose();
|
|
210
306
|
// Removes the associated import container when the import is closed
|
|
@@ -230,10 +326,13 @@ const ImportResourcesProvider = props => {
|
|
|
230
326
|
setResourceType,
|
|
231
327
|
setDroppedFile,
|
|
232
328
|
setContainerKey,
|
|
329
|
+
setJobId,
|
|
233
330
|
setAbortController,
|
|
234
331
|
setFileUploadErrors,
|
|
235
332
|
setProgress,
|
|
236
|
-
setUploadSettings
|
|
333
|
+
setUploadSettings,
|
|
334
|
+
setTotalResourceCount,
|
|
335
|
+
setValidationProgress
|
|
237
336
|
}
|
|
238
337
|
},
|
|
239
338
|
children: props.children
|
|
@@ -290,7 +389,7 @@ function getDropAreaState(flags) {
|
|
|
290
389
|
return 'ready-for-drop';
|
|
291
390
|
}
|
|
292
391
|
|
|
293
|
-
var messages$
|
|
392
|
+
var messages$6 = reactIntl.defineMessages({
|
|
294
393
|
dragAndDropCSV: {
|
|
295
394
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
296
395
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -423,7 +522,7 @@ function useImportResourcesContext() {
|
|
|
423
522
|
return context;
|
|
424
523
|
}
|
|
425
524
|
|
|
426
|
-
var messages$
|
|
525
|
+
var messages$5 = reactIntl.defineMessages({
|
|
427
526
|
fileSizeExceededTitle: {
|
|
428
527
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
429
528
|
defaultMessage: 'File size exceeded'
|
|
@@ -828,8 +927,46 @@ function resourceTypeToPluralMessage(resourceType) {
|
|
|
828
927
|
return message;
|
|
829
928
|
}
|
|
830
929
|
|
|
831
|
-
|
|
832
|
-
|
|
930
|
+
const INITIAL_COLUMN_DISPLAY_COUNT = 8;
|
|
931
|
+
|
|
932
|
+
const PERMISSIONS = {
|
|
933
|
+
// Categories
|
|
934
|
+
ManageCategories: 'ManageCategories',
|
|
935
|
+
ViewCategories: 'ViewCategories',
|
|
936
|
+
// Products
|
|
937
|
+
ManageProducts: 'ManageProducts',
|
|
938
|
+
ViewProducts: 'ViewProducts',
|
|
939
|
+
// ProductTypes
|
|
940
|
+
ManageProductTypes: 'ManageProductTypes',
|
|
941
|
+
ViewProductTypes: 'ViewProductTypes',
|
|
942
|
+
// DiscountCodes
|
|
943
|
+
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
944
|
+
ViewDiscountCodes: 'ViewDiscountCodes',
|
|
945
|
+
// Customers
|
|
946
|
+
ManageCustomers: 'ManageCustomers',
|
|
947
|
+
ViewCustomers: 'ViewCustomers',
|
|
948
|
+
// Orders
|
|
949
|
+
ManageOrders: 'ManageOrders',
|
|
950
|
+
ViewOrders: 'ViewOrders',
|
|
951
|
+
// KeyValueDocuments
|
|
952
|
+
ManageKeyValueDocuments: 'ManageKeyValueDocuments',
|
|
953
|
+
ViewKeyValueDocuments: 'ViewKeyValueDocuments',
|
|
954
|
+
// BusinessUnits
|
|
955
|
+
ManageBusinessUnits: 'ManageBusinessUnits',
|
|
956
|
+
ViewBusinessUnits: 'ViewBusinessUnits'
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
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; }
|
|
960
|
+
function _objectSpread$8(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$8(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$8(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
961
|
+
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
962
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
963
|
+
[FILE_IMPORT_JOB_FLOW]: false
|
|
964
|
+
};
|
|
965
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
966
|
+
_objectSpread$8(_objectSpread$8({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
967
|
+
|
|
968
|
+
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; }
|
|
969
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
833
970
|
const useUpload = () => {
|
|
834
971
|
const intl = reactIntl.useIntl();
|
|
835
972
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
@@ -840,39 +977,38 @@ const useUpload = () => {
|
|
|
840
977
|
state = _useImportResourcesCo.state,
|
|
841
978
|
actions = _useImportResourcesCo.actions;
|
|
842
979
|
const showNotification = actionsGlobal.useShowNotification();
|
|
843
|
-
const
|
|
844
|
-
|
|
980
|
+
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
981
|
+
const _useFileUpload = operations.useFileUpload({
|
|
982
|
+
projectKey: projectKey,
|
|
983
|
+
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
845
984
|
}),
|
|
846
|
-
upload =
|
|
847
|
-
React__default["default"].useEffect(() => {
|
|
848
|
-
return () => {
|
|
849
|
-
if (state.abortController) state.abortController.abort();
|
|
850
|
-
};
|
|
851
|
-
}, [state.abortController]);
|
|
985
|
+
upload = _useFileUpload.upload;
|
|
852
986
|
const isFileValid = async file => {
|
|
853
987
|
const errors = [];
|
|
988
|
+
const maxFileSizeMB = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
989
|
+
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
854
990
|
const isDelimiterValid = await operations.validateDelimiter(file, operations.COLUMN_DELIMITERS);
|
|
855
991
|
if (!isDelimiterValid) errors.push({
|
|
856
|
-
title: intl.formatMessage(messages$
|
|
857
|
-
description: intl.formatMessage(messages$
|
|
992
|
+
title: intl.formatMessage(messages$5.wrongSeparatorTitle),
|
|
993
|
+
description: intl.formatMessage(messages$5.wrongSeparatorDescription, {
|
|
858
994
|
delimiterList: formatAllowedDelimitersForMessageDisplay(intl)
|
|
859
995
|
})
|
|
860
996
|
});
|
|
861
997
|
const rowCount = await operations.getRowCount(file);
|
|
862
998
|
if (rowCount < 1) errors.push({
|
|
863
|
-
title: intl.formatMessage(messages$
|
|
864
|
-
description: intl.formatMessage(messages$
|
|
999
|
+
title: intl.formatMessage(messages$5.dropAreaNotEnoughRowsTitle),
|
|
1000
|
+
description: intl.formatMessage(messages$5.dropAreaNotEnoughRowsDescription)
|
|
865
1001
|
});
|
|
866
|
-
if (state.resourceType && file.size > operations.toBytes(
|
|
867
|
-
title: intl.formatMessage(messages$
|
|
868
|
-
description: intl.formatMessage(messages$
|
|
869
|
-
fileSizeLimit: intl.formatNumber(
|
|
1002
|
+
if (state.resourceType && file.size > operations.toBytes(maxFileSizeMB)) errors.push({
|
|
1003
|
+
title: intl.formatMessage(messages$5.fileSizeExceededTitle),
|
|
1004
|
+
description: intl.formatMessage(messages$5.fileSizeExceededDescription, {
|
|
1005
|
+
fileSizeLimit: intl.formatNumber(maxFileSizeMB)
|
|
870
1006
|
})
|
|
871
1007
|
});
|
|
872
|
-
if (state.resourceType && rowCount >
|
|
873
|
-
title: intl.formatMessage(messages$
|
|
874
|
-
description: intl.formatMessage(messages$
|
|
875
|
-
rowLimit: intl.formatNumber(
|
|
1008
|
+
if (state.resourceType && rowCount > maxItemCount) errors.push({
|
|
1009
|
+
title: intl.formatMessage(messages$5.rowLimitExceededTitle),
|
|
1010
|
+
description: intl.formatMessage(messages$5.rowLimitExceededDescription, {
|
|
1011
|
+
rowLimit: intl.formatNumber(maxItemCount)
|
|
876
1012
|
})
|
|
877
1013
|
});
|
|
878
1014
|
if (errors.length > 0) {
|
|
@@ -880,6 +1016,10 @@ const useUpload = () => {
|
|
|
880
1016
|
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
881
1017
|
return false;
|
|
882
1018
|
}
|
|
1019
|
+
if (isFileImportJobFlowEnabled) {
|
|
1020
|
+
const resourceCount = await operations.countUniqueResourcesInCsv(file);
|
|
1021
|
+
actions.setTotalResourceCount(resourceCount);
|
|
1022
|
+
}
|
|
883
1023
|
return true;
|
|
884
1024
|
};
|
|
885
1025
|
const handleUploadError = error => {
|
|
@@ -888,18 +1028,22 @@ const useUpload = () => {
|
|
|
888
1028
|
return;
|
|
889
1029
|
}
|
|
890
1030
|
if (error instanceof operations.HttpError) {
|
|
1031
|
+
actions.setValidationProgress({
|
|
1032
|
+
processed: 0,
|
|
1033
|
+
isValidating: false
|
|
1034
|
+
});
|
|
891
1035
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
892
1036
|
actions.setFileUploadErrors([{
|
|
893
|
-
title: intl.formatMessage(messages$
|
|
894
|
-
description: intl.formatMessage(messages$
|
|
1037
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
1038
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
895
1039
|
}]);
|
|
896
1040
|
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
897
1041
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
898
1042
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
899
1043
|
const fieldNames = operations.formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
900
1044
|
actions.setFileUploadErrors([{
|
|
901
|
-
title: intl.formatMessage(messages$
|
|
902
|
-
description: intl.formatMessage(messages$
|
|
1045
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
1046
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
903
1047
|
fieldNames
|
|
904
1048
|
})
|
|
905
1049
|
}]);
|
|
@@ -912,7 +1056,7 @@ const useUpload = () => {
|
|
|
912
1056
|
showNotification({
|
|
913
1057
|
kind: 'error',
|
|
914
1058
|
domain: constants.DOMAINS.PAGE,
|
|
915
|
-
text: intl.formatMessage(messages$
|
|
1059
|
+
text: intl.formatMessage(messages$5.unexpectedError)
|
|
916
1060
|
});
|
|
917
1061
|
}
|
|
918
1062
|
} else {
|
|
@@ -935,77 +1079,65 @@ const useUpload = () => {
|
|
|
935
1079
|
if (!state.droppedFile || !state.resourceType) return;
|
|
936
1080
|
const canUpload = await isFileValid(state.droppedFile);
|
|
937
1081
|
if (!canUpload) return;
|
|
1082
|
+
const abortController = new AbortController();
|
|
1083
|
+
actions.setAbortController(abortController);
|
|
938
1084
|
actions.setCurrentStep(CurrentStep$1.Uploading);
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1085
|
+
const shouldApplyPublishSettings = state.resourceType === 'product';
|
|
1086
|
+
const uploadSettings = _objectSpread$7({
|
|
1087
|
+
format: 'CSV',
|
|
1088
|
+
decimalSeparator: state.settings?.decimalSeparator
|
|
1089
|
+
}, shouldApplyPublishSettings ? {
|
|
1090
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1091
|
+
options: {
|
|
1092
|
+
publishAllChanges: state.settings?.publish ?? false
|
|
1093
|
+
}
|
|
1094
|
+
} : {});
|
|
1095
|
+
await upload({
|
|
1096
|
+
file: state.droppedFile,
|
|
1097
|
+
resourceType: state.resourceType,
|
|
1098
|
+
settings: uploadSettings,
|
|
1099
|
+
abortSignal: abortController.signal,
|
|
1100
|
+
onSuccess: result => {
|
|
1101
|
+
actions.setValidationProgress({
|
|
1102
|
+
processed: 0,
|
|
1103
|
+
isValidating: false
|
|
1104
|
+
});
|
|
1105
|
+
actions.setContainerKey(result.containerKey);
|
|
1106
|
+
if (result.jobId) {
|
|
1107
|
+
actions.setJobId(result.jobId);
|
|
1108
|
+
}
|
|
1109
|
+
const fileUploadResponse = {
|
|
1110
|
+
results: result.summary.results,
|
|
1111
|
+
invalid: result.summary.invalid,
|
|
1112
|
+
valid: result.summary.valid,
|
|
1113
|
+
fileName: state.droppedFile?.name || '',
|
|
1114
|
+
itemsCount: result.summary.total,
|
|
1115
|
+
rowsCount: result.summary.total,
|
|
1116
|
+
columnsCount: result.summary.fieldsCount,
|
|
1117
|
+
fields: result.summary.fields,
|
|
1118
|
+
ignoredFields: result.summary.ignoredFields
|
|
1119
|
+
};
|
|
1120
|
+
actions.setUploadFileResponse(fileUploadResponse);
|
|
1121
|
+
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
1122
|
+
},
|
|
1123
|
+
onProgress: progress => {
|
|
1124
|
+
actions.setProgress(progress);
|
|
1125
|
+
},
|
|
1126
|
+
onValidationProgress: job => {
|
|
1127
|
+
const processed = job.summary?.total ?? 0;
|
|
1128
|
+
actions.setValidationProgress({
|
|
1129
|
+
processed,
|
|
1130
|
+
isValidating: true
|
|
1131
|
+
});
|
|
1132
|
+
},
|
|
1133
|
+
onError: handleUploadError
|
|
1134
|
+
});
|
|
968
1135
|
};
|
|
969
1136
|
return {
|
|
970
1137
|
handleUploadAndValidation
|
|
971
1138
|
};
|
|
972
1139
|
};
|
|
973
1140
|
|
|
974
|
-
const INITIAL_COLUMN_DISPLAY_COUNT = 8;
|
|
975
|
-
|
|
976
|
-
const PERMISSIONS = {
|
|
977
|
-
// Categories
|
|
978
|
-
ManageCategories: 'ManageCategories',
|
|
979
|
-
ViewCategories: 'ViewCategories',
|
|
980
|
-
// Products
|
|
981
|
-
ManageProducts: 'ManageProducts',
|
|
982
|
-
ViewProducts: 'ViewProducts',
|
|
983
|
-
// ProductTypes
|
|
984
|
-
ManageProductTypes: 'ManageProductTypes',
|
|
985
|
-
ViewProductTypes: 'ViewProductTypes',
|
|
986
|
-
// DiscountCodes
|
|
987
|
-
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
988
|
-
ViewDiscountCodes: 'ViewDiscountCodes',
|
|
989
|
-
// Customers
|
|
990
|
-
ManageCustomers: 'ManageCustomers',
|
|
991
|
-
ViewCustomers: 'ViewCustomers',
|
|
992
|
-
// Orders
|
|
993
|
-
ManageOrders: 'ManageOrders',
|
|
994
|
-
ViewOrders: 'ViewOrders',
|
|
995
|
-
// KeyValueDocuments
|
|
996
|
-
ManageKeyValueDocuments: 'ManageKeyValueDocuments',
|
|
997
|
-
ViewKeyValueDocuments: 'ViewKeyValueDocuments',
|
|
998
|
-
// BusinessUnits
|
|
999
|
-
ManageBusinessUnits: 'ManageBusinessUnits',
|
|
1000
|
-
ViewBusinessUnits: 'ViewBusinessUnits'
|
|
1001
|
-
};
|
|
1002
|
-
|
|
1003
|
-
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; }
|
|
1004
|
-
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; }
|
|
1005
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
1006
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
1007
|
-
_objectSpread$9(_objectSpread$9({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
1008
|
-
|
|
1009
1141
|
const useImportPermission = () => {
|
|
1010
1142
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
1011
1143
|
actionRights: applicationContext.actionRights?.products
|
|
@@ -1070,9 +1202,9 @@ const FileDropArea = () => {
|
|
|
1070
1202
|
}, [state.resourceType, actions]);
|
|
1071
1203
|
const handleDropRejected = React__default["default"].useCallback(errorType => {
|
|
1072
1204
|
const errorMessageMap = {
|
|
1073
|
-
'too-many-files': messages$
|
|
1074
|
-
'invalid-type': messages$
|
|
1075
|
-
generic: messages$
|
|
1205
|
+
'too-many-files': messages$6.tooManyFilesError,
|
|
1206
|
+
'invalid-type': messages$6.fileFormatNotSupported,
|
|
1207
|
+
generic: messages$6.genericError
|
|
1076
1208
|
};
|
|
1077
1209
|
showNotification({
|
|
1078
1210
|
kind: 'error',
|
|
@@ -1099,10 +1231,10 @@ const FileDropArea = () => {
|
|
|
1099
1231
|
isFileDropped: Boolean(state.droppedFile),
|
|
1100
1232
|
fileName: state.droppedFile?.name,
|
|
1101
1233
|
messages: {
|
|
1102
|
-
chooseFile: intl.formatMessage(messages$
|
|
1103
|
-
dragAndDropCSV: intl.formatMessage(messages$
|
|
1104
|
-
or: intl.formatMessage(messages$
|
|
1105
|
-
browseButton: intl.formatMessage(messages$
|
|
1234
|
+
chooseFile: intl.formatMessage(messages$6.chooseFile),
|
|
1235
|
+
dragAndDropCSV: intl.formatMessage(messages$6.dragAndDropCSV),
|
|
1236
|
+
or: intl.formatMessage(messages$6.or),
|
|
1237
|
+
browseButton: intl.formatMessage(messages$6.browseButton)
|
|
1106
1238
|
}
|
|
1107
1239
|
})
|
|
1108
1240
|
});
|
|
@@ -1150,14 +1282,14 @@ const Upload = () => {
|
|
|
1150
1282
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1151
1283
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1152
1284
|
isBold: true,
|
|
1153
|
-
intlMessage: messages$
|
|
1285
|
+
intlMessage: messages$6.dataType
|
|
1154
1286
|
})
|
|
1155
1287
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1156
1288
|
children: jsxRuntime.jsx(ResourceTypeSelection, {})
|
|
1157
1289
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1158
1290
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1159
1291
|
isBold: true,
|
|
1160
|
-
intlMessage: messages$
|
|
1292
|
+
intlMessage: messages$6.instructions
|
|
1161
1293
|
})
|
|
1162
1294
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1163
1295
|
children: jsxRuntime.jsx(Instructions, {})
|
|
@@ -1165,8 +1297,8 @@ const Upload = () => {
|
|
|
1165
1297
|
}) : jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
1166
1298
|
children: jsxRuntime.jsx(Instructions, {})
|
|
1167
1299
|
}), jsxRuntime.jsx(operations.InfoBox, {
|
|
1168
|
-
title: intl.formatMessage(messages$
|
|
1169
|
-
description: intl.formatMessage(messages$
|
|
1300
|
+
title: intl.formatMessage(messages$6.prerequisitesOfImportingData),
|
|
1301
|
+
description: intl.formatMessage(messages$6.keysForEveryResource, {
|
|
1170
1302
|
link: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
1171
1303
|
tone: "secondary",
|
|
1172
1304
|
isExternal: true,
|
|
@@ -1181,11 +1313,11 @@ const Upload = () => {
|
|
|
1181
1313
|
decimalSeparator
|
|
1182
1314
|
});
|
|
1183
1315
|
},
|
|
1184
|
-
separatorTitle: intl.formatMessage(messages$
|
|
1185
|
-
decimalsSeparatorDescription: intl.formatMessage(messages$
|
|
1186
|
-
decimalSeparatorPointLabel: intl.formatMessage(messages$
|
|
1187
|
-
decimalSeparatorCommaLabel: intl.formatMessage(messages$
|
|
1188
|
-
decimalsLabel: intl.formatMessage(messages$
|
|
1316
|
+
separatorTitle: intl.formatMessage(messages$6.separatorTitle),
|
|
1317
|
+
decimalsSeparatorDescription: intl.formatMessage(messages$6.decimalsSeparatorDescription),
|
|
1318
|
+
decimalSeparatorPointLabel: intl.formatMessage(messages$6.decimalSeparatorPoint),
|
|
1319
|
+
decimalSeparatorCommaLabel: intl.formatMessage(messages$6.decimalSeparatorComma),
|
|
1320
|
+
decimalsLabel: intl.formatMessage(messages$6.decimals)
|
|
1189
1321
|
}), jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1190
1322
|
children: jsxRuntime.jsx(FileDropArea, {})
|
|
1191
1323
|
}), jsxRuntime.jsx(operations.UploadSettings, {
|
|
@@ -1196,7 +1328,7 @@ const Upload = () => {
|
|
|
1196
1328
|
publish: checked
|
|
1197
1329
|
});
|
|
1198
1330
|
},
|
|
1199
|
-
publishProductsLabel: intl.formatMessage(messages$
|
|
1331
|
+
publishProductsLabel: intl.formatMessage(messages$6.publishProducts),
|
|
1200
1332
|
dataTrackingTarget: "product_import-publish_checkbox",
|
|
1201
1333
|
canPublishProducts: canPublishProducts
|
|
1202
1334
|
})]
|
|
@@ -1205,7 +1337,7 @@ const Upload = () => {
|
|
|
1205
1337
|
});
|
|
1206
1338
|
};
|
|
1207
1339
|
|
|
1208
|
-
var messages$
|
|
1340
|
+
var messages$4 = reactIntl.defineMessages({
|
|
1209
1341
|
row: {
|
|
1210
1342
|
id: 'ImportResourcesModal.row',
|
|
1211
1343
|
description: 'In Upload file error modal - "Row" column',
|
|
@@ -1238,149 +1370,103 @@ var messages$3 = reactIntl.defineMessages({
|
|
|
1238
1370
|
}
|
|
1239
1371
|
});
|
|
1240
1372
|
|
|
1241
|
-
function ownKeys$
|
|
1242
|
-
function _objectSpread$
|
|
1243
|
-
const
|
|
1373
|
+
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; }
|
|
1374
|
+
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; }
|
|
1375
|
+
const fileLevelColumns = [{
|
|
1244
1376
|
key: 'errorType',
|
|
1245
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
1377
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1246
1378
|
width: 'max-content'
|
|
1247
1379
|
}, {
|
|
1248
1380
|
key: 'details',
|
|
1249
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
1381
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1250
1382
|
}];
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1383
|
+
const rowLevelColumns = [{
|
|
1384
|
+
key: 'row',
|
|
1385
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$4.row)),
|
|
1386
|
+
width: 'max-content'
|
|
1387
|
+
}, {
|
|
1388
|
+
key: 'errorType',
|
|
1389
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1390
|
+
width: 'max-content'
|
|
1391
|
+
}, {
|
|
1392
|
+
key: 'details',
|
|
1393
|
+
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1394
|
+
}];
|
|
1395
|
+
const FileLevelErrorTable = _ref => {
|
|
1396
|
+
let rows = _ref.rows;
|
|
1253
1397
|
const pagination = uiKit.usePaginationState({
|
|
1254
1398
|
perPage: 10
|
|
1255
1399
|
});
|
|
1256
1400
|
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1257
1401
|
const endIndex = startIndex + pagination.perPage.value;
|
|
1258
|
-
const currentPageRows = _sliceInstanceProperty__default["default"](
|
|
1259
|
-
const shouldShowPagination =
|
|
1402
|
+
const currentPageRows = _sliceInstanceProperty__default["default"](rows).call(rows, startIndex, endIndex);
|
|
1403
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1260
1404
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1261
1405
|
scale: "l",
|
|
1262
1406
|
children: [jsxRuntime.jsx(uiKit.DataTable, {
|
|
1263
1407
|
verticalCellAlignment: "center",
|
|
1264
1408
|
isCondensed: true,
|
|
1265
1409
|
rows: currentPageRows,
|
|
1266
|
-
columns:
|
|
1267
|
-
itemRenderer:
|
|
1410
|
+
columns: fileLevelColumns,
|
|
1411
|
+
itemRenderer: fileLevelItemRenderer
|
|
1268
1412
|
}), shouldShowPagination && jsxRuntime.jsx(uiKit.PageNavigator, {
|
|
1269
1413
|
onPageChange: pagination.page.onChange,
|
|
1270
1414
|
page: pagination.page.value,
|
|
1271
|
-
totalPages: Math.ceil(
|
|
1415
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1272
1416
|
})]
|
|
1273
1417
|
});
|
|
1274
1418
|
};
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
case 'errorType':
|
|
1278
|
-
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1279
|
-
isCondensed: true,
|
|
1280
|
-
label: item.title,
|
|
1281
|
-
tone: "critical"
|
|
1282
|
-
});
|
|
1283
|
-
case 'details':
|
|
1284
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1285
|
-
children: item.description
|
|
1286
|
-
});
|
|
1287
|
-
default:
|
|
1288
|
-
throw new operations.UnexpectedColumnError(column.key);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
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; }
|
|
1293
|
-
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1294
|
-
const UploadErrorsModal = () => {
|
|
1295
|
-
const intl = reactIntl.useIntl();
|
|
1296
|
-
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1297
|
-
state = _useImportResourcesCo.state,
|
|
1298
|
-
actions = _useImportResourcesCo.actions,
|
|
1299
|
-
onClose = _useImportResourcesCo.onClose;
|
|
1300
|
-
const errorsCount = state.fileUploadErrors.length;
|
|
1301
|
-
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1302
|
-
size: 16,
|
|
1303
|
-
isOpen: true,
|
|
1304
|
-
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1305
|
-
onClose: () => onClose(),
|
|
1306
|
-
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
1307
|
-
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1308
|
-
scale: "l",
|
|
1309
|
-
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1310
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1311
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$3.uploadErrorDescription), {}, {
|
|
1312
|
-
values: {
|
|
1313
|
-
fileName: state.droppedFile?.name,
|
|
1314
|
-
errorsCount: intl.formatNumber(errorsCount),
|
|
1315
|
-
b: getBold$3
|
|
1316
|
-
}
|
|
1317
|
-
})
|
|
1318
|
-
})
|
|
1319
|
-
}), jsxRuntime.jsx(UploadErrorTable, {
|
|
1320
|
-
rows: operations.mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1321
|
-
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1322
|
-
scale: "m",
|
|
1323
|
-
justifyContent: "flex-end",
|
|
1324
|
-
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
1325
|
-
label: intl.formatMessage(sharedMessages.close),
|
|
1326
|
-
onClick: () => onClose()
|
|
1327
|
-
}), jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
1328
|
-
iconLeft: jsxRuntime.jsx(uiKit.ImportIcon, {}),
|
|
1329
|
-
label: intl.formatMessage(messages$3.uploadNewFile),
|
|
1330
|
-
onClick: () => actions.uploadNewFile()
|
|
1331
|
-
})]
|
|
1332
|
-
})]
|
|
1333
|
-
})
|
|
1334
|
-
})
|
|
1335
|
-
});
|
|
1336
|
-
};
|
|
1337
|
-
function getBold$3(msg) {
|
|
1338
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1339
|
-
as: "span",
|
|
1340
|
-
isBold: true,
|
|
1341
|
-
children: msg
|
|
1342
|
-
}, crypto.randomUUID());
|
|
1343
|
-
}
|
|
1344
|
-
|
|
1345
|
-
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; }
|
|
1346
|
-
function _objectSpread$6(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$6(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$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1347
|
-
const getColumns = () => [{
|
|
1348
|
-
key: 'row',
|
|
1349
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.row)),
|
|
1350
|
-
width: 'max-content'
|
|
1351
|
-
}, {
|
|
1352
|
-
key: 'errorType',
|
|
1353
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.errorType)),
|
|
1354
|
-
width: 'max-content'
|
|
1355
|
-
}, {
|
|
1356
|
-
key: 'details',
|
|
1357
|
-
label: jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$6({}, messages$3.details))
|
|
1358
|
-
}];
|
|
1359
|
-
const UploadRowErrorTable = props => {
|
|
1360
|
-
var _context;
|
|
1419
|
+
const RowLevelErrorTable = _ref2 => {
|
|
1420
|
+
let rows = _ref2.rows;
|
|
1361
1421
|
const pagination = uiKit.usePaginationState({
|
|
1362
1422
|
perPage: 10
|
|
1363
1423
|
});
|
|
1364
1424
|
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1365
1425
|
const endIndex = startIndex + pagination.perPage.value;
|
|
1366
|
-
const currentPageRows = _sliceInstanceProperty__default["default"](
|
|
1367
|
-
const shouldShowPagination =
|
|
1426
|
+
const currentPageRows = _sliceInstanceProperty__default["default"](rows).call(rows, startIndex, endIndex);
|
|
1427
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1368
1428
|
return jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1369
1429
|
scale: "l",
|
|
1370
1430
|
children: [jsxRuntime.jsx(uiKit.DataTable, {
|
|
1371
1431
|
verticalCellAlignment: "center",
|
|
1372
1432
|
isCondensed: true,
|
|
1373
1433
|
rows: currentPageRows,
|
|
1374
|
-
columns:
|
|
1375
|
-
itemRenderer:
|
|
1434
|
+
columns: rowLevelColumns,
|
|
1435
|
+
itemRenderer: rowLevelItemRenderer
|
|
1376
1436
|
}), shouldShowPagination && jsxRuntime.jsx(uiKit.PageNavigator, {
|
|
1377
1437
|
onPageChange: pagination.page.onChange,
|
|
1378
1438
|
page: pagination.page.value,
|
|
1379
|
-
totalPages: Math.ceil(
|
|
1439
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1380
1440
|
})]
|
|
1381
1441
|
});
|
|
1382
1442
|
};
|
|
1383
|
-
|
|
1443
|
+
const UploadErrorTable = props => {
|
|
1444
|
+
if (props.variant === 'row-level') {
|
|
1445
|
+
return jsxRuntime.jsx(RowLevelErrorTable, {
|
|
1446
|
+
rows: props.rows
|
|
1447
|
+
});
|
|
1448
|
+
}
|
|
1449
|
+
return jsxRuntime.jsx(FileLevelErrorTable, {
|
|
1450
|
+
rows: props.rows
|
|
1451
|
+
});
|
|
1452
|
+
};
|
|
1453
|
+
function fileLevelItemRenderer(item, column) {
|
|
1454
|
+
switch (column.key) {
|
|
1455
|
+
case 'errorType':
|
|
1456
|
+
return jsxRuntime.jsx(uiKit.Stamp, {
|
|
1457
|
+
isCondensed: true,
|
|
1458
|
+
label: item.title,
|
|
1459
|
+
tone: "critical"
|
|
1460
|
+
});
|
|
1461
|
+
case 'details':
|
|
1462
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1463
|
+
children: item.description
|
|
1464
|
+
});
|
|
1465
|
+
default:
|
|
1466
|
+
throw new operations.UnexpectedColumnError(column.key);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
function rowLevelItemRenderer(item, column) {
|
|
1384
1470
|
switch (column.key) {
|
|
1385
1471
|
case 'row':
|
|
1386
1472
|
return item.row;
|
|
@@ -1407,19 +1493,21 @@ function itemRenderer(item, column) {
|
|
|
1407
1493
|
|
|
1408
1494
|
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; }
|
|
1409
1495
|
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1410
|
-
const
|
|
1496
|
+
const UploadErrorsModal = () => {
|
|
1411
1497
|
const intl = reactIntl.useIntl();
|
|
1412
1498
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1413
1499
|
state = _useImportResourcesCo.state,
|
|
1414
1500
|
actions = _useImportResourcesCo.actions,
|
|
1415
1501
|
onClose = _useImportResourcesCo.onClose;
|
|
1416
|
-
const
|
|
1502
|
+
const isRowLevelErrors = (state.uploadFileResponse?.invalid ?? 0) > 0 && (state.uploadFileResponse?.results?.length ?? 0) > 0;
|
|
1503
|
+
const isFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
1504
|
+
const errorsCount = isRowLevelErrors ? operations.getFileUploadErrorsCount(state.uploadFileResponse?.results) : state.fileUploadErrors.length;
|
|
1417
1505
|
const documentationLink = operations.RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
1418
1506
|
return jsxRuntime.jsx(applicationComponents.InfoDialog, {
|
|
1419
1507
|
size: 16,
|
|
1420
1508
|
isOpen: true,
|
|
1421
1509
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1422
|
-
onClose: onClose,
|
|
1510
|
+
onClose: () => onClose(),
|
|
1423
1511
|
children: jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
1424
1512
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1425
1513
|
scale: "l",
|
|
@@ -1427,7 +1515,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1427
1515
|
scale: "xs",
|
|
1428
1516
|
children: [jsxRuntime.jsx(fullstory.Masking.Mask, {
|
|
1429
1517
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1430
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1518
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.uploadErrorDescription), {}, {
|
|
1431
1519
|
values: {
|
|
1432
1520
|
fileName: state.droppedFile?.name,
|
|
1433
1521
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1435,8 +1523,8 @@ const UploadRowErrorsModal = () => {
|
|
|
1435
1523
|
}
|
|
1436
1524
|
})
|
|
1437
1525
|
})
|
|
1438
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1439
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1526
|
+
}), isRowLevelErrors && jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1527
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.supportedValuesDocumentation), {}, {
|
|
1440
1528
|
values: {
|
|
1441
1529
|
documentationLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
1442
1530
|
tone: "secondary",
|
|
@@ -1447,8 +1535,12 @@ const UploadRowErrorsModal = () => {
|
|
|
1447
1535
|
}
|
|
1448
1536
|
})
|
|
1449
1537
|
})]
|
|
1450
|
-
}), jsxRuntime.jsx(
|
|
1538
|
+
}), isRowLevelErrors && jsxRuntime.jsx(UploadErrorTable, {
|
|
1539
|
+
variant: "row-level",
|
|
1451
1540
|
rows: operations.mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1541
|
+
}), isFileLevelErrors && jsxRuntime.jsx(UploadErrorTable, {
|
|
1542
|
+
variant: "file-level",
|
|
1543
|
+
rows: operations.mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1452
1544
|
}), jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
1453
1545
|
scale: "m",
|
|
1454
1546
|
justifyContent: "flex-end",
|
|
@@ -1457,7 +1549,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1457
1549
|
onClick: () => onClose()
|
|
1458
1550
|
}), jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
1459
1551
|
iconLeft: jsxRuntime.jsx(uiKit.ImportIcon, {}),
|
|
1460
|
-
label: intl.formatMessage(messages$
|
|
1552
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1461
1553
|
onClick: () => actions.uploadNewFile()
|
|
1462
1554
|
})]
|
|
1463
1555
|
})]
|
|
@@ -1473,7 +1565,7 @@ function getBold$2(msg) {
|
|
|
1473
1565
|
}, crypto.randomUUID());
|
|
1474
1566
|
}
|
|
1475
1567
|
|
|
1476
|
-
var messages$
|
|
1568
|
+
var messages$3 = reactIntl.defineMessages({
|
|
1477
1569
|
startImportButton: {
|
|
1478
1570
|
id: 'ImportResourcesModal.startImportButton',
|
|
1479
1571
|
description: 'Label for the modal Start import button',
|
|
@@ -1590,7 +1682,7 @@ const ColumnList = props => {
|
|
|
1590
1682
|
e.preventDefault();
|
|
1591
1683
|
setIsExpanded(!isExpanded);
|
|
1592
1684
|
},
|
|
1593
|
-
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages$
|
|
1685
|
+
children: isExpanded ? jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages$3.showLess)) : jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages$3.showMore))
|
|
1594
1686
|
})
|
|
1595
1687
|
})]
|
|
1596
1688
|
});
|
|
@@ -1610,13 +1702,13 @@ function UploadPreviewModal() {
|
|
|
1610
1702
|
const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
|
|
1611
1703
|
const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
|
|
1612
1704
|
const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
|
|
1613
|
-
const
|
|
1614
|
-
const
|
|
1705
|
+
const ignoredFields = state.uploadFileResponse.ignoredFields;
|
|
1706
|
+
const validatedFields = operations.getValidatedColumns(state.uploadFileResponse.fields, ignoredFields);
|
|
1615
1707
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
1616
1708
|
size: 16,
|
|
1617
1709
|
isOpen: true,
|
|
1618
1710
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1619
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1711
|
+
labelPrimary: intl.formatMessage(messages$3.continue),
|
|
1620
1712
|
onSecondaryButtonClick: () => onClose({
|
|
1621
1713
|
shouldDeleteImportContainer: true
|
|
1622
1714
|
}),
|
|
@@ -1635,7 +1727,7 @@ function UploadPreviewModal() {
|
|
|
1635
1727
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1636
1728
|
scale: "m",
|
|
1637
1729
|
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1638
|
-
intlMessage: messages$
|
|
1730
|
+
intlMessage: messages$3.previewOfYourImport
|
|
1639
1731
|
}), jsxRuntime.jsx(uiKit.Card, {
|
|
1640
1732
|
insetScale: "xl",
|
|
1641
1733
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -1647,7 +1739,7 @@ function UploadPreviewModal() {
|
|
|
1647
1739
|
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1648
1740
|
color: "success"
|
|
1649
1741
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1650
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1742
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.itemsToBeImported), {}, {
|
|
1651
1743
|
values: {
|
|
1652
1744
|
resourceType,
|
|
1653
1745
|
resourceTypePlural,
|
|
@@ -1662,19 +1754,19 @@ function UploadPreviewModal() {
|
|
|
1662
1754
|
children: [jsxRuntime.jsx(uiKit.CheckBoldIcon, {
|
|
1663
1755
|
color: "success"
|
|
1664
1756
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1665
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1757
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeImported), {}, {
|
|
1666
1758
|
values: {
|
|
1667
|
-
columnCount: intl.formatNumber(
|
|
1759
|
+
columnCount: intl.formatNumber(validatedFields.length),
|
|
1668
1760
|
b: getBold$1
|
|
1669
1761
|
}
|
|
1670
1762
|
})
|
|
1671
1763
|
})]
|
|
1672
1764
|
})]
|
|
1673
1765
|
}), jsxRuntime.jsx(ColumnList, {
|
|
1674
|
-
columns:
|
|
1766
|
+
columns: validatedFields
|
|
1675
1767
|
})]
|
|
1676
1768
|
})
|
|
1677
|
-
}),
|
|
1769
|
+
}), ignoredFields.length > 0 && jsxRuntime.jsx(uiKit.Card, {
|
|
1678
1770
|
insetScale: "xl",
|
|
1679
1771
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1680
1772
|
scale: "s",
|
|
@@ -1683,15 +1775,15 @@ function UploadPreviewModal() {
|
|
|
1683
1775
|
children: [jsxRuntime.jsx(uiKit.EyeCrossedIcon, {
|
|
1684
1776
|
color: "neutral60"
|
|
1685
1777
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1686
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1778
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeIgnored), {}, {
|
|
1687
1779
|
values: {
|
|
1688
|
-
columnCount: intl.formatNumber(
|
|
1780
|
+
columnCount: intl.formatNumber(ignoredFields.length),
|
|
1689
1781
|
b: getBold$1
|
|
1690
1782
|
}
|
|
1691
1783
|
})
|
|
1692
1784
|
})]
|
|
1693
1785
|
}), jsxRuntime.jsx(ColumnList, {
|
|
1694
|
-
columns:
|
|
1786
|
+
columns: ignoredFields
|
|
1695
1787
|
})]
|
|
1696
1788
|
})
|
|
1697
1789
|
})]
|
|
@@ -1723,13 +1815,13 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
1723
1815
|
styles: "width:360px"
|
|
1724
1816
|
} : {
|
|
1725
1817
|
name: "g36yzl-ImportRunningTextNotification",
|
|
1726
|
-
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1818
|
+
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCWSIsImZpbGUiOiJpbXBvcnQtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnXG5pbXBvcnQgeyBET01BSU5TIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJ1xuaW1wb3J0IHsgTWFza2luZyBhcyBGdWxsU3RvcnlNYXNraW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvZnVsbHN0b3J5J1xuaW1wb3J0IHsgTGluaywgU3BhY2luZ3MsIFRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC91aS1raXQnXG5pbXBvcnQge1xuICBpc0Vycm9yLFxuICBwcm9jZXNzVXBsb2FkZWRGaWxlLFxuICBwcm9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ICAgIHN0YXRlLmRyb3BwZWRGaWxlPy5uYW1lICYmXG4gICAgICAgICAgICBzdGF0ZS5yZXNvdXJjZVR5cGVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1727
1819
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1728
1820
|
};
|
|
1729
1821
|
const ImportRunningTextNotification = props => jsxRuntime.jsx("div", {
|
|
1730
1822
|
css: _ref2,
|
|
1731
1823
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1732
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1824
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationSuccessMessage), {}, {
|
|
1733
1825
|
values: {
|
|
1734
1826
|
newline: getNewLine,
|
|
1735
1827
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1743,13 +1835,13 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
1743
1835
|
styles: "width:360px"
|
|
1744
1836
|
} : {
|
|
1745
1837
|
name: "mjwslu-ImportPreparingTextNotification",
|
|
1746
|
-
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1838
|
+
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZDWSIsImZpbGUiOiJpbXBvcnQtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uL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gICAnZGF0YS10ZXN0LWlkJzogJ2NvbmZpcm1hdGlvbi1kaWFsb2ctY2FuY2VsJyxcbiAgICAgICAgJ2RhdGEtdHJhY2tpbmctdGFyZ2V0JzogYCR7c3RhdGUucmVzb3VyY2VUeXBlfV9pbXBvcnQtc3RhcnRfaW1wb3J0X2J1dHRvbmAsXG4gICAgICB9fVxuICAgICAgb25Db25maXJtPXthc3luYyAoKSA9PiB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgY2FuQ29uZmlybSA9XG4gICAgICAgICAgICBwcm9qZWN0S2V5ICYmXG4gICAgICAgICAgICBzdGF0ZS5jb250YWluZXJLZXkgJiZcbiAgICAgICAgICAgIHN0YXRlLmRyb3BwZWRGaWxlPy5uYW1lICYmXG4gICAgICAgICAgICBzdGF0ZS5yZXNvdXJjZVR5cGVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1747
1839
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1748
1840
|
};
|
|
1749
1841
|
const ImportPreparingTextNotification = props => jsxRuntime.jsx("div", {
|
|
1750
1842
|
css: _ref,
|
|
1751
1843
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1752
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1844
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationPrepareMessage), {}, {
|
|
1753
1845
|
values: {
|
|
1754
1846
|
newline: getNewLine,
|
|
1755
1847
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1773,7 +1865,7 @@ const ImportConfirmationModal = () => {
|
|
|
1773
1865
|
const showNotification = actionsGlobal.useShowNotification();
|
|
1774
1866
|
return jsxRuntime.jsx(applicationComponents.ConfirmationDialog, {
|
|
1775
1867
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1776
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1868
|
+
labelPrimary: intl.formatMessage(messages$3.startImportButton),
|
|
1777
1869
|
isOpen: true,
|
|
1778
1870
|
onClose: () => onClose({
|
|
1779
1871
|
shouldDeleteImportContainer: true
|
|
@@ -1803,11 +1895,21 @@ const ImportConfirmationModal = () => {
|
|
|
1803
1895
|
}, {
|
|
1804
1896
|
dismissAfter: 5000
|
|
1805
1897
|
});
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1898
|
+
const isJobBasedFlow = !!state.jobId;
|
|
1899
|
+
if (isJobBasedFlow) {
|
|
1900
|
+
await operations.processFileImportJob({
|
|
1901
|
+
projectKey,
|
|
1902
|
+
resourceType: state.resourceType,
|
|
1903
|
+
importContainerKey: state.containerKey,
|
|
1904
|
+
jobId: state.jobId
|
|
1905
|
+
});
|
|
1906
|
+
} else {
|
|
1907
|
+
await operations.processUploadedFile({
|
|
1908
|
+
projectKey,
|
|
1909
|
+
importContainerKey: state.containerKey,
|
|
1910
|
+
resourceType: state.resourceType
|
|
1911
|
+
});
|
|
1912
|
+
}
|
|
1811
1913
|
onStartImportSuccess();
|
|
1812
1914
|
showNotification({
|
|
1813
1915
|
kind: 'info',
|
|
@@ -1836,7 +1938,7 @@ const ImportConfirmationModal = () => {
|
|
|
1836
1938
|
scale: "xl",
|
|
1837
1939
|
children: [jsxRuntime.jsxs("div", {
|
|
1838
1940
|
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1839
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1941
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.confirmationBodyText), {}, {
|
|
1840
1942
|
values: {
|
|
1841
1943
|
projectName: projectName,
|
|
1842
1944
|
count: intl.formatNumber(state?.uploadFileResponse?.rowsCount || 0),
|
|
@@ -1844,10 +1946,10 @@ const ImportConfirmationModal = () => {
|
|
|
1844
1946
|
}
|
|
1845
1947
|
})
|
|
1846
1948
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1847
|
-
intlMessage: messages$
|
|
1949
|
+
intlMessage: messages$3.confirmationBodyNote
|
|
1848
1950
|
})]
|
|
1849
1951
|
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1850
|
-
intlMessage: messages$
|
|
1952
|
+
intlMessage: messages$3.confirmationBodyQuestion
|
|
1851
1953
|
})]
|
|
1852
1954
|
})
|
|
1853
1955
|
})
|
|
@@ -1864,11 +1966,21 @@ function getBold(msg) {
|
|
|
1864
1966
|
const UploadResult = () => {
|
|
1865
1967
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1866
1968
|
state = _useImportResourcesCo.state;
|
|
1867
|
-
|
|
1868
|
-
|
|
1969
|
+
const hasFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
1970
|
+
const hasRowLevelErrors = (state.uploadFileResponse?.invalid ?? 0) > 0 && (state.uploadFileResponse?.results?.length ?? 0) > 0;
|
|
1971
|
+
if (hasFileLevelErrors || hasRowLevelErrors) {
|
|
1972
|
+
return jsxRuntime.jsx(UploadErrorsModal, {});
|
|
1973
|
+
}
|
|
1869
1974
|
return jsxRuntime.jsx(UploadPreviewModal, {});
|
|
1870
1975
|
};
|
|
1871
1976
|
|
|
1977
|
+
var messages$2 = reactIntl.defineMessages({
|
|
1978
|
+
validatingResources: {
|
|
1979
|
+
id: 'ImportResourcesModal.Uploading.validatingResources',
|
|
1980
|
+
defaultMessage: 'Validating {processed} / {total} {resourceType}'
|
|
1981
|
+
}
|
|
1982
|
+
});
|
|
1983
|
+
|
|
1872
1984
|
const Uploading = () => {
|
|
1873
1985
|
const intl = reactIntl.useIntl();
|
|
1874
1986
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1876,6 +1988,12 @@ const Uploading = () => {
|
|
|
1876
1988
|
actions = _useImportResourcesCo.actions,
|
|
1877
1989
|
onClose = _useImportResourcesCo.onClose;
|
|
1878
1990
|
if (!state.droppedFile?.name) return null;
|
|
1991
|
+
const showValidationProgress = state.isValidating && state.validationProcessed && state.validationProcessed > 0 && state.totalResourceCount && state.resourceType;
|
|
1992
|
+
const statusMessage = showValidationProgress ? intl.formatMessage(messages$2.validatingResources, {
|
|
1993
|
+
processed: intl.formatNumber(state.validationProcessed),
|
|
1994
|
+
total: intl.formatNumber(state.totalResourceCount),
|
|
1995
|
+
resourceType: intl.formatMessage(resourceTypeToPluralMessage(state.resourceType))
|
|
1996
|
+
}) : undefined;
|
|
1879
1997
|
return jsxRuntime.jsx(operations.UploadingModal, {
|
|
1880
1998
|
isOpen: true,
|
|
1881
1999
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
@@ -1889,7 +2007,8 @@ const Uploading = () => {
|
|
|
1889
2007
|
},
|
|
1890
2008
|
onClose: () => onClose({
|
|
1891
2009
|
shouldDeleteImportContainer: true
|
|
1892
|
-
})
|
|
2010
|
+
}),
|
|
2011
|
+
statusMessage: statusMessage
|
|
1893
2012
|
});
|
|
1894
2013
|
};
|
|
1895
2014
|
|
|
@@ -1932,7 +2051,7 @@ const resourceTypeToDisplayName = resourceType => {
|
|
|
1932
2051
|
case IMPORTABLE_RESOURCES.CATEGORY:
|
|
1933
2052
|
return messages$1.categories;
|
|
1934
2053
|
default:
|
|
1935
|
-
throw new
|
|
2054
|
+
throw new operations.UnexpectedResourceTypeError(resourceType);
|
|
1936
2055
|
}
|
|
1937
2056
|
};
|
|
1938
2057
|
const ResourceTypeSelection = () => {
|
|
@@ -1972,13 +2091,16 @@ const Instructions = () => {
|
|
|
1972
2091
|
const intl = reactIntl.useIntl();
|
|
1973
2092
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1974
2093
|
state = _useImportResourcesCo.state;
|
|
2094
|
+
const isFileImportJobFlowEnabled = applicationShell.useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
1975
2095
|
const templateLink = operations.RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS[state.resourceType];
|
|
1976
2096
|
const documentationLink = operations.RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
2097
|
+
const maxFileSize = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_FILE_SIZE_MB : operations.IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
2098
|
+
const maxItemCount = isFileImportJobFlowEnabled ? operations.IMPORT_MAX_ITEM_COUNT : operations.IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
1977
2099
|
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1978
2100
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.fileUploadInstructions), {}, {
|
|
1979
2101
|
values: {
|
|
1980
|
-
fileSize: intl.formatNumber(
|
|
1981
|
-
rowLimit: intl.formatNumber(
|
|
2102
|
+
fileSize: intl.formatNumber(maxFileSize),
|
|
2103
|
+
rowLimit: intl.formatNumber(maxItemCount),
|
|
1982
2104
|
csvTemplateLink: msg => jsxRuntime.jsx(uiKit.Link, {
|
|
1983
2105
|
tone: "secondary",
|
|
1984
2106
|
isExternal: true,
|