@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
|
@@ -10,7 +10,7 @@ import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
|
|
|
10
10
|
import _everyInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/every';
|
|
11
11
|
import { defineMessages, useIntl, FormattedMessage, IntlProvider } from 'react-intl';
|
|
12
12
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
13
|
-
import { deleteImportContainer, FileDroppedArea, DisabledDropArea, EnabledDropArea, ActiveDragDropArea, COLUMN_DELIMITERS,
|
|
13
|
+
import { deleteImportContainer, FileDroppedArea, DisabledDropArea, EnabledDropArea, ActiveDragDropArea, COLUMN_DELIMITERS, useFileUpload, validateDelimiter, getRowCount, toBytes, countUniqueResourcesInCsv, isAbortError, HttpError, formatKeys, isError, IMPORT_MAX_FILE_SIZE_MB, IMPORT_LEGACY_MAX_FILE_SIZE_MB, IMPORT_MAX_ITEM_COUNT, IMPORT_LEGACY_MAX_ROW_COUNT, assertResourceType, FileDropArea as FileDropArea$1, InfoBox, CT_API_DOCS_URL, UploadSeparator, UploadSettings, UnexpectedColumnError, extractErrorDescriptionFromValidationMessage, formatErrorCode, getFileUploadErrorsCount, RESOURCE_TYPE_DOCUMENTATION_LINKS, mapUploadFileErrorsResponseToUploadFileErrorRows, mapFileUploadErrorsToUploadFileErrorRows, getValidatedColumns, processFileImportJob, processUploadedFile, UploadingModal, UnexpectedResourceTypeError as UnexpectedResourceTypeError$1, RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS, isResourceType } from '@commercetools-frontend-extensions/operations';
|
|
14
14
|
import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
|
|
15
15
|
import React, { useContext, useMemo, useState, useEffect } from 'react';
|
|
16
16
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
@@ -27,6 +27,7 @@ import _possibleConstructorReturn from '@babel/runtime-corejs3/helpers/esm/possi
|
|
|
27
27
|
import _getPrototypeOf from '@babel/runtime-corejs3/helpers/esm/getPrototypeOf';
|
|
28
28
|
import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
|
|
29
29
|
import _wrapNativeSuper from '@babel/runtime-corejs3/helpers/esm/wrapNativeSuper';
|
|
30
|
+
import { useFeatureToggle } from '@commercetools-frontend/application-shell';
|
|
30
31
|
import { reportErrorToSentry } from '@commercetools-frontend/sentry';
|
|
31
32
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
32
33
|
import _sliceInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/slice';
|
|
@@ -42,66 +43,90 @@ let CurrentStep$1 = /*#__PURE__*/function (CurrentStep) {
|
|
|
42
43
|
return CurrentStep;
|
|
43
44
|
}({});
|
|
44
45
|
|
|
45
|
-
function ownKeys$
|
|
46
|
-
function _objectSpread$
|
|
46
|
+
function ownKeys$a(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
47
|
+
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(_context = ownKeys$a(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$a(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
47
48
|
|
|
48
49
|
// TODO: make this resource type specific
|
|
49
50
|
|
|
50
51
|
function reducer(state, action) {
|
|
51
|
-
if (action.type === 'setCurrentStep') return _objectSpread$
|
|
52
|
+
if (action.type === 'setCurrentStep') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
52
53
|
currentStep: action.currentStep,
|
|
53
54
|
progress: 0
|
|
54
55
|
});
|
|
55
|
-
if (action.type === 'setUploadFileResponse') return _objectSpread$
|
|
56
|
+
if (action.type === 'setUploadFileResponse') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
56
57
|
uploadFileResponse: action.uploadFileResponse
|
|
57
58
|
});
|
|
58
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
59
|
+
if (action.type === 'setResourceType') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
59
60
|
resourceType: action.resourceType
|
|
60
61
|
});
|
|
61
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
62
|
+
if (action.type === 'setContainerKey') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
62
63
|
containerKey: action.containerKey
|
|
63
64
|
});
|
|
64
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
65
|
+
if (action.type === 'cancelImport') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
65
66
|
currentStep: CurrentStep$1.Upload,
|
|
66
67
|
containerKey: undefined,
|
|
68
|
+
jobId: undefined,
|
|
67
69
|
fileUploadErrors: [],
|
|
68
70
|
uploadFileResponse: undefined,
|
|
69
71
|
droppedFile: undefined,
|
|
70
72
|
dropAreaState: 'disabled',
|
|
71
|
-
progress: 0
|
|
73
|
+
progress: 0,
|
|
74
|
+
totalResourceCount: undefined,
|
|
75
|
+
validationProcessed: undefined,
|
|
76
|
+
isValidating: false
|
|
72
77
|
});
|
|
73
|
-
if (action.type === 'uploadNewFile') return _objectSpread$
|
|
78
|
+
if (action.type === 'uploadNewFile') return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
74
79
|
currentStep: CurrentStep$1.Upload,
|
|
75
80
|
containerKey: undefined,
|
|
81
|
+
jobId: undefined,
|
|
76
82
|
fileUploadErrors: [],
|
|
77
83
|
uploadFileResponse: undefined,
|
|
78
84
|
droppedFile: undefined,
|
|
79
85
|
dropAreaState: 'ready-for-drop',
|
|
80
|
-
progress: 0
|
|
86
|
+
progress: 0,
|
|
87
|
+
totalResourceCount: undefined,
|
|
88
|
+
validationProcessed: undefined,
|
|
89
|
+
isValidating: false
|
|
81
90
|
});
|
|
82
91
|
if (action.type === 'setDroppedFile') {
|
|
83
|
-
return _objectSpread$
|
|
92
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
84
93
|
droppedFile: action.droppedFile
|
|
85
94
|
});
|
|
86
95
|
}
|
|
87
96
|
if (action.type === 'setFileUploadErrors') {
|
|
88
|
-
return _objectSpread$
|
|
97
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
89
98
|
fileUploadErrors: action.fileUploadErrors
|
|
90
99
|
});
|
|
91
100
|
}
|
|
92
101
|
if (action.type === 'setAbortController') {
|
|
93
|
-
return _objectSpread$
|
|
102
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
94
103
|
abortController: action.abortController
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
106
|
if (action.type === 'setProgress') {
|
|
98
|
-
return _objectSpread$
|
|
107
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
99
108
|
progress: action.progress
|
|
100
109
|
});
|
|
101
110
|
}
|
|
102
111
|
if (action.type === 'setUploadSettings') {
|
|
103
|
-
return _objectSpread$
|
|
104
|
-
settings: _objectSpread$
|
|
112
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
113
|
+
settings: _objectSpread$a(_objectSpread$a({}, state.settings), action.settings)
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (action.type === 'setJobId') {
|
|
117
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
118
|
+
jobId: action.jobId
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (action.type === 'setTotalResourceCount') {
|
|
122
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
123
|
+
totalResourceCount: action.totalResourceCount
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (action.type === 'setValidationProgress') {
|
|
127
|
+
return _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
128
|
+
validationProcessed: action.validationProcessed,
|
|
129
|
+
isValidating: action.isValidating
|
|
105
130
|
});
|
|
106
131
|
}
|
|
107
132
|
throw new Error(getUnknownActionError(action));
|
|
@@ -117,21 +142,75 @@ const initialState = {
|
|
|
117
142
|
fileUploadErrors: [],
|
|
118
143
|
resourceType: 'category',
|
|
119
144
|
containerKey: undefined,
|
|
145
|
+
jobId: undefined,
|
|
120
146
|
progress: 0,
|
|
121
147
|
settings: {
|
|
122
148
|
decimalSeparator: '.'
|
|
149
|
+
},
|
|
150
|
+
totalResourceCount: undefined,
|
|
151
|
+
validationProcessed: undefined,
|
|
152
|
+
isValidating: false
|
|
153
|
+
};
|
|
154
|
+
const initialActions = {
|
|
155
|
+
setCurrentStep(_currentStep) {
|
|
156
|
+
/**/
|
|
157
|
+
},
|
|
158
|
+
cancelImport() {
|
|
159
|
+
/**/
|
|
160
|
+
},
|
|
161
|
+
uploadNewFile() {
|
|
162
|
+
/**/
|
|
163
|
+
},
|
|
164
|
+
setUploadFileResponse(_uploadFileResponse) {
|
|
165
|
+
/**/
|
|
166
|
+
},
|
|
167
|
+
setResourceType(_nextResourceType) {
|
|
168
|
+
/**/
|
|
169
|
+
},
|
|
170
|
+
setDroppedFile(_nextDroppedFile) {
|
|
171
|
+
/**/
|
|
172
|
+
},
|
|
173
|
+
setFileUploadErrors(_fileUploadErrors) {
|
|
174
|
+
/**/
|
|
175
|
+
},
|
|
176
|
+
setContainerKey(_containerKey) {
|
|
177
|
+
/**/
|
|
178
|
+
},
|
|
179
|
+
setAbortController(_abortController) {
|
|
180
|
+
/**/
|
|
181
|
+
},
|
|
182
|
+
setUploadSettings(_settings) {
|
|
183
|
+
/**/
|
|
184
|
+
},
|
|
185
|
+
setProgress(_progress) {
|
|
186
|
+
/**/
|
|
187
|
+
},
|
|
188
|
+
setJobId(_jobId) {
|
|
189
|
+
/**/
|
|
190
|
+
},
|
|
191
|
+
setTotalResourceCount(_totalResourceCount) {
|
|
192
|
+
/**/
|
|
193
|
+
},
|
|
194
|
+
setValidationProgress(_params) {
|
|
195
|
+
/**/
|
|
123
196
|
}
|
|
124
197
|
};
|
|
125
198
|
|
|
126
|
-
function ownKeys$
|
|
127
|
-
function _objectSpread$
|
|
128
|
-
const ImportResourcesContext = /*#__PURE__*/React.createContext(
|
|
199
|
+
function ownKeys$9(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
200
|
+
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(_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
201
|
+
const ImportResourcesContext = /*#__PURE__*/React.createContext({
|
|
202
|
+
state: initialState,
|
|
203
|
+
resourceTypes: [],
|
|
204
|
+
onClose: () => {},
|
|
205
|
+
onStartImportSuccess: () => {},
|
|
206
|
+
actions: initialActions
|
|
207
|
+
});
|
|
129
208
|
const ImportResourcesProvider = props => {
|
|
130
209
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
131
210
|
projectKey: context.project?.key
|
|
132
211
|
})),
|
|
133
212
|
projectKey = _useApplicationContex.projectKey;
|
|
134
|
-
const _React$useReducer = React.useReducer(reducer, _objectSpread$
|
|
213
|
+
const _React$useReducer = React.useReducer(reducer, _objectSpread$9(_objectSpread$9({}, initialState), {}, {
|
|
135
214
|
resourceType: props.resourceTypes[0]
|
|
136
215
|
})),
|
|
137
216
|
_React$useReducer2 = _slicedToArray(_React$useReducer, 2),
|
|
@@ -181,9 +260,26 @@ const ImportResourcesProvider = props => {
|
|
|
181
260
|
settings: nextSettings
|
|
182
261
|
});
|
|
183
262
|
};
|
|
263
|
+
const setJobId = jobId => dispatch({
|
|
264
|
+
type: 'setJobId',
|
|
265
|
+
jobId
|
|
266
|
+
});
|
|
267
|
+
const setTotalResourceCount = totalResourceCount => dispatch({
|
|
268
|
+
type: 'setTotalResourceCount',
|
|
269
|
+
totalResourceCount
|
|
270
|
+
});
|
|
271
|
+
const setValidationProgress = _ref => {
|
|
272
|
+
let processed = _ref.processed,
|
|
273
|
+
isValidating = _ref.isValidating;
|
|
274
|
+
return dispatch({
|
|
275
|
+
type: 'setValidationProgress',
|
|
276
|
+
validationProcessed: processed,
|
|
277
|
+
isValidating
|
|
278
|
+
});
|
|
279
|
+
};
|
|
184
280
|
const handleClose = function () {
|
|
185
|
-
let
|
|
186
|
-
shouldDeleteImportContainer =
|
|
281
|
+
let _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
282
|
+
shouldDeleteImportContainer = _ref2.shouldDeleteImportContainer;
|
|
187
283
|
if (state.abortController) state.abortController.abort();
|
|
188
284
|
if (typeof props.onClose === 'function') props.onClose();
|
|
189
285
|
// Removes the associated import container when the import is closed
|
|
@@ -209,10 +305,13 @@ const ImportResourcesProvider = props => {
|
|
|
209
305
|
setResourceType,
|
|
210
306
|
setDroppedFile,
|
|
211
307
|
setContainerKey,
|
|
308
|
+
setJobId,
|
|
212
309
|
setAbortController,
|
|
213
310
|
setFileUploadErrors,
|
|
214
311
|
setProgress,
|
|
215
|
-
setUploadSettings
|
|
312
|
+
setUploadSettings,
|
|
313
|
+
setTotalResourceCount,
|
|
314
|
+
setValidationProgress
|
|
216
315
|
}
|
|
217
316
|
},
|
|
218
317
|
children: props.children
|
|
@@ -269,7 +368,7 @@ function getDropAreaState(flags) {
|
|
|
269
368
|
return 'ready-for-drop';
|
|
270
369
|
}
|
|
271
370
|
|
|
272
|
-
var messages$
|
|
371
|
+
var messages$6 = defineMessages({
|
|
273
372
|
dragAndDropCSV: {
|
|
274
373
|
id: 'ImportResourcesModal.dragAndDropCSV',
|
|
275
374
|
description: 'The message telling the user to drag and drop CSV file in the file drop area',
|
|
@@ -402,7 +501,7 @@ function useImportResourcesContext() {
|
|
|
402
501
|
return context;
|
|
403
502
|
}
|
|
404
503
|
|
|
405
|
-
var messages$
|
|
504
|
+
var messages$5 = defineMessages({
|
|
406
505
|
fileSizeExceededTitle: {
|
|
407
506
|
id: 'ImportResourcesModal.sizeExceededTitle',
|
|
408
507
|
defaultMessage: 'File size exceeded'
|
|
@@ -807,8 +906,46 @@ function resourceTypeToPluralMessage(resourceType) {
|
|
|
807
906
|
return message;
|
|
808
907
|
}
|
|
809
908
|
|
|
810
|
-
|
|
811
|
-
|
|
909
|
+
const INITIAL_COLUMN_DISPLAY_COUNT = 8;
|
|
910
|
+
|
|
911
|
+
const PERMISSIONS = {
|
|
912
|
+
// Categories
|
|
913
|
+
ManageCategories: 'ManageCategories',
|
|
914
|
+
ViewCategories: 'ViewCategories',
|
|
915
|
+
// Products
|
|
916
|
+
ManageProducts: 'ManageProducts',
|
|
917
|
+
ViewProducts: 'ViewProducts',
|
|
918
|
+
// ProductTypes
|
|
919
|
+
ManageProductTypes: 'ManageProductTypes',
|
|
920
|
+
ViewProductTypes: 'ViewProductTypes',
|
|
921
|
+
// DiscountCodes
|
|
922
|
+
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
923
|
+
ViewDiscountCodes: 'ViewDiscountCodes',
|
|
924
|
+
// Customers
|
|
925
|
+
ManageCustomers: 'ManageCustomers',
|
|
926
|
+
ViewCustomers: 'ViewCustomers',
|
|
927
|
+
// Orders
|
|
928
|
+
ManageOrders: 'ManageOrders',
|
|
929
|
+
ViewOrders: 'ViewOrders',
|
|
930
|
+
// KeyValueDocuments
|
|
931
|
+
ManageKeyValueDocuments: 'ManageKeyValueDocuments',
|
|
932
|
+
ViewKeyValueDocuments: 'ViewKeyValueDocuments',
|
|
933
|
+
// BusinessUnits
|
|
934
|
+
ManageBusinessUnits: 'ManageBusinessUnits',
|
|
935
|
+
ViewBusinessUnits: 'ViewBusinessUnits'
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
function ownKeys$8(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
939
|
+
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(_context = ownKeys$8(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$8(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
940
|
+
const FILE_IMPORT_JOB_FLOW = 'fileImportJobFlow';
|
|
941
|
+
const DEFAULT_SHORT_LIVED_FLAGS = {
|
|
942
|
+
[FILE_IMPORT_JOB_FLOW]: false
|
|
943
|
+
};
|
|
944
|
+
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
945
|
+
_objectSpread$8(_objectSpread$8({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
946
|
+
|
|
947
|
+
function ownKeys$7(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
948
|
+
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(_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
812
949
|
const useUpload = () => {
|
|
813
950
|
const intl = useIntl();
|
|
814
951
|
const _useApplicationContex = useApplicationContext(context => ({
|
|
@@ -819,39 +956,38 @@ const useUpload = () => {
|
|
|
819
956
|
state = _useImportResourcesCo.state,
|
|
820
957
|
actions = _useImportResourcesCo.actions;
|
|
821
958
|
const showNotification = useShowNotification();
|
|
822
|
-
const
|
|
823
|
-
|
|
959
|
+
const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
960
|
+
const _useFileUpload = useFileUpload({
|
|
961
|
+
projectKey: projectKey,
|
|
962
|
+
useJobBasedFlow: isFileImportJobFlowEnabled
|
|
824
963
|
}),
|
|
825
|
-
upload =
|
|
826
|
-
React.useEffect(() => {
|
|
827
|
-
return () => {
|
|
828
|
-
if (state.abortController) state.abortController.abort();
|
|
829
|
-
};
|
|
830
|
-
}, [state.abortController]);
|
|
964
|
+
upload = _useFileUpload.upload;
|
|
831
965
|
const isFileValid = async file => {
|
|
832
966
|
const errors = [];
|
|
967
|
+
const maxFileSizeMB = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
968
|
+
const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
833
969
|
const isDelimiterValid = await validateDelimiter(file, COLUMN_DELIMITERS);
|
|
834
970
|
if (!isDelimiterValid) errors.push({
|
|
835
|
-
title: intl.formatMessage(messages$
|
|
836
|
-
description: intl.formatMessage(messages$
|
|
971
|
+
title: intl.formatMessage(messages$5.wrongSeparatorTitle),
|
|
972
|
+
description: intl.formatMessage(messages$5.wrongSeparatorDescription, {
|
|
837
973
|
delimiterList: formatAllowedDelimitersForMessageDisplay(intl)
|
|
838
974
|
})
|
|
839
975
|
});
|
|
840
976
|
const rowCount = await getRowCount(file);
|
|
841
977
|
if (rowCount < 1) errors.push({
|
|
842
|
-
title: intl.formatMessage(messages$
|
|
843
|
-
description: intl.formatMessage(messages$
|
|
978
|
+
title: intl.formatMessage(messages$5.dropAreaNotEnoughRowsTitle),
|
|
979
|
+
description: intl.formatMessage(messages$5.dropAreaNotEnoughRowsDescription)
|
|
844
980
|
});
|
|
845
|
-
if (state.resourceType && file.size > toBytes(
|
|
846
|
-
title: intl.formatMessage(messages$
|
|
847
|
-
description: intl.formatMessage(messages$
|
|
848
|
-
fileSizeLimit: intl.formatNumber(
|
|
981
|
+
if (state.resourceType && file.size > toBytes(maxFileSizeMB)) errors.push({
|
|
982
|
+
title: intl.formatMessage(messages$5.fileSizeExceededTitle),
|
|
983
|
+
description: intl.formatMessage(messages$5.fileSizeExceededDescription, {
|
|
984
|
+
fileSizeLimit: intl.formatNumber(maxFileSizeMB)
|
|
849
985
|
})
|
|
850
986
|
});
|
|
851
|
-
if (state.resourceType && rowCount >
|
|
852
|
-
title: intl.formatMessage(messages$
|
|
853
|
-
description: intl.formatMessage(messages$
|
|
854
|
-
rowLimit: intl.formatNumber(
|
|
987
|
+
if (state.resourceType && rowCount > maxItemCount) errors.push({
|
|
988
|
+
title: intl.formatMessage(messages$5.rowLimitExceededTitle),
|
|
989
|
+
description: intl.formatMessage(messages$5.rowLimitExceededDescription, {
|
|
990
|
+
rowLimit: intl.formatNumber(maxItemCount)
|
|
855
991
|
})
|
|
856
992
|
});
|
|
857
993
|
if (errors.length > 0) {
|
|
@@ -859,6 +995,10 @@ const useUpload = () => {
|
|
|
859
995
|
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
860
996
|
return false;
|
|
861
997
|
}
|
|
998
|
+
if (isFileImportJobFlowEnabled) {
|
|
999
|
+
const resourceCount = await countUniqueResourcesInCsv(file);
|
|
1000
|
+
actions.setTotalResourceCount(resourceCount);
|
|
1001
|
+
}
|
|
862
1002
|
return true;
|
|
863
1003
|
};
|
|
864
1004
|
const handleUploadError = error => {
|
|
@@ -867,18 +1007,22 @@ const useUpload = () => {
|
|
|
867
1007
|
return;
|
|
868
1008
|
}
|
|
869
1009
|
if (error instanceof HttpError) {
|
|
1010
|
+
actions.setValidationProgress({
|
|
1011
|
+
processed: 0,
|
|
1012
|
+
isValidating: false
|
|
1013
|
+
});
|
|
870
1014
|
if (error.errorData?.code === 'MISSING_KEY_ERROR') {
|
|
871
1015
|
actions.setFileUploadErrors([{
|
|
872
|
-
title: intl.formatMessage(messages$
|
|
873
|
-
description: intl.formatMessage(messages$
|
|
1016
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
1017
|
+
description: intl.formatMessage(messages$5.missingKeyError)
|
|
874
1018
|
}]);
|
|
875
1019
|
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
876
1020
|
} else if (error.errorData?.code === 'MissingCsvFieldIdentifier') {
|
|
877
1021
|
const MissingCsvFieldIdentifierError = error.errorData;
|
|
878
1022
|
const fieldNames = formatKeys(MissingCsvFieldIdentifierError.rowValue);
|
|
879
1023
|
actions.setFileUploadErrors([{
|
|
880
|
-
title: intl.formatMessage(messages$
|
|
881
|
-
description: intl.formatMessage(messages$
|
|
1024
|
+
title: intl.formatMessage(messages$5.missingRequiredField),
|
|
1025
|
+
description: intl.formatMessage(messages$5.missingRequiredKeys, {
|
|
882
1026
|
fieldNames
|
|
883
1027
|
})
|
|
884
1028
|
}]);
|
|
@@ -891,7 +1035,7 @@ const useUpload = () => {
|
|
|
891
1035
|
showNotification({
|
|
892
1036
|
kind: 'error',
|
|
893
1037
|
domain: DOMAINS.PAGE,
|
|
894
|
-
text: intl.formatMessage(messages$
|
|
1038
|
+
text: intl.formatMessage(messages$5.unexpectedError)
|
|
895
1039
|
});
|
|
896
1040
|
}
|
|
897
1041
|
} else {
|
|
@@ -914,77 +1058,65 @@ const useUpload = () => {
|
|
|
914
1058
|
if (!state.droppedFile || !state.resourceType) return;
|
|
915
1059
|
const canUpload = await isFileValid(state.droppedFile);
|
|
916
1060
|
if (!canUpload) return;
|
|
1061
|
+
const abortController = new AbortController();
|
|
1062
|
+
actions.setAbortController(abortController);
|
|
917
1063
|
actions.setCurrentStep(CurrentStep$1.Uploading);
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
1064
|
+
const shouldApplyPublishSettings = state.resourceType === 'product';
|
|
1065
|
+
const uploadSettings = _objectSpread$7({
|
|
1066
|
+
format: 'CSV',
|
|
1067
|
+
decimalSeparator: state.settings?.decimalSeparator
|
|
1068
|
+
}, shouldApplyPublishSettings ? {
|
|
1069
|
+
resourceType: state.resourceType === 'product' ? 'product-draft' : state.resourceType,
|
|
1070
|
+
options: {
|
|
1071
|
+
publishAllChanges: state.settings?.publish ?? false
|
|
1072
|
+
}
|
|
1073
|
+
} : {});
|
|
1074
|
+
await upload({
|
|
1075
|
+
file: state.droppedFile,
|
|
1076
|
+
resourceType: state.resourceType,
|
|
1077
|
+
settings: uploadSettings,
|
|
1078
|
+
abortSignal: abortController.signal,
|
|
1079
|
+
onSuccess: result => {
|
|
1080
|
+
actions.setValidationProgress({
|
|
1081
|
+
processed: 0,
|
|
1082
|
+
isValidating: false
|
|
1083
|
+
});
|
|
1084
|
+
actions.setContainerKey(result.containerKey);
|
|
1085
|
+
if (result.jobId) {
|
|
1086
|
+
actions.setJobId(result.jobId);
|
|
1087
|
+
}
|
|
1088
|
+
const fileUploadResponse = {
|
|
1089
|
+
results: result.summary.results,
|
|
1090
|
+
invalid: result.summary.invalid,
|
|
1091
|
+
valid: result.summary.valid,
|
|
1092
|
+
fileName: state.droppedFile?.name || '',
|
|
1093
|
+
itemsCount: result.summary.total,
|
|
1094
|
+
rowsCount: result.summary.total,
|
|
1095
|
+
columnsCount: result.summary.fieldsCount,
|
|
1096
|
+
fields: result.summary.fields,
|
|
1097
|
+
ignoredFields: result.summary.ignoredFields
|
|
1098
|
+
};
|
|
1099
|
+
actions.setUploadFileResponse(fileUploadResponse);
|
|
1100
|
+
actions.setCurrentStep(CurrentStep$1.UploadResult);
|
|
1101
|
+
},
|
|
1102
|
+
onProgress: progress => {
|
|
1103
|
+
actions.setProgress(progress);
|
|
1104
|
+
},
|
|
1105
|
+
onValidationProgress: job => {
|
|
1106
|
+
const processed = job.summary?.total ?? 0;
|
|
1107
|
+
actions.setValidationProgress({
|
|
1108
|
+
processed,
|
|
1109
|
+
isValidating: true
|
|
1110
|
+
});
|
|
1111
|
+
},
|
|
1112
|
+
onError: handleUploadError
|
|
1113
|
+
});
|
|
947
1114
|
};
|
|
948
1115
|
return {
|
|
949
1116
|
handleUploadAndValidation
|
|
950
1117
|
};
|
|
951
1118
|
};
|
|
952
1119
|
|
|
953
|
-
const INITIAL_COLUMN_DISPLAY_COUNT = 8;
|
|
954
|
-
|
|
955
|
-
const PERMISSIONS = {
|
|
956
|
-
// Categories
|
|
957
|
-
ManageCategories: 'ManageCategories',
|
|
958
|
-
ViewCategories: 'ViewCategories',
|
|
959
|
-
// Products
|
|
960
|
-
ManageProducts: 'ManageProducts',
|
|
961
|
-
ViewProducts: 'ViewProducts',
|
|
962
|
-
// ProductTypes
|
|
963
|
-
ManageProductTypes: 'ManageProductTypes',
|
|
964
|
-
ViewProductTypes: 'ViewProductTypes',
|
|
965
|
-
// DiscountCodes
|
|
966
|
-
ManageDiscountCodes: 'ManageDiscountCodes',
|
|
967
|
-
ViewDiscountCodes: 'ViewDiscountCodes',
|
|
968
|
-
// Customers
|
|
969
|
-
ManageCustomers: 'ManageCustomers',
|
|
970
|
-
ViewCustomers: 'ViewCustomers',
|
|
971
|
-
// Orders
|
|
972
|
-
ManageOrders: 'ManageOrders',
|
|
973
|
-
ViewOrders: 'ViewOrders',
|
|
974
|
-
// KeyValueDocuments
|
|
975
|
-
ManageKeyValueDocuments: 'ManageKeyValueDocuments',
|
|
976
|
-
ViewKeyValueDocuments: 'ViewKeyValueDocuments',
|
|
977
|
-
// BusinessUnits
|
|
978
|
-
ManageBusinessUnits: 'ManageBusinessUnits',
|
|
979
|
-
ViewBusinessUnits: 'ViewBusinessUnits'
|
|
980
|
-
};
|
|
981
|
-
|
|
982
|
-
function ownKeys$9(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
983
|
-
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(_context = ownKeys$9(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$9(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
984
|
-
const DEFAULT_SHORT_LIVED_FLAGS = {};
|
|
985
|
-
const DEFAULT_LONG_LIVED_FLAGS = {};
|
|
986
|
-
_objectSpread$9(_objectSpread$9({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
987
|
-
|
|
988
1120
|
const useImportPermission = () => {
|
|
989
1121
|
const _useApplicationContex = useApplicationContext(applicationContext => ({
|
|
990
1122
|
actionRights: applicationContext.actionRights?.products
|
|
@@ -1049,9 +1181,9 @@ const FileDropArea = () => {
|
|
|
1049
1181
|
}, [state.resourceType, actions]);
|
|
1050
1182
|
const handleDropRejected = React.useCallback(errorType => {
|
|
1051
1183
|
const errorMessageMap = {
|
|
1052
|
-
'too-many-files': messages$
|
|
1053
|
-
'invalid-type': messages$
|
|
1054
|
-
generic: messages$
|
|
1184
|
+
'too-many-files': messages$6.tooManyFilesError,
|
|
1185
|
+
'invalid-type': messages$6.fileFormatNotSupported,
|
|
1186
|
+
generic: messages$6.genericError
|
|
1055
1187
|
};
|
|
1056
1188
|
showNotification({
|
|
1057
1189
|
kind: 'error',
|
|
@@ -1078,10 +1210,10 @@ const FileDropArea = () => {
|
|
|
1078
1210
|
isFileDropped: Boolean(state.droppedFile),
|
|
1079
1211
|
fileName: state.droppedFile?.name,
|
|
1080
1212
|
messages: {
|
|
1081
|
-
chooseFile: intl.formatMessage(messages$
|
|
1082
|
-
dragAndDropCSV: intl.formatMessage(messages$
|
|
1083
|
-
or: intl.formatMessage(messages$
|
|
1084
|
-
browseButton: intl.formatMessage(messages$
|
|
1213
|
+
chooseFile: intl.formatMessage(messages$6.chooseFile),
|
|
1214
|
+
dragAndDropCSV: intl.formatMessage(messages$6.dragAndDropCSV),
|
|
1215
|
+
or: intl.formatMessage(messages$6.or),
|
|
1216
|
+
browseButton: intl.formatMessage(messages$6.browseButton)
|
|
1085
1217
|
}
|
|
1086
1218
|
})
|
|
1087
1219
|
});
|
|
@@ -1129,14 +1261,14 @@ const Upload = () => {
|
|
|
1129
1261
|
children: [jsx(Grid.Item, {
|
|
1130
1262
|
children: jsx(Text.Body, {
|
|
1131
1263
|
isBold: true,
|
|
1132
|
-
intlMessage: messages$
|
|
1264
|
+
intlMessage: messages$6.dataType
|
|
1133
1265
|
})
|
|
1134
1266
|
}), jsx(Grid.Item, {
|
|
1135
1267
|
children: jsx(ResourceTypeSelection, {})
|
|
1136
1268
|
}), jsx(Grid.Item, {
|
|
1137
1269
|
children: jsx(Text.Body, {
|
|
1138
1270
|
isBold: true,
|
|
1139
|
-
intlMessage: messages$
|
|
1271
|
+
intlMessage: messages$6.instructions
|
|
1140
1272
|
})
|
|
1141
1273
|
}), jsx(Grid.Item, {
|
|
1142
1274
|
children: jsx(Instructions, {})
|
|
@@ -1144,8 +1276,8 @@ const Upload = () => {
|
|
|
1144
1276
|
}) : jsx(Fragment, {
|
|
1145
1277
|
children: jsx(Instructions, {})
|
|
1146
1278
|
}), jsx(InfoBox, {
|
|
1147
|
-
title: intl.formatMessage(messages$
|
|
1148
|
-
description: intl.formatMessage(messages$
|
|
1279
|
+
title: intl.formatMessage(messages$6.prerequisitesOfImportingData),
|
|
1280
|
+
description: intl.formatMessage(messages$6.keysForEveryResource, {
|
|
1149
1281
|
link: msg => jsx(Link, {
|
|
1150
1282
|
tone: "secondary",
|
|
1151
1283
|
isExternal: true,
|
|
@@ -1160,11 +1292,11 @@ const Upload = () => {
|
|
|
1160
1292
|
decimalSeparator
|
|
1161
1293
|
});
|
|
1162
1294
|
},
|
|
1163
|
-
separatorTitle: intl.formatMessage(messages$
|
|
1164
|
-
decimalsSeparatorDescription: intl.formatMessage(messages$
|
|
1165
|
-
decimalSeparatorPointLabel: intl.formatMessage(messages$
|
|
1166
|
-
decimalSeparatorCommaLabel: intl.formatMessage(messages$
|
|
1167
|
-
decimalsLabel: intl.formatMessage(messages$
|
|
1295
|
+
separatorTitle: intl.formatMessage(messages$6.separatorTitle),
|
|
1296
|
+
decimalsSeparatorDescription: intl.formatMessage(messages$6.decimalsSeparatorDescription),
|
|
1297
|
+
decimalSeparatorPointLabel: intl.formatMessage(messages$6.decimalSeparatorPoint),
|
|
1298
|
+
decimalSeparatorCommaLabel: intl.formatMessage(messages$6.decimalSeparatorComma),
|
|
1299
|
+
decimalsLabel: intl.formatMessage(messages$6.decimals)
|
|
1168
1300
|
}), jsx(Masking.Mask, {
|
|
1169
1301
|
children: jsx(FileDropArea, {})
|
|
1170
1302
|
}), jsx(UploadSettings, {
|
|
@@ -1175,7 +1307,7 @@ const Upload = () => {
|
|
|
1175
1307
|
publish: checked
|
|
1176
1308
|
});
|
|
1177
1309
|
},
|
|
1178
|
-
publishProductsLabel: intl.formatMessage(messages$
|
|
1310
|
+
publishProductsLabel: intl.formatMessage(messages$6.publishProducts),
|
|
1179
1311
|
dataTrackingTarget: "product_import-publish_checkbox",
|
|
1180
1312
|
canPublishProducts: canPublishProducts
|
|
1181
1313
|
})]
|
|
@@ -1184,7 +1316,7 @@ const Upload = () => {
|
|
|
1184
1316
|
});
|
|
1185
1317
|
};
|
|
1186
1318
|
|
|
1187
|
-
var messages$
|
|
1319
|
+
var messages$4 = defineMessages({
|
|
1188
1320
|
row: {
|
|
1189
1321
|
id: 'ImportResourcesModal.row',
|
|
1190
1322
|
description: 'In Upload file error modal - "Row" column',
|
|
@@ -1217,149 +1349,103 @@ var messages$3 = defineMessages({
|
|
|
1217
1349
|
}
|
|
1218
1350
|
});
|
|
1219
1351
|
|
|
1220
|
-
function ownKeys$
|
|
1221
|
-
function _objectSpread$
|
|
1222
|
-
const
|
|
1352
|
+
function ownKeys$6(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1353
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1354
|
+
const fileLevelColumns = [{
|
|
1223
1355
|
key: 'errorType',
|
|
1224
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1356
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1225
1357
|
width: 'max-content'
|
|
1226
1358
|
}, {
|
|
1227
1359
|
key: 'details',
|
|
1228
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1360
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1229
1361
|
}];
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1362
|
+
const rowLevelColumns = [{
|
|
1363
|
+
key: 'row',
|
|
1364
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.row)),
|
|
1365
|
+
width: 'max-content'
|
|
1366
|
+
}, {
|
|
1367
|
+
key: 'errorType',
|
|
1368
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1369
|
+
width: 'max-content'
|
|
1370
|
+
}, {
|
|
1371
|
+
key: 'details',
|
|
1372
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1373
|
+
}];
|
|
1374
|
+
const FileLevelErrorTable = _ref => {
|
|
1375
|
+
let rows = _ref.rows;
|
|
1232
1376
|
const pagination = usePaginationState({
|
|
1233
1377
|
perPage: 10
|
|
1234
1378
|
});
|
|
1235
1379
|
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1236
1380
|
const endIndex = startIndex + pagination.perPage.value;
|
|
1237
|
-
const currentPageRows = _sliceInstanceProperty(
|
|
1238
|
-
const shouldShowPagination =
|
|
1381
|
+
const currentPageRows = _sliceInstanceProperty(rows).call(rows, startIndex, endIndex);
|
|
1382
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1239
1383
|
return jsxs(Spacings.Stack, {
|
|
1240
1384
|
scale: "l",
|
|
1241
1385
|
children: [jsx(DataTable, {
|
|
1242
1386
|
verticalCellAlignment: "center",
|
|
1243
1387
|
isCondensed: true,
|
|
1244
1388
|
rows: currentPageRows,
|
|
1245
|
-
columns:
|
|
1246
|
-
itemRenderer:
|
|
1389
|
+
columns: fileLevelColumns,
|
|
1390
|
+
itemRenderer: fileLevelItemRenderer
|
|
1247
1391
|
}), shouldShowPagination && jsx(PageNavigator, {
|
|
1248
1392
|
onPageChange: pagination.page.onChange,
|
|
1249
1393
|
page: pagination.page.value,
|
|
1250
|
-
totalPages: Math.ceil(
|
|
1394
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1251
1395
|
})]
|
|
1252
1396
|
});
|
|
1253
1397
|
};
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
case 'errorType':
|
|
1257
|
-
return jsx(Stamp, {
|
|
1258
|
-
isCondensed: true,
|
|
1259
|
-
label: item.title,
|
|
1260
|
-
tone: "critical"
|
|
1261
|
-
});
|
|
1262
|
-
case 'details':
|
|
1263
|
-
return jsx(Text.Body, {
|
|
1264
|
-
children: item.description
|
|
1265
|
-
});
|
|
1266
|
-
default:
|
|
1267
|
-
throw new UnexpectedColumnError(column.key);
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
function ownKeys$7(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1272
|
-
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(_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1273
|
-
const UploadErrorsModal = () => {
|
|
1274
|
-
const intl = useIntl();
|
|
1275
|
-
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1276
|
-
state = _useImportResourcesCo.state,
|
|
1277
|
-
actions = _useImportResourcesCo.actions,
|
|
1278
|
-
onClose = _useImportResourcesCo.onClose;
|
|
1279
|
-
const errorsCount = state.fileUploadErrors.length;
|
|
1280
|
-
return jsx(InfoDialog, {
|
|
1281
|
-
size: 16,
|
|
1282
|
-
isOpen: true,
|
|
1283
|
-
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1284
|
-
onClose: () => onClose(),
|
|
1285
|
-
children: jsx(Masking.Unmask, {
|
|
1286
|
-
children: jsxs(Spacings.Stack, {
|
|
1287
|
-
scale: "l",
|
|
1288
|
-
children: [jsx(Masking.Mask, {
|
|
1289
|
-
children: jsx(Text.Body, {
|
|
1290
|
-
intlMessage: _objectSpread$7(_objectSpread$7({}, messages$3.uploadErrorDescription), {}, {
|
|
1291
|
-
values: {
|
|
1292
|
-
fileName: state.droppedFile?.name,
|
|
1293
|
-
errorsCount: intl.formatNumber(errorsCount),
|
|
1294
|
-
b: getBold$3
|
|
1295
|
-
}
|
|
1296
|
-
})
|
|
1297
|
-
})
|
|
1298
|
-
}), jsx(UploadErrorTable, {
|
|
1299
|
-
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1300
|
-
}), jsxs(Spacings.Inline, {
|
|
1301
|
-
scale: "m",
|
|
1302
|
-
justifyContent: "flex-end",
|
|
1303
|
-
children: [jsx(SecondaryButton, {
|
|
1304
|
-
label: intl.formatMessage(sharedMessages.close),
|
|
1305
|
-
onClick: () => onClose()
|
|
1306
|
-
}), jsx(PrimaryButton, {
|
|
1307
|
-
iconLeft: jsx(ImportIcon, {}),
|
|
1308
|
-
label: intl.formatMessage(messages$3.uploadNewFile),
|
|
1309
|
-
onClick: () => actions.uploadNewFile()
|
|
1310
|
-
})]
|
|
1311
|
-
})]
|
|
1312
|
-
})
|
|
1313
|
-
})
|
|
1314
|
-
});
|
|
1315
|
-
};
|
|
1316
|
-
function getBold$3(msg) {
|
|
1317
|
-
return jsx(Text.Body, {
|
|
1318
|
-
as: "span",
|
|
1319
|
-
isBold: true,
|
|
1320
|
-
children: msg
|
|
1321
|
-
}, crypto.randomUUID());
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
function ownKeys$6(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1325
|
-
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(_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1326
|
-
const getColumns = () => [{
|
|
1327
|
-
key: 'row',
|
|
1328
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$3.row)),
|
|
1329
|
-
width: 'max-content'
|
|
1330
|
-
}, {
|
|
1331
|
-
key: 'errorType',
|
|
1332
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$3.errorType)),
|
|
1333
|
-
width: 'max-content'
|
|
1334
|
-
}, {
|
|
1335
|
-
key: 'details',
|
|
1336
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$3.details))
|
|
1337
|
-
}];
|
|
1338
|
-
const UploadRowErrorTable = props => {
|
|
1339
|
-
var _context;
|
|
1398
|
+
const RowLevelErrorTable = _ref2 => {
|
|
1399
|
+
let rows = _ref2.rows;
|
|
1340
1400
|
const pagination = usePaginationState({
|
|
1341
1401
|
perPage: 10
|
|
1342
1402
|
});
|
|
1343
1403
|
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1344
1404
|
const endIndex = startIndex + pagination.perPage.value;
|
|
1345
|
-
const currentPageRows = _sliceInstanceProperty(
|
|
1346
|
-
const shouldShowPagination =
|
|
1405
|
+
const currentPageRows = _sliceInstanceProperty(rows).call(rows, startIndex, endIndex);
|
|
1406
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1347
1407
|
return jsxs(Spacings.Stack, {
|
|
1348
1408
|
scale: "l",
|
|
1349
1409
|
children: [jsx(DataTable, {
|
|
1350
1410
|
verticalCellAlignment: "center",
|
|
1351
1411
|
isCondensed: true,
|
|
1352
1412
|
rows: currentPageRows,
|
|
1353
|
-
columns:
|
|
1354
|
-
itemRenderer:
|
|
1413
|
+
columns: rowLevelColumns,
|
|
1414
|
+
itemRenderer: rowLevelItemRenderer
|
|
1355
1415
|
}), shouldShowPagination && jsx(PageNavigator, {
|
|
1356
1416
|
onPageChange: pagination.page.onChange,
|
|
1357
1417
|
page: pagination.page.value,
|
|
1358
|
-
totalPages: Math.ceil(
|
|
1418
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1359
1419
|
})]
|
|
1360
1420
|
});
|
|
1361
1421
|
};
|
|
1362
|
-
|
|
1422
|
+
const UploadErrorTable = props => {
|
|
1423
|
+
if (props.variant === 'row-level') {
|
|
1424
|
+
return jsx(RowLevelErrorTable, {
|
|
1425
|
+
rows: props.rows
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
return jsx(FileLevelErrorTable, {
|
|
1429
|
+
rows: props.rows
|
|
1430
|
+
});
|
|
1431
|
+
};
|
|
1432
|
+
function fileLevelItemRenderer(item, column) {
|
|
1433
|
+
switch (column.key) {
|
|
1434
|
+
case 'errorType':
|
|
1435
|
+
return jsx(Stamp, {
|
|
1436
|
+
isCondensed: true,
|
|
1437
|
+
label: item.title,
|
|
1438
|
+
tone: "critical"
|
|
1439
|
+
});
|
|
1440
|
+
case 'details':
|
|
1441
|
+
return jsx(Text.Body, {
|
|
1442
|
+
children: item.description
|
|
1443
|
+
});
|
|
1444
|
+
default:
|
|
1445
|
+
throw new UnexpectedColumnError(column.key);
|
|
1446
|
+
}
|
|
1447
|
+
}
|
|
1448
|
+
function rowLevelItemRenderer(item, column) {
|
|
1363
1449
|
switch (column.key) {
|
|
1364
1450
|
case 'row':
|
|
1365
1451
|
return item.row;
|
|
@@ -1386,19 +1472,21 @@ function itemRenderer(item, column) {
|
|
|
1386
1472
|
|
|
1387
1473
|
function ownKeys$5(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1388
1474
|
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(_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1389
|
-
const
|
|
1475
|
+
const UploadErrorsModal = () => {
|
|
1390
1476
|
const intl = useIntl();
|
|
1391
1477
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1392
1478
|
state = _useImportResourcesCo.state,
|
|
1393
1479
|
actions = _useImportResourcesCo.actions,
|
|
1394
1480
|
onClose = _useImportResourcesCo.onClose;
|
|
1395
|
-
const
|
|
1481
|
+
const isRowLevelErrors = (state.uploadFileResponse?.invalid ?? 0) > 0 && (state.uploadFileResponse?.results?.length ?? 0) > 0;
|
|
1482
|
+
const isFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
1483
|
+
const errorsCount = isRowLevelErrors ? getFileUploadErrorsCount(state.uploadFileResponse?.results) : state.fileUploadErrors.length;
|
|
1396
1484
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
1397
1485
|
return jsx(InfoDialog, {
|
|
1398
1486
|
size: 16,
|
|
1399
1487
|
isOpen: true,
|
|
1400
1488
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1401
|
-
onClose: onClose,
|
|
1489
|
+
onClose: () => onClose(),
|
|
1402
1490
|
children: jsx(Masking.Unmask, {
|
|
1403
1491
|
children: jsxs(Spacings.Stack, {
|
|
1404
1492
|
scale: "l",
|
|
@@ -1406,7 +1494,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1406
1494
|
scale: "xs",
|
|
1407
1495
|
children: [jsx(Masking.Mask, {
|
|
1408
1496
|
children: jsx(Text.Body, {
|
|
1409
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1497
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.uploadErrorDescription), {}, {
|
|
1410
1498
|
values: {
|
|
1411
1499
|
fileName: state.droppedFile?.name,
|
|
1412
1500
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1414,8 +1502,8 @@ const UploadRowErrorsModal = () => {
|
|
|
1414
1502
|
}
|
|
1415
1503
|
})
|
|
1416
1504
|
})
|
|
1417
|
-
}), jsx(Text.Body, {
|
|
1418
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1505
|
+
}), isRowLevelErrors && jsx(Text.Body, {
|
|
1506
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.supportedValuesDocumentation), {}, {
|
|
1419
1507
|
values: {
|
|
1420
1508
|
documentationLink: msg => jsx(Link, {
|
|
1421
1509
|
tone: "secondary",
|
|
@@ -1426,8 +1514,12 @@ const UploadRowErrorsModal = () => {
|
|
|
1426
1514
|
}
|
|
1427
1515
|
})
|
|
1428
1516
|
})]
|
|
1429
|
-
}), jsx(
|
|
1517
|
+
}), isRowLevelErrors && jsx(UploadErrorTable, {
|
|
1518
|
+
variant: "row-level",
|
|
1430
1519
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1520
|
+
}), isFileLevelErrors && jsx(UploadErrorTable, {
|
|
1521
|
+
variant: "file-level",
|
|
1522
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1431
1523
|
}), jsxs(Spacings.Inline, {
|
|
1432
1524
|
scale: "m",
|
|
1433
1525
|
justifyContent: "flex-end",
|
|
@@ -1436,7 +1528,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1436
1528
|
onClick: () => onClose()
|
|
1437
1529
|
}), jsx(PrimaryButton, {
|
|
1438
1530
|
iconLeft: jsx(ImportIcon, {}),
|
|
1439
|
-
label: intl.formatMessage(messages$
|
|
1531
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1440
1532
|
onClick: () => actions.uploadNewFile()
|
|
1441
1533
|
})]
|
|
1442
1534
|
})]
|
|
@@ -1452,7 +1544,7 @@ function getBold$2(msg) {
|
|
|
1452
1544
|
}, crypto.randomUUID());
|
|
1453
1545
|
}
|
|
1454
1546
|
|
|
1455
|
-
var messages$
|
|
1547
|
+
var messages$3 = defineMessages({
|
|
1456
1548
|
startImportButton: {
|
|
1457
1549
|
id: 'ImportResourcesModal.startImportButton',
|
|
1458
1550
|
description: 'Label for the modal Start import button',
|
|
@@ -1569,7 +1661,7 @@ const ColumnList = props => {
|
|
|
1569
1661
|
e.preventDefault();
|
|
1570
1662
|
setIsExpanded(!isExpanded);
|
|
1571
1663
|
},
|
|
1572
|
-
children: isExpanded ? jsx(FormattedMessage, _objectSpread$4({}, messages$
|
|
1664
|
+
children: isExpanded ? jsx(FormattedMessage, _objectSpread$4({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$4({}, messages$3.showMore))
|
|
1573
1665
|
})
|
|
1574
1666
|
})]
|
|
1575
1667
|
});
|
|
@@ -1589,13 +1681,13 @@ function UploadPreviewModal() {
|
|
|
1589
1681
|
const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
|
|
1590
1682
|
const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
|
|
1591
1683
|
const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
|
|
1592
|
-
const
|
|
1593
|
-
const
|
|
1684
|
+
const ignoredFields = state.uploadFileResponse.ignoredFields;
|
|
1685
|
+
const validatedFields = getValidatedColumns(state.uploadFileResponse.fields, ignoredFields);
|
|
1594
1686
|
return jsx(FormDialog, {
|
|
1595
1687
|
size: 16,
|
|
1596
1688
|
isOpen: true,
|
|
1597
1689
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1598
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1690
|
+
labelPrimary: intl.formatMessage(messages$3.continue),
|
|
1599
1691
|
onSecondaryButtonClick: () => onClose({
|
|
1600
1692
|
shouldDeleteImportContainer: true
|
|
1601
1693
|
}),
|
|
@@ -1614,7 +1706,7 @@ function UploadPreviewModal() {
|
|
|
1614
1706
|
children: jsxs(Spacings.Stack, {
|
|
1615
1707
|
scale: "m",
|
|
1616
1708
|
children: [jsx("div", {}), jsx(Text.Body, {
|
|
1617
|
-
intlMessage: messages$
|
|
1709
|
+
intlMessage: messages$3.previewOfYourImport
|
|
1618
1710
|
}), jsx(Card, {
|
|
1619
1711
|
insetScale: "xl",
|
|
1620
1712
|
children: jsxs(Spacings.Stack, {
|
|
@@ -1626,7 +1718,7 @@ function UploadPreviewModal() {
|
|
|
1626
1718
|
children: [jsx(CheckBoldIcon, {
|
|
1627
1719
|
color: "success"
|
|
1628
1720
|
}), jsx(Text.Body, {
|
|
1629
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1721
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.itemsToBeImported), {}, {
|
|
1630
1722
|
values: {
|
|
1631
1723
|
resourceType,
|
|
1632
1724
|
resourceTypePlural,
|
|
@@ -1641,19 +1733,19 @@ function UploadPreviewModal() {
|
|
|
1641
1733
|
children: [jsx(CheckBoldIcon, {
|
|
1642
1734
|
color: "success"
|
|
1643
1735
|
}), jsx(Text.Body, {
|
|
1644
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1736
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeImported), {}, {
|
|
1645
1737
|
values: {
|
|
1646
|
-
columnCount: intl.formatNumber(
|
|
1738
|
+
columnCount: intl.formatNumber(validatedFields.length),
|
|
1647
1739
|
b: getBold$1
|
|
1648
1740
|
}
|
|
1649
1741
|
})
|
|
1650
1742
|
})]
|
|
1651
1743
|
})]
|
|
1652
1744
|
}), jsx(ColumnList, {
|
|
1653
|
-
columns:
|
|
1745
|
+
columns: validatedFields
|
|
1654
1746
|
})]
|
|
1655
1747
|
})
|
|
1656
|
-
}),
|
|
1748
|
+
}), ignoredFields.length > 0 && jsx(Card, {
|
|
1657
1749
|
insetScale: "xl",
|
|
1658
1750
|
children: jsxs(Spacings.Stack, {
|
|
1659
1751
|
scale: "s",
|
|
@@ -1662,15 +1754,15 @@ function UploadPreviewModal() {
|
|
|
1662
1754
|
children: [jsx(EyeCrossedIcon, {
|
|
1663
1755
|
color: "neutral60"
|
|
1664
1756
|
}), jsx(Text.Body, {
|
|
1665
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1757
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeIgnored), {}, {
|
|
1666
1758
|
values: {
|
|
1667
|
-
columnCount: intl.formatNumber(
|
|
1759
|
+
columnCount: intl.formatNumber(ignoredFields.length),
|
|
1668
1760
|
b: getBold$1
|
|
1669
1761
|
}
|
|
1670
1762
|
})
|
|
1671
1763
|
})]
|
|
1672
1764
|
}), jsx(ColumnList, {
|
|
1673
|
-
columns:
|
|
1765
|
+
columns: ignoredFields
|
|
1674
1766
|
})]
|
|
1675
1767
|
})
|
|
1676
1768
|
})]
|
|
@@ -1702,13 +1794,13 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
1702
1794
|
styles: "width:360px"
|
|
1703
1795
|
} : {
|
|
1704
1796
|
name: "g36yzl-ImportRunningTextNotification",
|
|
1705
|
-
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1797
|
+
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCWSIsImZpbGUiOiJpbXBvcnQtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50cydcbmltcG9ydCB7IHVzZUFwcGxpY2F0aW9uQ29udGV4dCB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FwcGxpY2F0aW9uLXNoZWxsLWNvbm5lY3RvcnMnXG5pbXBvcnQgeyBET01BSU5TIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvY29uc3RhbnRzJ1xuaW1wb3J0IHsgTWFza2luZyBhcyBGdWxsU3RvcnlNYXNraW5nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvZnVsbHN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XJtPXthc3luYyAoKSA9PiB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgY2FuQ29uZmlybSA9XG4gICAgICAgICAgICBwcm9qZWN0S2V5ICYmXG4gICAgICAgICAgICBzdGF0ZS5jb250YWluZXJLZXkgJiZcbiAgICAgICAgICAgIHN0YXRlLmRyb3BwZWRGaWxlPy5uYW1lICYmXG4gICAgICAgICAgICBzdGF0ZS5yZXNvdXJjZVR5cGVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1706
1798
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1707
1799
|
};
|
|
1708
1800
|
const ImportRunningTextNotification = props => jsx("div", {
|
|
1709
1801
|
css: _ref2,
|
|
1710
1802
|
children: jsx(Text.Body, {
|
|
1711
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1803
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationSuccessMessage), {}, {
|
|
1712
1804
|
values: {
|
|
1713
1805
|
newline: getNewLine,
|
|
1714
1806
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1722,13 +1814,13 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
1722
1814
|
styles: "width:360px"
|
|
1723
1815
|
} : {
|
|
1724
1816
|
name: "mjwslu-ImportPreparingTextNotification",
|
|
1725
|
-
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1817
|
+
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZDWSIsImZpbGUiOiJpbXBvcnQtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMt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7XG4gICAgICAgICdkYXRhLXRlc3QtaWQnOiAnY29uZmlybWF0aW9uLWRpYWxvZy1jb25maXJtJyxcbiAgICAgIH19XG4gICAgICBkYXRhQXR0cmlidXRlc1NlY29uZGFyeUJ1dHRvbj17e1xuICAgICAgICAnZGF0YS10ZXN0LWlkJzogJ2NvbmZpcm1hdGlvbi1kaWFsb2ctY2FuY2VsJyxcbiAgICAgICAgJ2RhdGEtdHJhY2tpbmctdGFyZ2V0JzogYCR7c3RhdGUucmVzb3VyY2VUeXBlfV9pbXBvcnQtc3RhcnRfaW1wb3J0X2J1dHRvbmAsXG4gICAgICB9fVxuICAgICAgb25Db25maXJtPXthc3luYyAoKSA9PiB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgY2FuQ29uZmlybSA9XG4gICAgICAgICAgICBwcm9qZWN0S2V5ICYmXG4gICAgICAgICAgICBzdGF0ZS5jb250YWluZXJLZXkgJiZcbiAgICAgICAgICAgIHN0YXRlLmRyb3BwZWRGaWxlPy5uYW1lICYmXG4gICAgICAgICAgICBzdGF0ZS5yZXNvdXJjZVR5cGVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1726
1818
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1727
1819
|
};
|
|
1728
1820
|
const ImportPreparingTextNotification = props => jsx("div", {
|
|
1729
1821
|
css: _ref,
|
|
1730
1822
|
children: jsx(Text.Body, {
|
|
1731
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1823
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationPrepareMessage), {}, {
|
|
1732
1824
|
values: {
|
|
1733
1825
|
newline: getNewLine,
|
|
1734
1826
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1752,7 +1844,7 @@ const ImportConfirmationModal = () => {
|
|
|
1752
1844
|
const showNotification = useShowNotification();
|
|
1753
1845
|
return jsx(ConfirmationDialog, {
|
|
1754
1846
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1755
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1847
|
+
labelPrimary: intl.formatMessage(messages$3.startImportButton),
|
|
1756
1848
|
isOpen: true,
|
|
1757
1849
|
onClose: () => onClose({
|
|
1758
1850
|
shouldDeleteImportContainer: true
|
|
@@ -1782,11 +1874,21 @@ const ImportConfirmationModal = () => {
|
|
|
1782
1874
|
}, {
|
|
1783
1875
|
dismissAfter: 5000
|
|
1784
1876
|
});
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1877
|
+
const isJobBasedFlow = !!state.jobId;
|
|
1878
|
+
if (isJobBasedFlow) {
|
|
1879
|
+
await processFileImportJob({
|
|
1880
|
+
projectKey,
|
|
1881
|
+
resourceType: state.resourceType,
|
|
1882
|
+
importContainerKey: state.containerKey,
|
|
1883
|
+
jobId: state.jobId
|
|
1884
|
+
});
|
|
1885
|
+
} else {
|
|
1886
|
+
await processUploadedFile({
|
|
1887
|
+
projectKey,
|
|
1888
|
+
importContainerKey: state.containerKey,
|
|
1889
|
+
resourceType: state.resourceType
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1790
1892
|
onStartImportSuccess();
|
|
1791
1893
|
showNotification({
|
|
1792
1894
|
kind: 'info',
|
|
@@ -1815,7 +1917,7 @@ const ImportConfirmationModal = () => {
|
|
|
1815
1917
|
scale: "xl",
|
|
1816
1918
|
children: [jsxs("div", {
|
|
1817
1919
|
children: [jsx(Text.Body, {
|
|
1818
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1920
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.confirmationBodyText), {}, {
|
|
1819
1921
|
values: {
|
|
1820
1922
|
projectName: projectName,
|
|
1821
1923
|
count: intl.formatNumber(state?.uploadFileResponse?.rowsCount || 0),
|
|
@@ -1823,10 +1925,10 @@ const ImportConfirmationModal = () => {
|
|
|
1823
1925
|
}
|
|
1824
1926
|
})
|
|
1825
1927
|
}), jsx(Text.Body, {
|
|
1826
|
-
intlMessage: messages$
|
|
1928
|
+
intlMessage: messages$3.confirmationBodyNote
|
|
1827
1929
|
})]
|
|
1828
1930
|
}), jsx(Text.Body, {
|
|
1829
|
-
intlMessage: messages$
|
|
1931
|
+
intlMessage: messages$3.confirmationBodyQuestion
|
|
1830
1932
|
})]
|
|
1831
1933
|
})
|
|
1832
1934
|
})
|
|
@@ -1843,11 +1945,21 @@ function getBold(msg) {
|
|
|
1843
1945
|
const UploadResult = () => {
|
|
1844
1946
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1845
1947
|
state = _useImportResourcesCo.state;
|
|
1846
|
-
|
|
1847
|
-
|
|
1948
|
+
const hasFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
1949
|
+
const hasRowLevelErrors = (state.uploadFileResponse?.invalid ?? 0) > 0 && (state.uploadFileResponse?.results?.length ?? 0) > 0;
|
|
1950
|
+
if (hasFileLevelErrors || hasRowLevelErrors) {
|
|
1951
|
+
return jsx(UploadErrorsModal, {});
|
|
1952
|
+
}
|
|
1848
1953
|
return jsx(UploadPreviewModal, {});
|
|
1849
1954
|
};
|
|
1850
1955
|
|
|
1956
|
+
var messages$2 = defineMessages({
|
|
1957
|
+
validatingResources: {
|
|
1958
|
+
id: 'ImportResourcesModal.Uploading.validatingResources',
|
|
1959
|
+
defaultMessage: 'Validating {processed} / {total} {resourceType}'
|
|
1960
|
+
}
|
|
1961
|
+
});
|
|
1962
|
+
|
|
1851
1963
|
const Uploading = () => {
|
|
1852
1964
|
const intl = useIntl();
|
|
1853
1965
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1855,6 +1967,12 @@ const Uploading = () => {
|
|
|
1855
1967
|
actions = _useImportResourcesCo.actions,
|
|
1856
1968
|
onClose = _useImportResourcesCo.onClose;
|
|
1857
1969
|
if (!state.droppedFile?.name) return null;
|
|
1970
|
+
const showValidationProgress = state.isValidating && state.validationProcessed && state.validationProcessed > 0 && state.totalResourceCount && state.resourceType;
|
|
1971
|
+
const statusMessage = showValidationProgress ? intl.formatMessage(messages$2.validatingResources, {
|
|
1972
|
+
processed: intl.formatNumber(state.validationProcessed),
|
|
1973
|
+
total: intl.formatNumber(state.totalResourceCount),
|
|
1974
|
+
resourceType: intl.formatMessage(resourceTypeToPluralMessage(state.resourceType))
|
|
1975
|
+
}) : undefined;
|
|
1858
1976
|
return jsx(UploadingModal, {
|
|
1859
1977
|
isOpen: true,
|
|
1860
1978
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
@@ -1868,7 +1986,8 @@ const Uploading = () => {
|
|
|
1868
1986
|
},
|
|
1869
1987
|
onClose: () => onClose({
|
|
1870
1988
|
shouldDeleteImportContainer: true
|
|
1871
|
-
})
|
|
1989
|
+
}),
|
|
1990
|
+
statusMessage: statusMessage
|
|
1872
1991
|
});
|
|
1873
1992
|
};
|
|
1874
1993
|
|
|
@@ -1911,7 +2030,7 @@ const resourceTypeToDisplayName = resourceType => {
|
|
|
1911
2030
|
case IMPORTABLE_RESOURCES.CATEGORY:
|
|
1912
2031
|
return messages$1.categories;
|
|
1913
2032
|
default:
|
|
1914
|
-
throw new
|
|
2033
|
+
throw new UnexpectedResourceTypeError$1(resourceType);
|
|
1915
2034
|
}
|
|
1916
2035
|
};
|
|
1917
2036
|
const ResourceTypeSelection = () => {
|
|
@@ -1951,13 +2070,16 @@ const Instructions = () => {
|
|
|
1951
2070
|
const intl = useIntl();
|
|
1952
2071
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1953
2072
|
state = _useImportResourcesCo.state;
|
|
2073
|
+
const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
1954
2074
|
const templateLink = RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS[state.resourceType];
|
|
1955
2075
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
2076
|
+
const maxFileSize = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
2077
|
+
const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
1956
2078
|
return jsx(Text.Body, {
|
|
1957
2079
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.fileUploadInstructions), {}, {
|
|
1958
2080
|
values: {
|
|
1959
|
-
fileSize: intl.formatNumber(
|
|
1960
|
-
rowLimit: intl.formatNumber(
|
|
2081
|
+
fileSize: intl.formatNumber(maxFileSize),
|
|
2082
|
+
rowLimit: intl.formatNumber(maxItemCount),
|
|
1961
2083
|
csvTemplateLink: msg => jsx(Link, {
|
|
1962
2084
|
tone: "secondary",
|
|
1963
2085
|
isExternal: true,
|