@commercetools-frontend-extensions/import-resources-modal 1.11.6 → 1.13.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 +473 -262
- package/dist/commercetools-frontend-extensions-import-resources-modal.cjs.prod.js +471 -260
- package/dist/commercetools-frontend-extensions-import-resources-modal.esm.js +475 -264
- 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,14 +10,14 @@ 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, useFetchFileImportJobRecords, mapUploadFileErrorsResponseToUploadFileErrorRows, UnexpectedColumnError, extractErrorDescriptionFromValidationMessage, formatErrorCode, getFileUploadErrorsCount, RESOURCE_TYPE_DOCUMENTATION_LINKS, 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';
|
|
17
17
|
import { FormDialog, InfoDialog, PageContentNarrow, ConfirmationDialog } from '@commercetools-frontend/application-components';
|
|
18
18
|
import { Masking } from '@commercetools-frontend/fullstory';
|
|
19
19
|
import { useIsAuthorized } from '@commercetools-frontend/permissions';
|
|
20
|
-
import { Spacings, Grid, designTokens, Text, Link, usePaginationState, DataTable, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, TagList, Card, CheckBoldIcon, EyeCrossedIcon, RadioInput } from '@commercetools-frontend/ui-kit';
|
|
20
|
+
import { Spacings, Grid, designTokens, Text, Link, usePaginationState, LoadingSpinner, DataTable, PageNavigator, Stamp, SecondaryButton, PrimaryButton, ImportIcon, TagList, Card, CheckBoldIcon, EyeCrossedIcon, RadioInput } from '@commercetools-frontend/ui-kit';
|
|
21
21
|
import { useShowNotification } from '@commercetools-frontend/actions-global';
|
|
22
22
|
import { DOMAINS } from '@commercetools-frontend/constants';
|
|
23
23
|
import _Reflect$construct from '@babel/runtime-corejs3/core-js-stable/reflect/construct';
|
|
@@ -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$b(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$b(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys$b(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys$b(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$b(_objectSpread$b({}, 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$b(_objectSpread$b({}, state), {}, {
|
|
56
57
|
uploadFileResponse: action.uploadFileResponse
|
|
57
58
|
});
|
|
58
|
-
if (action.type === 'setResourceType') return _objectSpread$
|
|
59
|
+
if (action.type === 'setResourceType') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
59
60
|
resourceType: action.resourceType
|
|
60
61
|
});
|
|
61
|
-
if (action.type === 'setContainerKey') return _objectSpread$
|
|
62
|
+
if (action.type === 'setContainerKey') return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
62
63
|
containerKey: action.containerKey
|
|
63
64
|
});
|
|
64
|
-
if (action.type === 'cancelImport') return _objectSpread$
|
|
65
|
+
if (action.type === 'cancelImport') return _objectSpread$b(_objectSpread$b({}, 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$b(_objectSpread$b({}, 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$b(_objectSpread$b({}, state), {}, {
|
|
84
93
|
droppedFile: action.droppedFile
|
|
85
94
|
});
|
|
86
95
|
}
|
|
87
96
|
if (action.type === 'setFileUploadErrors') {
|
|
88
|
-
return _objectSpread$
|
|
97
|
+
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
89
98
|
fileUploadErrors: action.fileUploadErrors
|
|
90
99
|
});
|
|
91
100
|
}
|
|
92
101
|
if (action.type === 'setAbortController') {
|
|
93
|
-
return _objectSpread$
|
|
102
|
+
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
94
103
|
abortController: action.abortController
|
|
95
104
|
});
|
|
96
105
|
}
|
|
97
106
|
if (action.type === 'setProgress') {
|
|
98
|
-
return _objectSpread$
|
|
107
|
+
return _objectSpread$b(_objectSpread$b({}, 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$b(_objectSpread$b({}, state), {}, {
|
|
113
|
+
settings: _objectSpread$b(_objectSpread$b({}, state.settings), action.settings)
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (action.type === 'setJobId') {
|
|
117
|
+
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
118
|
+
jobId: action.jobId
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (action.type === 'setTotalResourceCount') {
|
|
122
|
+
return _objectSpread$b(_objectSpread$b({}, state), {}, {
|
|
123
|
+
totalResourceCount: action.totalResourceCount
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (action.type === 'setValidationProgress') {
|
|
127
|
+
return _objectSpread$b(_objectSpread$b({}, 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$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; }
|
|
200
|
+
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; }
|
|
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$a(_objectSpread$a({}, 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$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; }
|
|
939
|
+
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; }
|
|
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$9(_objectSpread$9({}, DEFAULT_SHORT_LIVED_FLAGS), DEFAULT_LONG_LIVED_FLAGS);
|
|
946
|
+
|
|
947
|
+
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; }
|
|
948
|
+
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; }
|
|
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$8({
|
|
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,186 @@ var messages$3 = defineMessages({
|
|
|
1217
1349
|
}
|
|
1218
1350
|
});
|
|
1219
1351
|
|
|
1220
|
-
function ownKeys$
|
|
1221
|
-
function _objectSpread$
|
|
1222
|
-
const
|
|
1352
|
+
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; }
|
|
1353
|
+
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; }
|
|
1354
|
+
const PER_PAGE = 20;
|
|
1355
|
+
const columns = [{
|
|
1356
|
+
key: 'row',
|
|
1357
|
+
label: jsx(FormattedMessage, _objectSpread$7({}, messages$4.row)),
|
|
1358
|
+
width: 'max-content'
|
|
1359
|
+
}, {
|
|
1223
1360
|
key: 'errorType',
|
|
1224
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1361
|
+
label: jsx(FormattedMessage, _objectSpread$7({}, messages$4.errorType)),
|
|
1225
1362
|
width: 'max-content'
|
|
1226
1363
|
}, {
|
|
1227
1364
|
key: 'details',
|
|
1228
|
-
label: jsx(FormattedMessage, _objectSpread$
|
|
1365
|
+
label: jsx(FormattedMessage, _objectSpread$7({}, messages$4.details))
|
|
1229
1366
|
}];
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1367
|
+
const ServerPaginatedErrorTable = _ref => {
|
|
1368
|
+
let jobId = _ref.jobId,
|
|
1369
|
+
containerKey = _ref.containerKey,
|
|
1370
|
+
totalInvalid = _ref.totalInvalid;
|
|
1371
|
+
const projectKey = useApplicationContext(context => context.project?.key);
|
|
1232
1372
|
const pagination = usePaginationState({
|
|
1233
|
-
perPage:
|
|
1373
|
+
perPage: PER_PAGE
|
|
1234
1374
|
});
|
|
1235
|
-
const
|
|
1236
|
-
const
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1375
|
+
const offset = (pagination.page.value - 1) * PER_PAGE;
|
|
1376
|
+
const totalPages = Math.ceil(totalInvalid / PER_PAGE);
|
|
1377
|
+
const _useFetchFileImportJo = useFetchFileImportJobRecords({
|
|
1378
|
+
projectKey: projectKey,
|
|
1379
|
+
importContainerKey: containerKey,
|
|
1380
|
+
jobId,
|
|
1381
|
+
offset,
|
|
1382
|
+
limit: PER_PAGE,
|
|
1383
|
+
isValid: false
|
|
1384
|
+
}),
|
|
1385
|
+
data = _useFetchFileImportJo.data,
|
|
1386
|
+
isLoading = _useFetchFileImportJo.isLoading;
|
|
1387
|
+
const rows = React.useMemo(() => data ? mapUploadFileErrorsResponseToUploadFileErrorRows(data.results) : [], [data]);
|
|
1388
|
+
const showInitialLoading = isLoading && !data;
|
|
1389
|
+
if (showInitialLoading) {
|
|
1390
|
+
return jsx(Spacings.Stack, {
|
|
1391
|
+
alignItems: "center",
|
|
1392
|
+
children: jsx(LoadingSpinner, {})
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1239
1395
|
return jsxs(Spacings.Stack, {
|
|
1240
1396
|
scale: "l",
|
|
1241
1397
|
children: [jsx(DataTable, {
|
|
1242
1398
|
verticalCellAlignment: "center",
|
|
1243
1399
|
isCondensed: true,
|
|
1244
|
-
rows:
|
|
1245
|
-
columns:
|
|
1246
|
-
itemRenderer: itemRenderer
|
|
1247
|
-
}),
|
|
1400
|
+
rows: rows,
|
|
1401
|
+
columns: columns,
|
|
1402
|
+
itemRenderer: itemRenderer
|
|
1403
|
+
}), totalPages > 1 && jsx(PageNavigator, {
|
|
1248
1404
|
onPageChange: pagination.page.onChange,
|
|
1249
1405
|
page: pagination.page.value,
|
|
1250
|
-
totalPages:
|
|
1406
|
+
totalPages: totalPages
|
|
1251
1407
|
})]
|
|
1252
1408
|
});
|
|
1253
1409
|
};
|
|
1254
|
-
function itemRenderer
|
|
1410
|
+
function itemRenderer(item, column) {
|
|
1255
1411
|
switch (column.key) {
|
|
1412
|
+
case 'row':
|
|
1413
|
+
return item.row;
|
|
1256
1414
|
case 'errorType':
|
|
1257
1415
|
return jsx(Stamp, {
|
|
1258
1416
|
isCondensed: true,
|
|
1259
|
-
label: item.
|
|
1417
|
+
label: formatErrorCode(item.code),
|
|
1260
1418
|
tone: "critical"
|
|
1261
1419
|
});
|
|
1262
1420
|
case 'details':
|
|
1263
|
-
return
|
|
1264
|
-
|
|
1421
|
+
return jsxs(Spacings.Inline, {
|
|
1422
|
+
scale: "xs",
|
|
1423
|
+
children: [jsx(Text.Body, {
|
|
1424
|
+
tone: "information",
|
|
1425
|
+
children: item.field
|
|
1426
|
+
}), jsx(Text.Body, {
|
|
1427
|
+
children: extractErrorDescriptionFromValidationMessage(item.validationMessage)
|
|
1428
|
+
})]
|
|
1265
1429
|
});
|
|
1266
1430
|
default:
|
|
1267
1431
|
throw new UnexpectedColumnError(column.key);
|
|
1268
1432
|
}
|
|
1269
1433
|
}
|
|
1270
1434
|
|
|
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
1435
|
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
|
|
1326
|
-
const
|
|
1436
|
+
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; }
|
|
1437
|
+
const fileLevelColumns = [{
|
|
1438
|
+
key: 'errorType',
|
|
1439
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1440
|
+
width: 'max-content'
|
|
1441
|
+
}, {
|
|
1442
|
+
key: 'details',
|
|
1443
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1444
|
+
}];
|
|
1445
|
+
const rowLevelColumns = [{
|
|
1327
1446
|
key: 'row',
|
|
1328
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$
|
|
1447
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.row)),
|
|
1329
1448
|
width: 'max-content'
|
|
1330
1449
|
}, {
|
|
1331
1450
|
key: 'errorType',
|
|
1332
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$
|
|
1451
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.errorType)),
|
|
1333
1452
|
width: 'max-content'
|
|
1334
1453
|
}, {
|
|
1335
1454
|
key: 'details',
|
|
1336
|
-
label: jsx(FormattedMessage, _objectSpread$6({}, messages$
|
|
1455
|
+
label: jsx(FormattedMessage, _objectSpread$6({}, messages$4.details))
|
|
1337
1456
|
}];
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1457
|
+
const FileLevelErrorTable = _ref => {
|
|
1458
|
+
let rows = _ref.rows;
|
|
1340
1459
|
const pagination = usePaginationState({
|
|
1341
1460
|
perPage: 10
|
|
1342
1461
|
});
|
|
1343
1462
|
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1344
1463
|
const endIndex = startIndex + pagination.perPage.value;
|
|
1345
|
-
const currentPageRows = _sliceInstanceProperty(
|
|
1346
|
-
const shouldShowPagination =
|
|
1464
|
+
const currentPageRows = _sliceInstanceProperty(rows).call(rows, startIndex, endIndex);
|
|
1465
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1347
1466
|
return jsxs(Spacings.Stack, {
|
|
1348
1467
|
scale: "l",
|
|
1349
1468
|
children: [jsx(DataTable, {
|
|
1350
1469
|
verticalCellAlignment: "center",
|
|
1351
1470
|
isCondensed: true,
|
|
1352
1471
|
rows: currentPageRows,
|
|
1353
|
-
columns:
|
|
1354
|
-
itemRenderer:
|
|
1472
|
+
columns: fileLevelColumns,
|
|
1473
|
+
itemRenderer: fileLevelItemRenderer
|
|
1355
1474
|
}), shouldShowPagination && jsx(PageNavigator, {
|
|
1356
1475
|
onPageChange: pagination.page.onChange,
|
|
1357
1476
|
page: pagination.page.value,
|
|
1358
|
-
totalPages: Math.ceil(
|
|
1477
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1359
1478
|
})]
|
|
1360
1479
|
});
|
|
1361
1480
|
};
|
|
1362
|
-
|
|
1481
|
+
const RowLevelErrorTable = _ref2 => {
|
|
1482
|
+
let rows = _ref2.rows;
|
|
1483
|
+
const pagination = usePaginationState({
|
|
1484
|
+
perPage: 10
|
|
1485
|
+
});
|
|
1486
|
+
const startIndex = (pagination.page.value - 1) * pagination.perPage.value;
|
|
1487
|
+
const endIndex = startIndex + pagination.perPage.value;
|
|
1488
|
+
const currentPageRows = _sliceInstanceProperty(rows).call(rows, startIndex, endIndex);
|
|
1489
|
+
const shouldShowPagination = rows.length > pagination.perPage.value;
|
|
1490
|
+
return jsxs(Spacings.Stack, {
|
|
1491
|
+
scale: "l",
|
|
1492
|
+
children: [jsx(DataTable, {
|
|
1493
|
+
verticalCellAlignment: "center",
|
|
1494
|
+
isCondensed: true,
|
|
1495
|
+
rows: currentPageRows,
|
|
1496
|
+
columns: rowLevelColumns,
|
|
1497
|
+
itemRenderer: rowLevelItemRenderer
|
|
1498
|
+
}), shouldShowPagination && jsx(PageNavigator, {
|
|
1499
|
+
onPageChange: pagination.page.onChange,
|
|
1500
|
+
page: pagination.page.value,
|
|
1501
|
+
totalPages: Math.ceil(rows.length / pagination.perPage.value)
|
|
1502
|
+
})]
|
|
1503
|
+
});
|
|
1504
|
+
};
|
|
1505
|
+
const UploadErrorTable = props => {
|
|
1506
|
+
if (props.variant === 'row-level') {
|
|
1507
|
+
return jsx(RowLevelErrorTable, {
|
|
1508
|
+
rows: props.rows
|
|
1509
|
+
});
|
|
1510
|
+
}
|
|
1511
|
+
return jsx(FileLevelErrorTable, {
|
|
1512
|
+
rows: props.rows
|
|
1513
|
+
});
|
|
1514
|
+
};
|
|
1515
|
+
function fileLevelItemRenderer(item, column) {
|
|
1516
|
+
switch (column.key) {
|
|
1517
|
+
case 'errorType':
|
|
1518
|
+
return jsx(Stamp, {
|
|
1519
|
+
isCondensed: true,
|
|
1520
|
+
label: item.title,
|
|
1521
|
+
tone: "critical"
|
|
1522
|
+
});
|
|
1523
|
+
case 'details':
|
|
1524
|
+
return jsx(Text.Body, {
|
|
1525
|
+
children: item.description
|
|
1526
|
+
});
|
|
1527
|
+
default:
|
|
1528
|
+
throw new UnexpectedColumnError(column.key);
|
|
1529
|
+
}
|
|
1530
|
+
}
|
|
1531
|
+
function rowLevelItemRenderer(item, column) {
|
|
1363
1532
|
switch (column.key) {
|
|
1364
1533
|
case 'row':
|
|
1365
1534
|
return item.row;
|
|
@@ -1386,19 +1555,23 @@ function itemRenderer(item, column) {
|
|
|
1386
1555
|
|
|
1387
1556
|
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
1557
|
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
|
|
1558
|
+
const UploadErrorsModal = () => {
|
|
1390
1559
|
const intl = useIntl();
|
|
1391
1560
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1392
1561
|
state = _useImportResourcesCo.state,
|
|
1393
1562
|
actions = _useImportResourcesCo.actions,
|
|
1394
1563
|
onClose = _useImportResourcesCo.onClose;
|
|
1395
|
-
const
|
|
1564
|
+
const isNewFlow = Boolean(state.jobId);
|
|
1565
|
+
const hasInvalidRecords = (state.uploadFileResponse?.invalid ?? 0) > 0;
|
|
1566
|
+
const isRowLevelErrors = hasInvalidRecords && (state.uploadFileResponse?.results?.length ?? 0) > 0;
|
|
1567
|
+
const isFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
1568
|
+
const errorsCount = isNewFlow ? state.uploadFileResponse?.invalid ?? 0 : isRowLevelErrors ? getFileUploadErrorsCount(state.uploadFileResponse?.results) : state.fileUploadErrors.length;
|
|
1396
1569
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
1397
1570
|
return jsx(InfoDialog, {
|
|
1398
1571
|
size: 16,
|
|
1399
1572
|
isOpen: true,
|
|
1400
1573
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1401
|
-
onClose: onClose,
|
|
1574
|
+
onClose: () => onClose(),
|
|
1402
1575
|
children: jsx(Masking.Unmask, {
|
|
1403
1576
|
children: jsxs(Spacings.Stack, {
|
|
1404
1577
|
scale: "l",
|
|
@@ -1406,7 +1579,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1406
1579
|
scale: "xs",
|
|
1407
1580
|
children: [jsx(Masking.Mask, {
|
|
1408
1581
|
children: jsx(Text.Body, {
|
|
1409
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1582
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.uploadErrorDescription), {}, {
|
|
1410
1583
|
values: {
|
|
1411
1584
|
fileName: state.droppedFile?.name,
|
|
1412
1585
|
errorsCount: intl.formatNumber(errorsCount),
|
|
@@ -1414,8 +1587,8 @@ const UploadRowErrorsModal = () => {
|
|
|
1414
1587
|
}
|
|
1415
1588
|
})
|
|
1416
1589
|
})
|
|
1417
|
-
}), jsx(Text.Body, {
|
|
1418
|
-
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$
|
|
1590
|
+
}), hasInvalidRecords && jsx(Text.Body, {
|
|
1591
|
+
intlMessage: _objectSpread$5(_objectSpread$5({}, messages$4.supportedValuesDocumentation), {}, {
|
|
1419
1592
|
values: {
|
|
1420
1593
|
documentationLink: msg => jsx(Link, {
|
|
1421
1594
|
tone: "secondary",
|
|
@@ -1426,8 +1599,16 @@ const UploadRowErrorsModal = () => {
|
|
|
1426
1599
|
}
|
|
1427
1600
|
})
|
|
1428
1601
|
})]
|
|
1429
|
-
}), jsx(
|
|
1602
|
+
}), isNewFlow && hasInvalidRecords && state.containerKey && jsx(ServerPaginatedErrorTable, {
|
|
1603
|
+
jobId: state.jobId,
|
|
1604
|
+
containerKey: state.containerKey,
|
|
1605
|
+
totalInvalid: state.uploadFileResponse?.invalid ?? 0
|
|
1606
|
+
}), !isNewFlow && isRowLevelErrors && jsx(UploadErrorTable, {
|
|
1607
|
+
variant: "row-level",
|
|
1430
1608
|
rows: mapUploadFileErrorsResponseToUploadFileErrorRows(state.uploadFileResponse?.results)
|
|
1609
|
+
}), isFileLevelErrors && jsx(UploadErrorTable, {
|
|
1610
|
+
variant: "file-level",
|
|
1611
|
+
rows: mapFileUploadErrorsToUploadFileErrorRows(state.fileUploadErrors)
|
|
1431
1612
|
}), jsxs(Spacings.Inline, {
|
|
1432
1613
|
scale: "m",
|
|
1433
1614
|
justifyContent: "flex-end",
|
|
@@ -1436,7 +1617,7 @@ const UploadRowErrorsModal = () => {
|
|
|
1436
1617
|
onClick: () => onClose()
|
|
1437
1618
|
}), jsx(PrimaryButton, {
|
|
1438
1619
|
iconLeft: jsx(ImportIcon, {}),
|
|
1439
|
-
label: intl.formatMessage(messages$
|
|
1620
|
+
label: intl.formatMessage(messages$4.uploadNewFile),
|
|
1440
1621
|
onClick: () => actions.uploadNewFile()
|
|
1441
1622
|
})]
|
|
1442
1623
|
})]
|
|
@@ -1452,7 +1633,7 @@ function getBold$2(msg) {
|
|
|
1452
1633
|
}, crypto.randomUUID());
|
|
1453
1634
|
}
|
|
1454
1635
|
|
|
1455
|
-
var messages$
|
|
1636
|
+
var messages$3 = defineMessages({
|
|
1456
1637
|
startImportButton: {
|
|
1457
1638
|
id: 'ImportResourcesModal.startImportButton',
|
|
1458
1639
|
description: 'Label for the modal Start import button',
|
|
@@ -1569,7 +1750,7 @@ const ColumnList = props => {
|
|
|
1569
1750
|
e.preventDefault();
|
|
1570
1751
|
setIsExpanded(!isExpanded);
|
|
1571
1752
|
},
|
|
1572
|
-
children: isExpanded ? jsx(FormattedMessage, _objectSpread$4({}, messages$
|
|
1753
|
+
children: isExpanded ? jsx(FormattedMessage, _objectSpread$4({}, messages$3.showLess)) : jsx(FormattedMessage, _objectSpread$4({}, messages$3.showMore))
|
|
1573
1754
|
})
|
|
1574
1755
|
})]
|
|
1575
1756
|
});
|
|
@@ -1589,13 +1770,13 @@ function UploadPreviewModal() {
|
|
|
1589
1770
|
const resourceType = intl.formatMessage(resourceTypeMessage).toLowerCase();
|
|
1590
1771
|
const resourceTypePluralMessage = resourceTypeToPluralMessage(state.resourceType);
|
|
1591
1772
|
const resourceTypePlural = intl.formatMessage(resourceTypePluralMessage).toLowerCase();
|
|
1592
|
-
const
|
|
1593
|
-
const
|
|
1773
|
+
const ignoredFields = state.uploadFileResponse.ignoredFields;
|
|
1774
|
+
const validatedFields = getValidatedColumns(state.uploadFileResponse.fields, ignoredFields);
|
|
1594
1775
|
return jsx(FormDialog, {
|
|
1595
1776
|
size: 16,
|
|
1596
1777
|
isOpen: true,
|
|
1597
1778
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1598
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1779
|
+
labelPrimary: intl.formatMessage(messages$3.continue),
|
|
1599
1780
|
onSecondaryButtonClick: () => onClose({
|
|
1600
1781
|
shouldDeleteImportContainer: true
|
|
1601
1782
|
}),
|
|
@@ -1614,7 +1795,7 @@ function UploadPreviewModal() {
|
|
|
1614
1795
|
children: jsxs(Spacings.Stack, {
|
|
1615
1796
|
scale: "m",
|
|
1616
1797
|
children: [jsx("div", {}), jsx(Text.Body, {
|
|
1617
|
-
intlMessage: messages$
|
|
1798
|
+
intlMessage: messages$3.previewOfYourImport
|
|
1618
1799
|
}), jsx(Card, {
|
|
1619
1800
|
insetScale: "xl",
|
|
1620
1801
|
children: jsxs(Spacings.Stack, {
|
|
@@ -1626,7 +1807,7 @@ function UploadPreviewModal() {
|
|
|
1626
1807
|
children: [jsx(CheckBoldIcon, {
|
|
1627
1808
|
color: "success"
|
|
1628
1809
|
}), jsx(Text.Body, {
|
|
1629
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1810
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.itemsToBeImported), {}, {
|
|
1630
1811
|
values: {
|
|
1631
1812
|
resourceType,
|
|
1632
1813
|
resourceTypePlural,
|
|
@@ -1641,19 +1822,19 @@ function UploadPreviewModal() {
|
|
|
1641
1822
|
children: [jsx(CheckBoldIcon, {
|
|
1642
1823
|
color: "success"
|
|
1643
1824
|
}), jsx(Text.Body, {
|
|
1644
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1825
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeImported), {}, {
|
|
1645
1826
|
values: {
|
|
1646
|
-
columnCount: intl.formatNumber(
|
|
1827
|
+
columnCount: intl.formatNumber(validatedFields.length),
|
|
1647
1828
|
b: getBold$1
|
|
1648
1829
|
}
|
|
1649
1830
|
})
|
|
1650
1831
|
})]
|
|
1651
1832
|
})]
|
|
1652
1833
|
}), jsx(ColumnList, {
|
|
1653
|
-
columns:
|
|
1834
|
+
columns: validatedFields
|
|
1654
1835
|
})]
|
|
1655
1836
|
})
|
|
1656
|
-
}),
|
|
1837
|
+
}), ignoredFields.length > 0 && jsx(Card, {
|
|
1657
1838
|
insetScale: "xl",
|
|
1658
1839
|
children: jsxs(Spacings.Stack, {
|
|
1659
1840
|
scale: "s",
|
|
@@ -1662,15 +1843,15 @@ function UploadPreviewModal() {
|
|
|
1662
1843
|
children: [jsx(EyeCrossedIcon, {
|
|
1663
1844
|
color: "neutral60"
|
|
1664
1845
|
}), jsx(Text.Body, {
|
|
1665
|
-
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$
|
|
1846
|
+
intlMessage: _objectSpread$3(_objectSpread$3({}, messages$3.columnsToBeIgnored), {}, {
|
|
1666
1847
|
values: {
|
|
1667
|
-
columnCount: intl.formatNumber(
|
|
1848
|
+
columnCount: intl.formatNumber(ignoredFields.length),
|
|
1668
1849
|
b: getBold$1
|
|
1669
1850
|
}
|
|
1670
1851
|
})
|
|
1671
1852
|
})]
|
|
1672
1853
|
}), jsx(ColumnList, {
|
|
1673
|
-
columns:
|
|
1854
|
+
columns: ignoredFields
|
|
1674
1855
|
})]
|
|
1675
1856
|
})
|
|
1676
1857
|
})]
|
|
@@ -1702,13 +1883,13 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
1702
1883
|
styles: "width:360px"
|
|
1703
1884
|
} : {
|
|
1704
1885
|
name: "g36yzl-ImportRunningTextNotification",
|
|
1705
|
-
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1886
|
+
styles: "width:360px;label:ImportRunningTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTBCWSIsImZpbGUiOiJpbXBvcnQtY29uZmlybWF0aW9uLW1vZGFsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHVzZUludGwgfSBmcm9tICdyZWFjdC1pbnRsJ1xuaW1wb3J0IHsgdXNlU2hvd05vdGlmaWNhdGlvbiB9IGZyb20gJ0Bjb21tZXJjZXRvb2xzLWZyb250ZW5kL2FjdGlvbnMtZ2xvYmFsJ1xuaW1wb3J0IHsgQ29uZmlybWF0aW9uRGlhbG9nIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtZnJvbnRlbmQvYXBwbGljYXRpb24tY29tcG9uZW50c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ZmlybWF0aW9uLWRpYWxvZy1jb25maXJtJyxcbiAgICAgIH19XG4gICAgICBkYXRhQXR0cmlidXRlc1NlY29uZGFyeUJ1dHRvbj17e1xuICAgICAgICAnZGF0YS10ZXN0LWlkJzogJ2NvbmZpcm1hdGlvbi1kaWFsb2ctY2FuY2VsJyxcbiAgICAgICAgJ2RhdGEtdHJhY2tpbmctdGFyZ2V0JzogYCR7c3RhdGUucmVzb3VyY2VUeXBlfV9pbXBvcnQtc3RhcnRfaW1wb3J0X2J1dHRvbmAsXG4gICAgICB9fVxuICAgICAgb25Db25maXJtPXthc3luYyAoKSA9PiB7XG4gICAgICAgIHRyeSB7XG4gICAgICAgICAgY29uc3QgY2FuQ29uZmlybSA9XG4gICAgICAgICAgICBwcm9qZWN0S2V5ICYmXG4gICAgICAgICAgICBzdGF0ZS5jb250YWluZXJLZXkgJiZcbiAgICAgICAgICAgIHN0YXRlLmRyb3BwZWRGaWxlPy5uYW1lICYmXG4gICAgICAgICAgICBzdGF0ZS5yZXNvdXJjZVR5cGVcbiAgICAgICAgICBpZiAoIWNhbkNvbmZpcm0pIHJldHVyblxuICAgICAgICAgIG9uQ2xvc2UoKVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGtpbmQ6ICdpbmZvJyxcbiAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1706
1887
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1707
1888
|
};
|
|
1708
1889
|
const ImportRunningTextNotification = props => jsx("div", {
|
|
1709
1890
|
css: _ref2,
|
|
1710
1891
|
children: jsx(Text.Body, {
|
|
1711
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1892
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationSuccessMessage), {}, {
|
|
1712
1893
|
values: {
|
|
1713
1894
|
newline: getNewLine,
|
|
1714
1895
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1722,13 +1903,13 @@ var _ref = process.env.NODE_ENV === "production" ? {
|
|
|
1722
1903
|
styles: "width:360px"
|
|
1723
1904
|
} : {
|
|
1724
1905
|
name: "mjwslu-ImportPreparingTextNotification",
|
|
1725
|
-
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
1906
|
+
styles: "width:360px;label:ImportPreparingTextNotification;/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImltcG9ydC1jb25maXJtYXRpb24tbW9kYWwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiO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biAgICAgICAgICAgICAgZG9tYWluOiBET01BSU5TLlNJREUsXG4gICAgICAgICAgICAgIC8vIEB0cy1pZ25vcmVcbiAgICAgICAgICAgICAgdGV4dDogPEltcG9ydFByZXBhcmluZ1RleHROb3RpZmljYXRpb24gcHJvamVjdEtleT17cHJvamVjdEtleX0gLz4sXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBkaXNtaXNzQWZ0ZXI6IDUwMDAsXG4gICAgICAgICAgICB9XG4gICAgICAgICAgKVxuICAgICAgICAgIGNvbnN0IGlzSm9iQmFzZWRGbG93ID0gISFzdGF0ZS5qb2JJZFxuICAgICAgICAgIGlmIChpc0pvYkJhc2VkRmxvdykge1xuICAgICAgICAgICAgYXdhaXQgcHJvY2Vzc0ZpbGVJbXBvcnRKb2Ioe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICByZXNvdXJjZVR5cGU6IHN0YXRlLnJlc291cmNlVHlwZSEsXG4gICAgICAgICAgICAgIGltcG9ydENvbnRhaW5lcktleTogc3RhdGUuY29udGFpbmVyS2V5ISxcbiAgICAgICAgICAgICAgam9iSWQ6IHN0YXRlLmpvYklkISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGF3YWl0IHByb2Nlc3NVcGxvYWRlZEZpbGUoe1xuICAgICAgICAgICAgICBwcm9qZWN0S2V5LFxuICAgICAgICAgICAgICBpbXBvcnRDb250YWluZXJLZXk6IHN0YXRlLmNvbnRhaW5lcktleSEsXG4gICAgICAgICAgICAgIHJlc291cmNlVHlwZTogc3RhdGUucmVzb3VyY2VUeXBlISxcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgfVxuICAgICAgICAgIG9uU3RhcnRJbXBvcnRTdWNjZXNzKClcbiAgICAgICAgICBzaG93Tm90aWZpY2F0aW9uKFxuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBraW5kOiAnaW5mbycsXG4gICAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5TSURFLFxuICAgICAgICAgICAgICAvLyBAdHMtaWdub3JlXG4gICAgICAgICAgICAgIHRleHQ6IDxJbXBvcnRSdW5uaW5nVGV4dE5vdGlmaWNhdGlvbiBwcm9qZWN0S2V5PXtwcm9qZWN0S2V5fSAvPixcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICB7XG4gICAgICAgICAgICAgIGRpc21pc3NBZnRlcjogNTAwMCxcbiAgICAgICAgICAgIH1cbiAgICAgICAgICApXG4gICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgb25DbG9zZSh7IHNob3VsZERlbGV0ZUltcG9ydENvbnRhaW5lcjogdHJ1ZSB9KVxuICAgICAgICAgIHNob3dOb3RpZmljYXRpb24oe1xuICAgICAgICAgICAga2luZDogJ2Vycm9yJyxcbiAgICAgICAgICAgIGRvbWFpbjogRE9NQUlOUy5QQUdFLFxuICAgICAgICAgICAgdGV4dDogaXNFcnJvcihlcnJvcikgPyBlcnJvci50b1N0cmluZygpIDogU3RyaW5nKGVycm9yKSxcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9fVxuICAgICAgc2l6ZT17MTZ9XG4gICAgPlxuICAgICAgPEZ1bGxTdG9yeU1hc2tpbmcuVW5tYXNrPlxuICAgICAgICA8U3BhY2luZ3MuU3RhY2sgc2NhbGU9XCJ4bFwiPlxuICAgICAgICAgIDxkaXY+XG4gICAgICAgICAgICA8VGV4dC5Cb2R5XG4gICAgICAgICAgICAgIGludGxNZXNzYWdlPXt7XG4gICAgICAgICAgICAgICAgLi4ubWVzc2FnZXMuY29uZmlybWF0aW9uQm9keVRleHQsXG4gICAgICAgICAgICAgICAgdmFsdWVzOiB7XG4gICAgICAgICAgICAgICAgICBwcm9qZWN0TmFtZTogcHJvamVjdE5hbWUsXG4gICAgICAgICAgICAgICAgICBjb3VudDogaW50bC5mb3JtYXROdW1iZXIoXG4gICAgICAgICAgICAgICAgICAgIHN0YXRlPy51cGxvYWRGaWxlUmVzcG9uc2U/LnJvd3NDb3VudCB8fCAwXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgYm9sZDogZ2V0Qm9sZCxcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlOb3RlfSAvPlxuICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgIDxUZXh0LkJvZHkgaW50bE1lc3NhZ2U9e21lc3NhZ2VzLmNvbmZpcm1hdGlvbkJvZHlRdWVzdGlvbn0gLz5cbiAgICAgICAgPC9TcGFjaW5ncy5TdGFjaz5cbiAgICAgIDwvRnVsbFN0b3J5TWFza2luZy5Vbm1hc2s+XG4gICAgPC9Db25maXJtYXRpb25EaWFsb2c+XG4gIClcbn1cblxuZnVuY3Rpb24gZ2V0Qm9sZChtc2cpIHtcbiAgcmV0dXJuIChcbiAgICA8VGV4dC5Cb2R5IGFzPVwic3BhblwiIGlzQm9sZCBrZXk9e2NyeXB0by5yYW5kb21VVUlEKCl9PlxuICAgICAge21zZ31cbiAgICA8L1RleHQuQm9keT5cbiAgKVxufVxuIl19 */",
|
|
1726
1907
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
1727
1908
|
};
|
|
1728
1909
|
const ImportPreparingTextNotification = props => jsx("div", {
|
|
1729
1910
|
css: _ref,
|
|
1730
1911
|
children: jsx(Text.Body, {
|
|
1731
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
1912
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.importNotificationPrepareMessage), {}, {
|
|
1732
1913
|
values: {
|
|
1733
1914
|
newline: getNewLine,
|
|
1734
1915
|
logsLink: msg => getImportLogsLink(msg, props.projectKey),
|
|
@@ -1752,7 +1933,7 @@ const ImportConfirmationModal = () => {
|
|
|
1752
1933
|
const showNotification = useShowNotification();
|
|
1753
1934
|
return jsx(ConfirmationDialog, {
|
|
1754
1935
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
1755
|
-
labelPrimary: intl.formatMessage(messages$
|
|
1936
|
+
labelPrimary: intl.formatMessage(messages$3.startImportButton),
|
|
1756
1937
|
isOpen: true,
|
|
1757
1938
|
onClose: () => onClose({
|
|
1758
1939
|
shouldDeleteImportContainer: true
|
|
@@ -1782,11 +1963,21 @@ const ImportConfirmationModal = () => {
|
|
|
1782
1963
|
}, {
|
|
1783
1964
|
dismissAfter: 5000
|
|
1784
1965
|
});
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1966
|
+
const isJobBasedFlow = !!state.jobId;
|
|
1967
|
+
if (isJobBasedFlow) {
|
|
1968
|
+
await processFileImportJob({
|
|
1969
|
+
projectKey,
|
|
1970
|
+
resourceType: state.resourceType,
|
|
1971
|
+
importContainerKey: state.containerKey,
|
|
1972
|
+
jobId: state.jobId
|
|
1973
|
+
});
|
|
1974
|
+
} else {
|
|
1975
|
+
await processUploadedFile({
|
|
1976
|
+
projectKey,
|
|
1977
|
+
importContainerKey: state.containerKey,
|
|
1978
|
+
resourceType: state.resourceType
|
|
1979
|
+
});
|
|
1980
|
+
}
|
|
1790
1981
|
onStartImportSuccess();
|
|
1791
1982
|
showNotification({
|
|
1792
1983
|
kind: 'info',
|
|
@@ -1815,7 +2006,7 @@ const ImportConfirmationModal = () => {
|
|
|
1815
2006
|
scale: "xl",
|
|
1816
2007
|
children: [jsxs("div", {
|
|
1817
2008
|
children: [jsx(Text.Body, {
|
|
1818
|
-
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$
|
|
2009
|
+
intlMessage: _objectSpread$2(_objectSpread$2({}, messages$3.confirmationBodyText), {}, {
|
|
1819
2010
|
values: {
|
|
1820
2011
|
projectName: projectName,
|
|
1821
2012
|
count: intl.formatNumber(state?.uploadFileResponse?.rowsCount || 0),
|
|
@@ -1823,10 +2014,10 @@ const ImportConfirmationModal = () => {
|
|
|
1823
2014
|
}
|
|
1824
2015
|
})
|
|
1825
2016
|
}), jsx(Text.Body, {
|
|
1826
|
-
intlMessage: messages$
|
|
2017
|
+
intlMessage: messages$3.confirmationBodyNote
|
|
1827
2018
|
})]
|
|
1828
2019
|
}), jsx(Text.Body, {
|
|
1829
|
-
intlMessage: messages$
|
|
2020
|
+
intlMessage: messages$3.confirmationBodyQuestion
|
|
1830
2021
|
})]
|
|
1831
2022
|
})
|
|
1832
2023
|
})
|
|
@@ -1843,11 +2034,21 @@ function getBold(msg) {
|
|
|
1843
2034
|
const UploadResult = () => {
|
|
1844
2035
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1845
2036
|
state = _useImportResourcesCo.state;
|
|
1846
|
-
|
|
1847
|
-
|
|
2037
|
+
const hasFileLevelErrors = state.fileUploadErrors.length > 0;
|
|
2038
|
+
const hasRowLevelErrors = (state.uploadFileResponse?.invalid ?? 0) > 0;
|
|
2039
|
+
if (hasFileLevelErrors || hasRowLevelErrors) {
|
|
2040
|
+
return jsx(UploadErrorsModal, {});
|
|
2041
|
+
}
|
|
1848
2042
|
return jsx(UploadPreviewModal, {});
|
|
1849
2043
|
};
|
|
1850
2044
|
|
|
2045
|
+
var messages$2 = defineMessages({
|
|
2046
|
+
validatingResources: {
|
|
2047
|
+
id: 'ImportResourcesModal.Uploading.validatingResources',
|
|
2048
|
+
defaultMessage: 'Validating {processed} / {total} {resourceType}'
|
|
2049
|
+
}
|
|
2050
|
+
});
|
|
2051
|
+
|
|
1851
2052
|
const Uploading = () => {
|
|
1852
2053
|
const intl = useIntl();
|
|
1853
2054
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
@@ -1855,6 +2056,12 @@ const Uploading = () => {
|
|
|
1855
2056
|
actions = _useImportResourcesCo.actions,
|
|
1856
2057
|
onClose = _useImportResourcesCo.onClose;
|
|
1857
2058
|
if (!state.droppedFile?.name) return null;
|
|
2059
|
+
const showValidationProgress = state.isValidating && state.validationProcessed && state.validationProcessed > 0 && state.totalResourceCount && state.resourceType;
|
|
2060
|
+
const statusMessage = showValidationProgress ? intl.formatMessage(messages$2.validatingResources, {
|
|
2061
|
+
processed: intl.formatNumber(state.validationProcessed),
|
|
2062
|
+
total: intl.formatNumber(state.totalResourceCount),
|
|
2063
|
+
resourceType: intl.formatMessage(resourceTypeToPluralMessage(state.resourceType))
|
|
2064
|
+
}) : undefined;
|
|
1858
2065
|
return jsx(UploadingModal, {
|
|
1859
2066
|
isOpen: true,
|
|
1860
2067
|
title: intl.formatMessage(sharedMessages[`modalTitle.${state.resourceType}`]),
|
|
@@ -1868,7 +2075,8 @@ const Uploading = () => {
|
|
|
1868
2075
|
},
|
|
1869
2076
|
onClose: () => onClose({
|
|
1870
2077
|
shouldDeleteImportContainer: true
|
|
1871
|
-
})
|
|
2078
|
+
}),
|
|
2079
|
+
statusMessage: statusMessage
|
|
1872
2080
|
});
|
|
1873
2081
|
};
|
|
1874
2082
|
|
|
@@ -1911,7 +2119,7 @@ const resourceTypeToDisplayName = resourceType => {
|
|
|
1911
2119
|
case IMPORTABLE_RESOURCES.CATEGORY:
|
|
1912
2120
|
return messages$1.categories;
|
|
1913
2121
|
default:
|
|
1914
|
-
throw new
|
|
2122
|
+
throw new UnexpectedResourceTypeError$1(resourceType);
|
|
1915
2123
|
}
|
|
1916
2124
|
};
|
|
1917
2125
|
const ResourceTypeSelection = () => {
|
|
@@ -1951,13 +2159,16 @@ const Instructions = () => {
|
|
|
1951
2159
|
const intl = useIntl();
|
|
1952
2160
|
const _useImportResourcesCo = useImportResourcesContext(),
|
|
1953
2161
|
state = _useImportResourcesCo.state;
|
|
2162
|
+
const isFileImportJobFlowEnabled = useFeatureToggle(FILE_IMPORT_JOB_FLOW);
|
|
1954
2163
|
const templateLink = RESOURCE_TYPE_TEMPLATE_DOWNLOAD_LINKS[state.resourceType];
|
|
1955
2164
|
const documentationLink = RESOURCE_TYPE_DOCUMENTATION_LINKS[state.resourceType];
|
|
2165
|
+
const maxFileSize = isFileImportJobFlowEnabled ? IMPORT_MAX_FILE_SIZE_MB : IMPORT_LEGACY_MAX_FILE_SIZE_MB;
|
|
2166
|
+
const maxItemCount = isFileImportJobFlowEnabled ? IMPORT_MAX_ITEM_COUNT : IMPORT_LEGACY_MAX_ROW_COUNT;
|
|
1956
2167
|
return jsx(Text.Body, {
|
|
1957
2168
|
intlMessage: _objectSpread$1(_objectSpread$1({}, messages.fileUploadInstructions), {}, {
|
|
1958
2169
|
values: {
|
|
1959
|
-
fileSize: intl.formatNumber(
|
|
1960
|
-
rowLimit: intl.formatNumber(
|
|
2170
|
+
fileSize: intl.formatNumber(maxFileSize),
|
|
2171
|
+
rowLimit: intl.formatNumber(maxItemCount),
|
|
1961
2172
|
csvTemplateLink: msg => jsx(Link, {
|
|
1962
2173
|
tone: "secondary",
|
|
1963
2174
|
isExternal: true,
|