@commercetools-frontend-extensions/export-resources-modal 3.4.2 → 3.4.3-next.1
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.
|
@@ -12,12 +12,13 @@ var _Object$defineProperties = require('@babel/runtime-corejs3/core-js-stable/ob
|
|
|
12
12
|
var _Object$defineProperty = require('@babel/runtime-corejs3/core-js-stable/object/define-property');
|
|
13
13
|
var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
14
14
|
var React = require('react');
|
|
15
|
+
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
16
|
+
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
17
|
+
require('@commercetools-uikit/design-system');
|
|
15
18
|
var reactIntl = require('react-intl');
|
|
19
|
+
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
16
20
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
17
|
-
var
|
|
18
|
-
var _flatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/flat');
|
|
19
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
20
|
-
var gqlQueryBuilder = require('gql-query-builder');
|
|
21
|
+
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
21
22
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
22
23
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
23
24
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
@@ -26,22 +27,21 @@ var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibl
|
|
|
26
27
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
27
28
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
28
29
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
30
|
+
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
31
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
32
|
+
var moment = require('moment');
|
|
33
|
+
var _flatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/flat');
|
|
34
|
+
var gqlQueryBuilder = require('gql-query-builder');
|
|
29
35
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
30
36
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
31
37
|
var _Object$assign = require('@babel/runtime-corejs3/core-js-stable/object/assign');
|
|
32
38
|
var _flatMapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/flat-map');
|
|
33
39
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
34
|
-
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
35
|
-
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
36
|
-
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
37
40
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
38
41
|
var omitEmpty = require('omit-empty-es');
|
|
39
42
|
var _findIndexInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find-index');
|
|
40
43
|
var _spliceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/splice');
|
|
41
44
|
var _startsWithInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/starts-with');
|
|
42
|
-
require('@commercetools-uikit/design-system');
|
|
43
|
-
var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
|
|
44
|
-
var moment = require('moment');
|
|
45
45
|
var sdk = require('@commercetools-frontend/sdk');
|
|
46
46
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
47
47
|
var constants = require('@commercetools-frontend/constants');
|
|
@@ -63,27 +63,199 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
63
63
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
64
64
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
65
65
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
66
|
+
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
67
|
+
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
66
68
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
67
|
-
var _flatInstanceProperty__default = /*#__PURE__*/_interopDefault(_flatInstanceProperty);
|
|
68
69
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
69
|
-
var
|
|
70
|
+
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
71
|
+
var _flatInstanceProperty__default = /*#__PURE__*/_interopDefault(_flatInstanceProperty);
|
|
70
72
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
71
73
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
72
74
|
var _Object$assign__default = /*#__PURE__*/_interopDefault(_Object$assign);
|
|
73
75
|
var _flatMapInstanceProperty__default = /*#__PURE__*/_interopDefault(_flatMapInstanceProperty);
|
|
74
76
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
75
|
-
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
76
77
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
77
78
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
78
79
|
var _findIndexInstanceProperty__default = /*#__PURE__*/_interopDefault(_findIndexInstanceProperty);
|
|
79
80
|
var _spliceInstanceProperty__default = /*#__PURE__*/_interopDefault(_spliceInstanceProperty);
|
|
80
81
|
var _startsWithInstanceProperty__default = /*#__PURE__*/_interopDefault(_startsWithInstanceProperty);
|
|
81
|
-
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
82
82
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
83
83
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
84
84
|
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
85
85
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
86
86
|
|
|
87
|
+
function getBold(msg) {
|
|
88
|
+
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
89
|
+
as: "span",
|
|
90
|
+
isBold: true,
|
|
91
|
+
children: msg
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function getNewLine() {
|
|
96
|
+
return jsxRuntime.jsx("br", {});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var messages = reactIntl.defineMessages({
|
|
100
|
+
modalTitle: {
|
|
101
|
+
id: 'ExportResourcesModal.modalTitle',
|
|
102
|
+
description: 'Label for the modal title',
|
|
103
|
+
defaultMessage: 'Export {resourceType}'
|
|
104
|
+
},
|
|
105
|
+
outputFormat: {
|
|
106
|
+
id: 'ExportResourcesModal.outputFormat',
|
|
107
|
+
description: 'File format like (csv, xls, ...etc)',
|
|
108
|
+
defaultMessage: 'File format'
|
|
109
|
+
},
|
|
110
|
+
fileName: {
|
|
111
|
+
id: 'ExportResourcesModal.fileName',
|
|
112
|
+
description: 'exported file name',
|
|
113
|
+
defaultMessage: 'File name'
|
|
114
|
+
},
|
|
115
|
+
locale: {
|
|
116
|
+
id: 'ExportResourcesModal.locale',
|
|
117
|
+
description: 'Locale',
|
|
118
|
+
defaultMessage: 'Locale'
|
|
119
|
+
},
|
|
120
|
+
exportSelection: {
|
|
121
|
+
id: 'ExportResourcesModal.exportSelection',
|
|
122
|
+
description: 'Export selection',
|
|
123
|
+
defaultMessage: 'Export selection'
|
|
124
|
+
},
|
|
125
|
+
exportAllResources: {
|
|
126
|
+
id: 'ExportResourcesModal.exportAllResources',
|
|
127
|
+
description: 'Export All selection',
|
|
128
|
+
defaultMessage: 'Export all {resourceType} ({count})'
|
|
129
|
+
},
|
|
130
|
+
exportOnlySelectedResources: {
|
|
131
|
+
id: 'ExportResourcesModal.exportOnlySelectedResources',
|
|
132
|
+
description: 'Export only selected resources',
|
|
133
|
+
defaultMessage: 'Export selected {resourceType} ({count})'
|
|
134
|
+
},
|
|
135
|
+
exportAllMessage: {
|
|
136
|
+
id: 'ExportResourcesModal.exportAllMessage',
|
|
137
|
+
description: 'All resources will be exported',
|
|
138
|
+
defaultMessage: 'All <b>{count}</b> {resourceType} will be exported.'
|
|
139
|
+
},
|
|
140
|
+
exportMatchingMessage: {
|
|
141
|
+
id: 'ExportResourcesModal.exportMatchingMessage',
|
|
142
|
+
description: 'resources will be exported',
|
|
143
|
+
defaultMessage: '<b>{count}</b> {resourceType} will be exported.'
|
|
144
|
+
},
|
|
145
|
+
exportSelectedMessage: {
|
|
146
|
+
id: 'ExportResourcesModal.exportSelectedMessage',
|
|
147
|
+
description: 'resources are selected and will be exported',
|
|
148
|
+
defaultMessage: '<b>{count}</b> {resourceType} are selected and will be exported.'
|
|
149
|
+
},
|
|
150
|
+
exportBasedOnMyViewsMessage: {
|
|
151
|
+
id: 'ExportResourcesModal.exportBasedOnMyViewsMessage',
|
|
152
|
+
description: 'Select Export setttings based on my views',
|
|
153
|
+
defaultMessage: 'Select export settings based on:'
|
|
154
|
+
},
|
|
155
|
+
propertiesPanelLabel: {
|
|
156
|
+
id: 'ExportResourcesModal.propertiesPanelLabel',
|
|
157
|
+
description: 'properties panel label',
|
|
158
|
+
defaultMessage: 'Properties'
|
|
159
|
+
},
|
|
160
|
+
exportOperationSuccessMessage: {
|
|
161
|
+
id: 'ExportResourcesModal.exportOperationSuccessMessage',
|
|
162
|
+
description: 'Success message',
|
|
163
|
+
defaultMessage: '<b>Your export has started.</b> <newline></newline><logsLink>Go to Export logs</logsLink> to view the progress and download the file.'
|
|
164
|
+
},
|
|
165
|
+
nothingApplied: {
|
|
166
|
+
id: 'ExportResourcesModal.nothingApplied',
|
|
167
|
+
description: 'Shown when there is no filter applied',
|
|
168
|
+
defaultMessage: 'nothing applied'
|
|
169
|
+
},
|
|
170
|
+
selectAllLocales: {
|
|
171
|
+
id: 'ExportResourcesModal.selectAllLocales',
|
|
172
|
+
description: 'label for "Select all locales" checkbox',
|
|
173
|
+
defaultMessage: 'Select all locales'
|
|
174
|
+
},
|
|
175
|
+
missingFileNameError: {
|
|
176
|
+
id: 'ExportResourcesModal.missingFileNameError',
|
|
177
|
+
description: 'Error when file name field is missing',
|
|
178
|
+
defaultMessage: 'Please enter a file name'
|
|
179
|
+
},
|
|
180
|
+
invalidFileNameError: {
|
|
181
|
+
id: 'ExportResourcesModal.invalidFileNameError',
|
|
182
|
+
description: 'Error when file name field is not valid',
|
|
183
|
+
defaultMessage: 'File name may only contain alphanumeric characters, hyphens and underscores'
|
|
184
|
+
},
|
|
185
|
+
missingLocaleError: {
|
|
186
|
+
id: 'ExportResourcesModal.missingLocaleError',
|
|
187
|
+
description: 'Error when no locale is selected',
|
|
188
|
+
defaultMessage: 'Please select at least one locale'
|
|
189
|
+
},
|
|
190
|
+
myViews: {
|
|
191
|
+
id: 'ExportResourcesModal.myViews',
|
|
192
|
+
description: 'Label for "My Views" Select Field',
|
|
193
|
+
defaultMessage: 'My Views'
|
|
194
|
+
},
|
|
195
|
+
selectFieldsToExport: {
|
|
196
|
+
id: 'ExportResourcesModal.selectFieldsToExport',
|
|
197
|
+
defaultMessage: 'Select fields to export'
|
|
198
|
+
},
|
|
199
|
+
back: {
|
|
200
|
+
id: 'ExportResourcesModal.back',
|
|
201
|
+
description: 'Label for "Back" button',
|
|
202
|
+
defaultMessage: 'Back'
|
|
203
|
+
},
|
|
204
|
+
startExport: {
|
|
205
|
+
id: 'ExportResourcesModal.startExport',
|
|
206
|
+
description: 'Label for "Start export" button',
|
|
207
|
+
defaultMessage: 'Start export'
|
|
208
|
+
},
|
|
209
|
+
continue: {
|
|
210
|
+
id: 'ExportResourcesModal.continue',
|
|
211
|
+
description: 'Label for "Continue" button',
|
|
212
|
+
defaultMessage: 'Continue'
|
|
213
|
+
},
|
|
214
|
+
fieldDefinitions: {
|
|
215
|
+
id: 'ExportResourcesModal.fieldDefinitions',
|
|
216
|
+
description: 'Label for "Field definitions" link',
|
|
217
|
+
defaultMessage: 'Field definitions'
|
|
218
|
+
},
|
|
219
|
+
allGeneralFields: {
|
|
220
|
+
id: 'ExportResourcesModal.allGeneralFields',
|
|
221
|
+
description: 'Label for "All general fields" checkbox',
|
|
222
|
+
defaultMessage: 'All general fields'
|
|
223
|
+
},
|
|
224
|
+
allCustomFields: {
|
|
225
|
+
id: 'ExportResourcesModal.allCustomFields',
|
|
226
|
+
description: 'Label for "All custom fields" checkbox',
|
|
227
|
+
defaultMessage: 'All custom fields'
|
|
228
|
+
},
|
|
229
|
+
customTypeKeyAndTypeId: {
|
|
230
|
+
id: 'ExportResourcesModal.customTypeKeyAndTypeId',
|
|
231
|
+
description: 'Label for "Custom type key and typeId" checkbox',
|
|
232
|
+
defaultMessage: 'Custom type key and typeId'
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
function ownKeys$5(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
237
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$5(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$5(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
238
|
+
function renderFileNameError(key) {
|
|
239
|
+
switch (key) {
|
|
240
|
+
case 'missing':
|
|
241
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.missingFileNameError));
|
|
242
|
+
case 'invalidInput':
|
|
243
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.invalidFileNameError));
|
|
244
|
+
default:
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function renderLocaleError(key) {
|
|
249
|
+
switch (key) {
|
|
250
|
+
case 'missing':
|
|
251
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$5({}, messages.missingLocaleError));
|
|
252
|
+
default:
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const Z_INDEX_DROPDOWN = 30000;
|
|
258
|
+
|
|
87
259
|
const EXPORT_OPERATION_STATES = {
|
|
88
260
|
PROCESSING: 'processing',
|
|
89
261
|
COMPLETED: 'completed',
|
|
@@ -178,9 +350,17 @@ let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
|
178
350
|
return _createClass(UnexpectedResourceTypeError);
|
|
179
351
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
180
352
|
|
|
353
|
+
function useExportResourcesContext() {
|
|
354
|
+
const context = React.useContext(ExportResourcesContext);
|
|
355
|
+
if (!context) {
|
|
356
|
+
throw new MissingExportResourceProviderError();
|
|
357
|
+
}
|
|
358
|
+
return context;
|
|
359
|
+
}
|
|
360
|
+
|
|
181
361
|
const _excluded$1 = ["name"];
|
|
182
|
-
function ownKeys$
|
|
183
|
-
function _objectSpread$
|
|
362
|
+
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
363
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context7, _context8; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context7 = ownKeys$4(Object(t), !0)).call(_context7, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context8 = ownKeys$4(Object(t))).call(_context8, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
184
364
|
function resourceTypeToDisplayName(_ref) {
|
|
185
365
|
let resourceType = _ref.resourceType,
|
|
186
366
|
_ref$isUpperCase = _ref.isUpperCase,
|
|
@@ -239,7 +419,7 @@ function flattenNestedFields(fields) {
|
|
|
239
419
|
var _context2;
|
|
240
420
|
return _mapInstanceProperty__default["default"](_context2 = flattenNestedFields(field.fields)).call(_context2, nestedField => {
|
|
241
421
|
var _context3;
|
|
242
|
-
return _objectSpread$
|
|
422
|
+
return _objectSpread$4(_objectSpread$4({}, nestedField), {}, {
|
|
243
423
|
name: _concatInstanceProperty__default["default"](_context3 = "".concat(field.name, ".")).call(_context3, nestedField.name)
|
|
244
424
|
});
|
|
245
425
|
});
|
|
@@ -279,7 +459,7 @@ function getSelectedGeneralFields(fields) {
|
|
|
279
459
|
function getSelectedCustomFields(customFields) {
|
|
280
460
|
return _mapInstanceProperty__default["default"](customFields).call(customFields, customType => {
|
|
281
461
|
var _context4;
|
|
282
|
-
return _objectSpread$
|
|
462
|
+
return _objectSpread$4(_objectSpread$4({}, customType), {}, {
|
|
283
463
|
fields: _filterInstanceProperty__default["default"](_context4 = customType.fields).call(_context4, field => field.isChecked)
|
|
284
464
|
});
|
|
285
465
|
});
|
|
@@ -288,7 +468,7 @@ function flattenCustomFields(customFields) {
|
|
|
288
468
|
return _flatMapInstanceProperty__default["default"](customFields).call(customFields, customType => customType.fields);
|
|
289
469
|
}
|
|
290
470
|
function checkRequiredFields(fields) {
|
|
291
|
-
return _mapInstanceProperty__default["default"](fields).call(fields, field => field.isRequired ? _objectSpread$
|
|
471
|
+
return _mapInstanceProperty__default["default"](fields).call(fields, field => field.isRequired ? _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
292
472
|
isChecked: true
|
|
293
473
|
}) : field);
|
|
294
474
|
}
|
|
@@ -301,8 +481,8 @@ function getExportLogsLink(projectKey, msg) {
|
|
|
301
481
|
function setInitialCheckedStateForCustomFields(customFields) {
|
|
302
482
|
return _mapInstanceProperty__default["default"](customFields).call(customFields, customType => {
|
|
303
483
|
var _context5;
|
|
304
|
-
return _objectSpread$
|
|
305
|
-
fields: _mapInstanceProperty__default["default"](_context5 = customType.fields).call(_context5, field => _objectSpread$
|
|
484
|
+
return _objectSpread$4(_objectSpread$4({}, customType), {}, {
|
|
485
|
+
fields: _mapInstanceProperty__default["default"](_context5 = customType.fields).call(_context5, field => _objectSpread$4(_objectSpread$4({}, field), {}, {
|
|
306
486
|
isChecked: false
|
|
307
487
|
}))
|
|
308
488
|
});
|
|
@@ -479,184 +659,6 @@ const extendColumns = _ref => {
|
|
|
479
659
|
return extensionFunction(columns);
|
|
480
660
|
};
|
|
481
661
|
|
|
482
|
-
var messages = reactIntl.defineMessages({
|
|
483
|
-
modalTitle: {
|
|
484
|
-
id: 'ExportResourcesModal.modalTitle',
|
|
485
|
-
description: 'Label for the modal title',
|
|
486
|
-
defaultMessage: 'Export {resourceType}'
|
|
487
|
-
},
|
|
488
|
-
outputFormat: {
|
|
489
|
-
id: 'ExportResourcesModal.outputFormat',
|
|
490
|
-
description: 'File format like (csv, xls, ...etc)',
|
|
491
|
-
defaultMessage: 'File format'
|
|
492
|
-
},
|
|
493
|
-
fileName: {
|
|
494
|
-
id: 'ExportResourcesModal.fileName',
|
|
495
|
-
description: 'exported file name',
|
|
496
|
-
defaultMessage: 'File name'
|
|
497
|
-
},
|
|
498
|
-
locale: {
|
|
499
|
-
id: 'ExportResourcesModal.locale',
|
|
500
|
-
description: 'Locale',
|
|
501
|
-
defaultMessage: 'Locale'
|
|
502
|
-
},
|
|
503
|
-
exportSelection: {
|
|
504
|
-
id: 'ExportResourcesModal.exportSelection',
|
|
505
|
-
description: 'Export selection',
|
|
506
|
-
defaultMessage: 'Export selection'
|
|
507
|
-
},
|
|
508
|
-
exportAllResources: {
|
|
509
|
-
id: 'ExportResourcesModal.exportAllResources',
|
|
510
|
-
description: 'Export All selection',
|
|
511
|
-
defaultMessage: 'Export all {resourceType} ({count})'
|
|
512
|
-
},
|
|
513
|
-
exportOnlySelectedResources: {
|
|
514
|
-
id: 'ExportResourcesModal.exportOnlySelectedResources',
|
|
515
|
-
description: 'Export only selected resources',
|
|
516
|
-
defaultMessage: 'Export selected {resourceType} ({count})'
|
|
517
|
-
},
|
|
518
|
-
exportAllMessage: {
|
|
519
|
-
id: 'ExportResourcesModal.exportAllMessage',
|
|
520
|
-
description: 'All resources will be exported',
|
|
521
|
-
defaultMessage: 'All <b>{count}</b> {resourceType} will be exported.'
|
|
522
|
-
},
|
|
523
|
-
exportMatchingMessage: {
|
|
524
|
-
id: 'ExportResourcesModal.exportMatchingMessage',
|
|
525
|
-
description: 'resources will be exported',
|
|
526
|
-
defaultMessage: '<b>{count}</b> {resourceType} will be exported.'
|
|
527
|
-
},
|
|
528
|
-
exportSelectedMessage: {
|
|
529
|
-
id: 'ExportResourcesModal.exportSelectedMessage',
|
|
530
|
-
description: 'resources are selected and will be exported',
|
|
531
|
-
defaultMessage: '<b>{count}</b> {resourceType} are selected and will be exported.'
|
|
532
|
-
},
|
|
533
|
-
exportBasedOnMyViewsMessage: {
|
|
534
|
-
id: 'ExportResourcesModal.exportBasedOnMyViewsMessage',
|
|
535
|
-
description: 'Select Export setttings based on my views',
|
|
536
|
-
defaultMessage: 'Select export settings based on:'
|
|
537
|
-
},
|
|
538
|
-
propertiesPanelLabel: {
|
|
539
|
-
id: 'ExportResourcesModal.propertiesPanelLabel',
|
|
540
|
-
description: 'properties panel label',
|
|
541
|
-
defaultMessage: 'Properties'
|
|
542
|
-
},
|
|
543
|
-
exportOperationSuccessMessage: {
|
|
544
|
-
id: 'ExportResourcesModal.exportOperationSuccessMessage',
|
|
545
|
-
description: 'Success message',
|
|
546
|
-
defaultMessage: '<b>Your export has started.</b> <newline></newline><logsLink>Go to Export logs</logsLink> to view the progress and download the file.'
|
|
547
|
-
},
|
|
548
|
-
nothingApplied: {
|
|
549
|
-
id: 'ExportResourcesModal.nothingApplied',
|
|
550
|
-
description: 'Shown when there is no filter applied',
|
|
551
|
-
defaultMessage: 'nothing applied'
|
|
552
|
-
},
|
|
553
|
-
selectAllLocales: {
|
|
554
|
-
id: 'ExportResourcesModal.selectAllLocales',
|
|
555
|
-
description: 'label for "Select all locales" checkbox',
|
|
556
|
-
defaultMessage: 'Select all locales'
|
|
557
|
-
},
|
|
558
|
-
missingFileNameError: {
|
|
559
|
-
id: 'ExportResourcesModal.missingFileNameError',
|
|
560
|
-
description: 'Error when file name field is missing',
|
|
561
|
-
defaultMessage: 'Please enter a file name'
|
|
562
|
-
},
|
|
563
|
-
invalidFileNameError: {
|
|
564
|
-
id: 'ExportResourcesModal.invalidFileNameError',
|
|
565
|
-
description: 'Error when file name field is not valid',
|
|
566
|
-
defaultMessage: 'File name may only contain alphanumeric characters, hyphens and underscores'
|
|
567
|
-
},
|
|
568
|
-
missingLocaleError: {
|
|
569
|
-
id: 'ExportResourcesModal.missingLocaleError',
|
|
570
|
-
description: 'Error when no locale is selected',
|
|
571
|
-
defaultMessage: 'Please select at least one locale'
|
|
572
|
-
},
|
|
573
|
-
myViews: {
|
|
574
|
-
id: 'ExportResourcesModal.myViews',
|
|
575
|
-
description: 'Label for "My Views" Select Field',
|
|
576
|
-
defaultMessage: 'My Views'
|
|
577
|
-
},
|
|
578
|
-
selectFieldsToExport: {
|
|
579
|
-
id: 'ExportResourcesModal.selectFieldsToExport',
|
|
580
|
-
defaultMessage: 'Select fields to export'
|
|
581
|
-
},
|
|
582
|
-
back: {
|
|
583
|
-
id: 'ExportResourcesModal.back',
|
|
584
|
-
description: 'Label for "Back" button',
|
|
585
|
-
defaultMessage: 'Back'
|
|
586
|
-
},
|
|
587
|
-
startExport: {
|
|
588
|
-
id: 'ExportResourcesModal.startExport',
|
|
589
|
-
description: 'Label for "Start export" button',
|
|
590
|
-
defaultMessage: 'Start export'
|
|
591
|
-
},
|
|
592
|
-
continue: {
|
|
593
|
-
id: 'ExportResourcesModal.continue',
|
|
594
|
-
description: 'Label for "Continue" button',
|
|
595
|
-
defaultMessage: 'Continue'
|
|
596
|
-
},
|
|
597
|
-
fieldDefinitions: {
|
|
598
|
-
id: 'ExportResourcesModal.fieldDefinitions',
|
|
599
|
-
description: 'Label for "Field definitions" link',
|
|
600
|
-
defaultMessage: 'Field definitions'
|
|
601
|
-
},
|
|
602
|
-
allGeneralFields: {
|
|
603
|
-
id: 'ExportResourcesModal.allGeneralFields',
|
|
604
|
-
description: 'Label for "All general fields" checkbox',
|
|
605
|
-
defaultMessage: 'All general fields'
|
|
606
|
-
},
|
|
607
|
-
allCustomFields: {
|
|
608
|
-
id: 'ExportResourcesModal.allCustomFields',
|
|
609
|
-
description: 'Label for "All custom fields" checkbox',
|
|
610
|
-
defaultMessage: 'All custom fields'
|
|
611
|
-
},
|
|
612
|
-
customTypeKeyAndTypeId: {
|
|
613
|
-
id: 'ExportResourcesModal.customTypeKeyAndTypeId',
|
|
614
|
-
description: 'Label for "Custom type key and typeId" checkbox',
|
|
615
|
-
defaultMessage: 'Custom type key and typeId'
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
|
|
619
|
-
function getBold(msg) {
|
|
620
|
-
return jsxRuntime.jsx(uiKit.Text.Body, {
|
|
621
|
-
as: "span",
|
|
622
|
-
isBold: true,
|
|
623
|
-
children: msg
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
function getNewLine() {
|
|
628
|
-
return jsxRuntime.jsx("br", {});
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
function ownKeys$4(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
632
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$4(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$4(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
633
|
-
function renderFileNameError(key) {
|
|
634
|
-
switch (key) {
|
|
635
|
-
case 'missing':
|
|
636
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingFileNameError));
|
|
637
|
-
case 'invalidInput':
|
|
638
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.invalidFileNameError));
|
|
639
|
-
default:
|
|
640
|
-
return null;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
function renderLocaleError(key) {
|
|
644
|
-
switch (key) {
|
|
645
|
-
case 'missing':
|
|
646
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$4({}, messages.missingLocaleError));
|
|
647
|
-
default:
|
|
648
|
-
return null;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
function useExportResourcesContext() {
|
|
653
|
-
const context = React.useContext(ExportResourcesContext);
|
|
654
|
-
if (!context) {
|
|
655
|
-
throw new MissingExportResourceProviderError();
|
|
656
|
-
}
|
|
657
|
-
return context;
|
|
658
|
-
}
|
|
659
|
-
|
|
660
662
|
const _excluded = ["isSelectedByDefault"];
|
|
661
663
|
function ownKeys$3(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
662
664
|
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var _context3, _context4; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context3 = ownKeys$3(Object(t), !0)).call(_context3, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context4 = ownKeys$3(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
@@ -830,7 +832,13 @@ function ExportTextMessage() {
|
|
|
830
832
|
const ExportFileSettingsStep = () => {
|
|
831
833
|
const intl = reactIntl.useIntl();
|
|
832
834
|
const _useExportResourcesCo = useExportResourcesContext(),
|
|
833
|
-
formik = _useExportResourcesCo.formik
|
|
835
|
+
formik = _useExportResourcesCo.formik,
|
|
836
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
837
|
+
onClose = _useExportResourcesCo.onClose;
|
|
838
|
+
const resourceTypePlural = resourceTypeToDisplayName({
|
|
839
|
+
resourceType: resourceType,
|
|
840
|
+
isPlural: true
|
|
841
|
+
});
|
|
834
842
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
835
843
|
var _applicationContext$p;
|
|
836
844
|
return {
|
|
@@ -841,88 +849,89 @@ const ExportFileSettingsStep = () => {
|
|
|
841
849
|
locales = _useApplicationContex.locales,
|
|
842
850
|
locale = _useApplicationContex.locale;
|
|
843
851
|
const areAllLocalesChecked = _valuesInstanceProperty__default["default"](formik).locales.length === locales.length;
|
|
844
|
-
return jsxRuntime.
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
onChange: formik.handleChange,
|
|
866
|
-
onBlur: formik.handleBlur,
|
|
867
|
-
value: _valuesInstanceProperty__default["default"](formik).fileName,
|
|
868
|
-
title: intl.formatMessage(messages.fileName),
|
|
869
|
-
touched: formik.touched.fileName,
|
|
870
|
-
errors: formik.errors.fileName,
|
|
871
|
-
renderError: renderFileNameError
|
|
852
|
+
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
853
|
+
isOpen: true,
|
|
854
|
+
title: intl.formatMessage(messages.modalTitle, {
|
|
855
|
+
resourceType: resourceTypePlural
|
|
856
|
+
}),
|
|
857
|
+
labelPrimary: intl.formatMessage(messages.continue),
|
|
858
|
+
onPrimaryButtonClick: formik.submitForm,
|
|
859
|
+
isPrimaryButtonDisabled: !formik.isValid,
|
|
860
|
+
onSecondaryButtonClick: onClose,
|
|
861
|
+
onClose: onClose,
|
|
862
|
+
size: 16,
|
|
863
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
864
|
+
scale: "xxxl",
|
|
865
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
866
|
+
scale: "l",
|
|
867
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
868
|
+
alignItems: "center",
|
|
869
|
+
children: [jsxRuntime.jsx(uiKit.ExportIcon, {
|
|
870
|
+
size: "medium",
|
|
871
|
+
color: "neutral60"
|
|
872
|
+
}), jsxRuntime.jsx(ExportTextMessage, {})]
|
|
872
873
|
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
873
|
-
scale: "
|
|
874
|
+
scale: "m",
|
|
874
875
|
children: [jsxRuntime.jsx(uiKit.SelectField, {
|
|
875
|
-
|
|
876
|
-
name: "locales",
|
|
877
|
-
value: _valuesInstanceProperty__default["default"](formik).locales,
|
|
878
|
-
title: intl.formatMessage(messages.locale),
|
|
879
|
-
options: mapLocalesToOptions(locales),
|
|
880
|
-
isMulti: true,
|
|
876
|
+
name: "outputFormat",
|
|
881
877
|
onChange: formik.handleChange,
|
|
882
878
|
onBlur: formik.handleBlur,
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}), jsxRuntime.jsx(uiKit.
|
|
887
|
-
|
|
888
|
-
onChange:
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
879
|
+
value: _valuesInstanceProperty__default["default"](formik).outputFormat,
|
|
880
|
+
title: intl.formatMessage(messages.outputFormat),
|
|
881
|
+
options: OUTPUT_FORMAT_OPTIONS
|
|
882
|
+
}), jsxRuntime.jsx(uiKit.TextField, {
|
|
883
|
+
name: "fileName",
|
|
884
|
+
onChange: formik.handleChange,
|
|
885
|
+
onBlur: formik.handleBlur,
|
|
886
|
+
value: _valuesInstanceProperty__default["default"](formik).fileName,
|
|
887
|
+
title: intl.formatMessage(messages.fileName),
|
|
888
|
+
touched: formik.touched.fileName,
|
|
889
|
+
errors: formik.errors.fileName,
|
|
890
|
+
renderError: renderFileNameError
|
|
891
|
+
}), jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
892
|
+
scale: "xs",
|
|
893
|
+
children: [jsxRuntime.jsx(uiKit.SelectField, {
|
|
894
|
+
id: "locales",
|
|
895
|
+
name: "locales",
|
|
896
|
+
value: _valuesInstanceProperty__default["default"](formik).locales,
|
|
897
|
+
title: intl.formatMessage(messages.locale),
|
|
898
|
+
options: mapLocalesToOptions(locales),
|
|
899
|
+
isMulti: true,
|
|
900
|
+
onChange: formik.handleChange,
|
|
901
|
+
onBlur: formik.handleBlur,
|
|
902
|
+
touched: formik.touched.locales,
|
|
903
|
+
errors: formik.errors.locales,
|
|
904
|
+
renderError: renderLocaleError,
|
|
905
|
+
menuPortalTarget: document.body,
|
|
906
|
+
menuPortalZIndex: Z_INDEX_DROPDOWN
|
|
907
|
+
}), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
908
|
+
isChecked: areAllLocalesChecked,
|
|
909
|
+
onChange: e => {
|
|
910
|
+
if (e.target.checked) formik.setFieldValue('locales', locales);else formik.setFieldValue('locales', [locale]);
|
|
911
|
+
},
|
|
912
|
+
children: intl.formatMessage(messages.selectAllLocales)
|
|
913
|
+
})]
|
|
892
914
|
})]
|
|
893
915
|
})]
|
|
894
|
-
})]
|
|
895
|
-
})
|
|
896
|
-
justifyContent: "flex-end",
|
|
897
|
-
children: jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
898
|
-
label: intl.formatMessage(messages.continue),
|
|
899
|
-
onClick: formik.submitForm,
|
|
900
|
-
isDisabled: !formik.isValid
|
|
901
|
-
})
|
|
902
|
-
})]
|
|
916
|
+
}), jsxRuntime.jsx("div", {})]
|
|
917
|
+
})
|
|
903
918
|
});
|
|
904
919
|
};
|
|
905
920
|
|
|
906
921
|
function ownKeys$1(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
907
922
|
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var _context12, _context13; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context12 = ownKeys$1(Object(t), !0)).call(_context12, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context13 = ownKeys$1(Object(t))).call(_context13, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
908
|
-
const
|
|
909
|
-
target: "e1ocu3bb2"
|
|
910
|
-
} )({
|
|
911
|
-
name: "yqmzw4",
|
|
912
|
-
styles: "&>div{height:490px;overflow-y:auto;}"
|
|
913
|
-
} );
|
|
914
|
-
const StyledCardLeft = /*#__PURE__*/_styled__default["default"](StyledCard, {
|
|
923
|
+
const StyledCardLeft = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
915
924
|
target: "e1ocu3bb1"
|
|
916
|
-
} )("background-color:#f9f9fb;border-top:", _ref => {
|
|
925
|
+
} )("height:100%;background-color:#f9f9fb;border-top:", _ref => {
|
|
917
926
|
let isTopRow = _ref.isTopRow;
|
|
918
927
|
return isTopRow ? uiKit.designTokens.borderForCardWhenRaised : 'none';
|
|
919
928
|
}, ";border-radius:", _ref2 => {
|
|
920
929
|
let isTopRow = _ref2.isTopRow;
|
|
921
930
|
return isTopRow ? '4px 0px 0px 0px' : '0px 0px 0px 4px';
|
|
922
931
|
}, ";" + ("" ));
|
|
923
|
-
const StyledCardRight = /*#__PURE__*/_styled__default["default"](
|
|
932
|
+
const StyledCardRight = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
924
933
|
target: "e1ocu3bb0"
|
|
925
|
-
} )("border-left:0;border-top:", _ref3 => {
|
|
934
|
+
} )("height:100%;border-left:0;border-top:", _ref3 => {
|
|
926
935
|
let isTopRow = _ref3.isTopRow;
|
|
927
936
|
return isTopRow ? uiKit.designTokens.borderForCardWhenRaised : 'none';
|
|
928
937
|
}, ";border-radius:", _ref4 => {
|
|
@@ -930,120 +939,140 @@ const StyledCardRight = /*#__PURE__*/_styled__default["default"](StyledCard, {
|
|
|
930
939
|
return isTopRow ? '0px 4px 0px 0px' : '0px 0px 4px 0px';
|
|
931
940
|
}, ";" + ("" ));
|
|
932
941
|
const ExportFieldsSelectionStep = () => {
|
|
933
|
-
var
|
|
942
|
+
var _formik$values$custom;
|
|
934
943
|
const intl = reactIntl.useIntl();
|
|
935
944
|
const _useExportResourcesCo = useExportResourcesContext(),
|
|
936
945
|
formik = _useExportResourcesCo.formik,
|
|
937
946
|
setCurrentStep = _useExportResourcesCo.setCurrentStep,
|
|
938
|
-
resourceType = _useExportResourcesCo.resourceType
|
|
939
|
-
|
|
940
|
-
const
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
children: jsxRuntime.jsx(
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
}), ((_formik$values$custom = _valuesInstanceProperty__default["default"](formik).customFields) === null || _formik$values$custom === void 0 ? void 0 : _formik$values$custom.length) > 0 && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
947
|
+
resourceType = _useExportResourcesCo.resourceType,
|
|
948
|
+
onClose = _useExportResourcesCo.onClose;
|
|
949
|
+
const resourceTypePlural = resourceTypeToDisplayName({
|
|
950
|
+
resourceType: resourceType,
|
|
951
|
+
isPlural: true
|
|
952
|
+
});
|
|
953
|
+
const areAllGeneralFieldsChecked = React__default["default"].useMemo(() => {
|
|
954
|
+
var _context;
|
|
955
|
+
return _everyInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).fields).call(_context, field => field.isChecked);
|
|
956
|
+
}, [_valuesInstanceProperty__default["default"](formik).fields]);
|
|
957
|
+
const isAtLeastOneGeneralFieldChecked = React__default["default"].useMemo(() => {
|
|
958
|
+
var _context2;
|
|
959
|
+
return _someInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](formik).fields).call(_context2, field => field.isChecked);
|
|
960
|
+
}, [_valuesInstanceProperty__default["default"](formik).fields]);
|
|
961
|
+
const allCustomFields = React__default["default"].useMemo(() => {
|
|
962
|
+
var _context3;
|
|
963
|
+
return _flatMapInstanceProperty__default["default"](_context3 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context3, customType => customType.fields);
|
|
964
|
+
}, [_valuesInstanceProperty__default["default"](formik).customFields]);
|
|
965
|
+
const areAllCustomFieldsChecked = React__default["default"].useMemo(() => {
|
|
966
|
+
return _everyInstanceProperty__default["default"](allCustomFields).call(allCustomFields, field => field.isChecked);
|
|
967
|
+
}, [allCustomFields]);
|
|
968
|
+
const isAtLeastOneCustomFieldChecked = React__default["default"].useMemo(() => {
|
|
969
|
+
return _someInstanceProperty__default["default"](allCustomFields).call(allCustomFields, field => field.isChecked);
|
|
970
|
+
}, [allCustomFields]);
|
|
971
|
+
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
972
|
+
isOpen: true,
|
|
973
|
+
title: intl.formatMessage(messages.modalTitle, {
|
|
974
|
+
resourceType: resourceTypePlural
|
|
975
|
+
}),
|
|
976
|
+
labelPrimary: intl.formatMessage(messages.startExport),
|
|
977
|
+
onPrimaryButtonClick: formik.submitForm,
|
|
978
|
+
isPrimaryButtonDisabled: !formik.isValid,
|
|
979
|
+
labelSecondary: intl.formatMessage(messages.back),
|
|
980
|
+
onSecondaryButtonClick: () => setCurrentStep(1),
|
|
981
|
+
onClose: onClose,
|
|
982
|
+
size: 16,
|
|
983
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
984
|
+
scale: "xl",
|
|
985
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
986
|
+
scale: "m",
|
|
987
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
988
|
+
justifyContent: "space-between",
|
|
989
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
990
|
+
intlMessage: messages.selectFieldsToExport
|
|
991
|
+
}), jsxRuntime.jsx(uiKit.Link, {
|
|
992
|
+
isExternal: true,
|
|
993
|
+
tone: "secondary",
|
|
994
|
+
intlMessage: messages.fieldDefinitions,
|
|
995
|
+
to: FIELD_DEFINITIONS_URLS[resourceType]
|
|
996
|
+
})]
|
|
997
|
+
}), jsxRuntime.jsxs(uiKit.Grid, {
|
|
998
|
+
gridAutoFlow: "row",
|
|
999
|
+
gridTemplateColumns: "".concat(uiKit.designTokens.constraint5, " auto"),
|
|
992
1000
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
993
1001
|
children: jsxRuntime.jsx(StyledCardLeft, {
|
|
1002
|
+
isTopRow: true,
|
|
994
1003
|
insetScale: "l",
|
|
995
1004
|
children: jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
996
|
-
isIndeterminate: !
|
|
997
|
-
isChecked:
|
|
1005
|
+
isIndeterminate: !areAllGeneralFieldsChecked && isAtLeastOneGeneralFieldChecked,
|
|
1006
|
+
isChecked: areAllGeneralFieldsChecked,
|
|
998
1007
|
onChange: e => {
|
|
999
|
-
var
|
|
1000
|
-
formik.setFieldValue('
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
fields: _mapInstanceProperty__default["default"](_context6 = customType.fields).call(_context6, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1004
|
-
isChecked: e.target.checked
|
|
1005
|
-
}))
|
|
1006
|
-
});
|
|
1007
|
-
}));
|
|
1008
|
+
var _context4;
|
|
1009
|
+
formik.setFieldValue('fields', _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](formik).fields).call(_context4, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1010
|
+
isChecked: field.isRequired ? true : e.target.checked
|
|
1011
|
+
})));
|
|
1008
1012
|
},
|
|
1009
1013
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1010
|
-
intlMessage: messages.
|
|
1014
|
+
intlMessage: messages.allGeneralFields
|
|
1011
1015
|
})
|
|
1012
1016
|
})
|
|
1013
1017
|
})
|
|
1014
1018
|
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1015
1019
|
children: jsxRuntime.jsx(StyledCardRight, {
|
|
1020
|
+
isTopRow: true,
|
|
1016
1021
|
insetScale: "l",
|
|
1017
|
-
children: jsxRuntime.
|
|
1022
|
+
children: jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1018
1023
|
scale: "s",
|
|
1019
|
-
children:
|
|
1020
|
-
|
|
1021
|
-
onChange: () => {},
|
|
1022
|
-
isChecked: isAtLeastOneCustomFieldChecked,
|
|
1023
|
-
children: jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
1024
|
-
children: [intl.formatMessage(messages.customTypeKeyAndTypeId), " *"]
|
|
1025
|
-
})
|
|
1026
|
-
}), jsxRuntime.jsx(CustomFieldsSelection, {
|
|
1027
|
-
customFields: _valuesInstanceProperty__default["default"](formik).customFields,
|
|
1024
|
+
children: jsxRuntime.jsx(GeneralFieldsSelection, {
|
|
1025
|
+
fields: _valuesInstanceProperty__default["default"](formik).fields,
|
|
1028
1026
|
setFieldValue: formik.setFieldValue
|
|
1029
|
-
})
|
|
1027
|
+
})
|
|
1030
1028
|
})
|
|
1031
1029
|
})
|
|
1030
|
+
}), ((_formik$values$custom = _valuesInstanceProperty__default["default"](formik).customFields) === null || _formik$values$custom === void 0 ? void 0 : _formik$values$custom.length) > 0 && jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1031
|
+
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1032
|
+
children: jsxRuntime.jsx(StyledCardLeft, {
|
|
1033
|
+
insetScale: "l",
|
|
1034
|
+
children: jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1035
|
+
isIndeterminate: !areAllCustomFieldsChecked && isAtLeastOneCustomFieldChecked,
|
|
1036
|
+
isChecked: areAllCustomFieldsChecked,
|
|
1037
|
+
onChange: e => {
|
|
1038
|
+
var _context5;
|
|
1039
|
+
formik.setFieldValue('customFields', _mapInstanceProperty__default["default"](_context5 = _valuesInstanceProperty__default["default"](formik).customFields).call(_context5, customType => {
|
|
1040
|
+
var _context6;
|
|
1041
|
+
return _objectSpread$1(_objectSpread$1({}, customType), {}, {
|
|
1042
|
+
fields: _mapInstanceProperty__default["default"](_context6 = customType.fields).call(_context6, field => _objectSpread$1(_objectSpread$1({}, field), {}, {
|
|
1043
|
+
isChecked: e.target.checked
|
|
1044
|
+
}))
|
|
1045
|
+
});
|
|
1046
|
+
}));
|
|
1047
|
+
},
|
|
1048
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1049
|
+
intlMessage: messages.allCustomFields
|
|
1050
|
+
})
|
|
1051
|
+
})
|
|
1052
|
+
})
|
|
1053
|
+
}), jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
1054
|
+
children: jsxRuntime.jsx(StyledCardRight, {
|
|
1055
|
+
insetScale: "l",
|
|
1056
|
+
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1057
|
+
scale: "s",
|
|
1058
|
+
children: [jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1059
|
+
isReadOnly: true,
|
|
1060
|
+
onChange: () => {},
|
|
1061
|
+
isChecked: isAtLeastOneCustomFieldChecked,
|
|
1062
|
+
children: jsxRuntime.jsxs(uiKit.Text.Body, {
|
|
1063
|
+
children: [intl.formatMessage(messages.customTypeKeyAndTypeId), ' ', "*"]
|
|
1064
|
+
})
|
|
1065
|
+
}), jsxRuntime.jsx(CustomFieldsSelection, {
|
|
1066
|
+
customFields: _valuesInstanceProperty__default["default"](formik).customFields,
|
|
1067
|
+
setFieldValue: formik.setFieldValue
|
|
1068
|
+
})]
|
|
1069
|
+
})
|
|
1070
|
+
})
|
|
1071
|
+
})]
|
|
1032
1072
|
})]
|
|
1033
1073
|
})]
|
|
1034
|
-
})
|
|
1035
|
-
})
|
|
1036
|
-
scale: "m",
|
|
1037
|
-
justifyContent: "flex-end",
|
|
1038
|
-
children: [jsxRuntime.jsx(uiKit.SecondaryButton, {
|
|
1039
|
-
label: intl.formatMessage(messages.back),
|
|
1040
|
-
onClick: () => setCurrentStep(1)
|
|
1041
|
-
}), jsxRuntime.jsx(uiKit.PrimaryButton, {
|
|
1042
|
-
label: intl.formatMessage(messages.startExport),
|
|
1043
|
-
onClick: formik.submitForm,
|
|
1044
|
-
isDisabled: !formik.isValid
|
|
1045
|
-
})]
|
|
1046
|
-
})]
|
|
1074
|
+
})
|
|
1075
|
+
})
|
|
1047
1076
|
});
|
|
1048
1077
|
};
|
|
1049
1078
|
const GeneralFieldsSelection = _ref5 => {
|
|
@@ -1176,17 +1205,12 @@ const ExportResourcesProvider = props => {
|
|
|
1176
1205
|
React__default["default"].useEffect(() => {
|
|
1177
1206
|
formik$1.validateForm();
|
|
1178
1207
|
}, [currentStep]);
|
|
1179
|
-
React__default["default"].useEffect(() => {
|
|
1180
|
-
if (props.isOpen) {
|
|
1181
|
-
formik$1.resetForm();
|
|
1182
|
-
setCurrentStep(1);
|
|
1183
|
-
}
|
|
1184
|
-
}, [props.isOpen]);
|
|
1185
1208
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
1186
1209
|
value: {
|
|
1210
|
+
formik: formik$1,
|
|
1187
1211
|
currentStep,
|
|
1188
1212
|
setCurrentStep,
|
|
1189
|
-
|
|
1213
|
+
onClose: props.onClose,
|
|
1190
1214
|
resourceType: props.resourceType,
|
|
1191
1215
|
exportType: props.exportType,
|
|
1192
1216
|
totalResourcesCount: props.totalResourcesCount,
|
|
@@ -1211,21 +1235,9 @@ const CurrentStep = () => {
|
|
|
1211
1235
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1212
1236
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1213
1237
|
const ExportResourcesModal = props => {
|
|
1214
|
-
|
|
1215
|
-
const resourceTypePlural = resourceTypeToDisplayName({
|
|
1216
|
-
resourceType: props.resourceType,
|
|
1217
|
-
isPlural: true
|
|
1218
|
-
});
|
|
1238
|
+
if (!props.isOpen) return null;
|
|
1219
1239
|
return jsxRuntime.jsx(ExportResourcesProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
1220
|
-
children: jsxRuntime.jsx(
|
|
1221
|
-
isOpen: props.isOpen,
|
|
1222
|
-
title: intl.formatMessage(messages.modalTitle, {
|
|
1223
|
-
resourceType: resourceTypePlural
|
|
1224
|
-
}),
|
|
1225
|
-
onClose: props.onClose,
|
|
1226
|
-
size: 16,
|
|
1227
|
-
children: jsxRuntime.jsx(CurrentStep, {})
|
|
1228
|
-
})
|
|
1240
|
+
children: jsxRuntime.jsx(CurrentStep, {})
|
|
1229
1241
|
}));
|
|
1230
1242
|
};
|
|
1231
1243
|
ExportResourcesModal.displayName = 'ExportResourcesModal';
|