@commercetools-frontend-extensions/export-resources-modal 4.4.5 → 4.5.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-export-resources-modal.cjs.dev.js +299 -260
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +283 -244
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +297 -257
- package/dist/declarations/src/@constants/exportable-resources.d.ts +3 -0
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +2 -2
- package/dist/declarations/src/@types/resource-type.d.ts +2 -2
- package/package.json +14 -14
|
@@ -16,42 +16,41 @@ var applicationShellConnectors = require('@commercetools-frontend/application-sh
|
|
|
16
16
|
var uiKit = require('@commercetools-frontend/ui-kit');
|
|
17
17
|
var jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
18
18
|
var _valuesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/values');
|
|
19
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
20
19
|
var applicationComponents = require('@commercetools-frontend/application-components');
|
|
21
20
|
var fullstory = require('@commercetools-frontend/fullstory');
|
|
22
21
|
var React = require('react');
|
|
23
22
|
var _Reflect$construct = require('@babel/runtime-corejs3/core-js-stable/reflect/construct');
|
|
24
23
|
var _createClass = require('@babel/runtime-corejs3/helpers/createClass');
|
|
25
24
|
var _classCallCheck = require('@babel/runtime-corejs3/helpers/classCallCheck');
|
|
26
|
-
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
27
25
|
var _possibleConstructorReturn = require('@babel/runtime-corejs3/helpers/possibleConstructorReturn');
|
|
28
26
|
var _getPrototypeOf = require('@babel/runtime-corejs3/helpers/getPrototypeOf');
|
|
27
|
+
var _inherits = require('@babel/runtime-corejs3/helpers/inherits');
|
|
29
28
|
var _wrapNativeSuper = require('@babel/runtime-corejs3/helpers/wrapNativeSuper');
|
|
30
29
|
var _slicedToArray = require('@babel/runtime-corejs3/helpers/slicedToArray');
|
|
31
30
|
var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/reduce');
|
|
32
|
-
var
|
|
31
|
+
var experimentalComponents = require('@commercetools-frontend/experimental-components');
|
|
32
|
+
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
33
33
|
var omitEmpty = require('omit-empty-es');
|
|
34
34
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
35
35
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
36
36
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
37
37
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
38
38
|
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
39
|
-
var _trimInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/trim');
|
|
40
39
|
var moment = require('moment');
|
|
40
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
41
41
|
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
42
42
|
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
43
|
-
var experimentalComponents = require('@commercetools-frontend/experimental-components');
|
|
44
|
-
var sdk = require('@commercetools-frontend/sdk');
|
|
45
43
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
46
44
|
var constants = require('@commercetools-frontend/constants');
|
|
45
|
+
var sdk = require('@commercetools-frontend/sdk');
|
|
47
46
|
var _styled = require('@emotion/styled/base');
|
|
48
47
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
49
48
|
var throttle = require('lodash/throttle');
|
|
50
49
|
var react = require('@emotion/react');
|
|
51
50
|
var get = require('lodash/get');
|
|
52
51
|
var formik = require('formik');
|
|
53
|
-
var sentry = require('@commercetools-frontend/sentry');
|
|
54
52
|
var i18n = require('@commercetools-frontend/i18n');
|
|
53
|
+
var sentry = require('@commercetools-frontend/sentry');
|
|
55
54
|
|
|
56
55
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
57
56
|
|
|
@@ -64,19 +63,18 @@ var _Object$getOwnPropertyDescriptors__default = /*#__PURE__*/_interopDefault(_O
|
|
|
64
63
|
var _Object$defineProperties__default = /*#__PURE__*/_interopDefault(_Object$defineProperties);
|
|
65
64
|
var _Object$defineProperty__default = /*#__PURE__*/_interopDefault(_Object$defineProperty);
|
|
66
65
|
var _valuesInstanceProperty__default = /*#__PURE__*/_interopDefault(_valuesInstanceProperty);
|
|
67
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
68
66
|
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
69
67
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
70
68
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
71
|
-
var
|
|
69
|
+
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
72
70
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
73
71
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
74
72
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
75
73
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
76
74
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
77
75
|
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
78
|
-
var _trimInstanceProperty__default = /*#__PURE__*/_interopDefault(_trimInstanceProperty);
|
|
79
76
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
77
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
80
78
|
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
81
79
|
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
82
80
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
@@ -246,6 +244,11 @@ var messages = reactIntl.defineMessages({
|
|
|
246
244
|
description: 'Label for Export Selected categories',
|
|
247
245
|
defaultMessage: 'Export selected: {total} categories'
|
|
248
246
|
},
|
|
247
|
+
exportScopeFilteredCategories: {
|
|
248
|
+
id: 'ExportResourcesModal.exportScopeFilteredCategories',
|
|
249
|
+
description: 'Label for Export Filtered categories',
|
|
250
|
+
defaultMessage: 'Export filtered: {total} categories'
|
|
251
|
+
},
|
|
249
252
|
exportScopeAllProducts: {
|
|
250
253
|
id: 'ExportResourcesModal.exportScopeAllProducts',
|
|
251
254
|
description: 'Label for Export All products',
|
|
@@ -256,6 +259,26 @@ var messages = reactIntl.defineMessages({
|
|
|
256
259
|
description: 'Label for Export Selected products',
|
|
257
260
|
defaultMessage: 'Export selected: {total} products'
|
|
258
261
|
},
|
|
262
|
+
exportScopeFilteredProducts: {
|
|
263
|
+
id: 'ExportResourcesModal.exportScopeFilteredProducts',
|
|
264
|
+
description: 'Label for Export Filtered products',
|
|
265
|
+
defaultMessage: 'Export filtered: {total} products'
|
|
266
|
+
},
|
|
267
|
+
exportScopeAllProductTypes: {
|
|
268
|
+
id: 'ExportResourcesModal.exportScopeAllProductTypes',
|
|
269
|
+
description: 'Label for Export All product types',
|
|
270
|
+
defaultMessage: 'Export all: {total} product types'
|
|
271
|
+
},
|
|
272
|
+
exportScopeSelectedProductTypes: {
|
|
273
|
+
id: 'ExportResourcesModal.exportScopeSelectedProductTypes',
|
|
274
|
+
description: 'Label for Export Selected product types',
|
|
275
|
+
defaultMessage: 'Export selected: {total} product types'
|
|
276
|
+
},
|
|
277
|
+
exportScopeFilteredProductTypes: {
|
|
278
|
+
id: 'ExportResourcesModal.exportScopeFilteredProductTypes',
|
|
279
|
+
description: 'Label for Export Filtered product types',
|
|
280
|
+
defaultMessage: 'Export filtered: {total} product types'
|
|
281
|
+
},
|
|
259
282
|
exportScopeAllInventories: {
|
|
260
283
|
id: 'ExportResourcesModal.exportScopeAllInventories',
|
|
261
284
|
description: 'Label for Export All inventories',
|
|
@@ -266,6 +289,11 @@ var messages = reactIntl.defineMessages({
|
|
|
266
289
|
description: 'Label for Export Selected inventories',
|
|
267
290
|
defaultMessage: 'Export selected: {total} inventories'
|
|
268
291
|
},
|
|
292
|
+
exportScopeFilteredInventories: {
|
|
293
|
+
id: 'ExportResourcesModal.exportScopeFilteredInventories',
|
|
294
|
+
description: 'Label for Export Filtered inventories',
|
|
295
|
+
defaultMessage: 'Export filtered: {total} inventories'
|
|
296
|
+
},
|
|
269
297
|
exportScopeAllDiscountCodes: {
|
|
270
298
|
id: 'ExportResourcesModal.exportScopeAllDiscountCodes',
|
|
271
299
|
description: 'Label for Export All discount codes',
|
|
@@ -278,9 +306,39 @@ var messages = reactIntl.defineMessages({
|
|
|
278
306
|
},
|
|
279
307
|
exportScopeFilteredDiscountCodes: {
|
|
280
308
|
id: 'ExportResourcesModal.exportScopeFilteredDiscountCodes',
|
|
281
|
-
description: 'Label for Export
|
|
309
|
+
description: 'Label for Export Filtered discount codes',
|
|
282
310
|
defaultMessage: 'Export filtered: {total} discount codes'
|
|
283
311
|
},
|
|
312
|
+
exportScopeAllOrders: {
|
|
313
|
+
id: 'ExportResourcesModal.exportScopeAllOrders',
|
|
314
|
+
description: 'Label for Export All orders',
|
|
315
|
+
defaultMessage: 'Export all: {total} orders'
|
|
316
|
+
},
|
|
317
|
+
exportScopeSelectedOrders: {
|
|
318
|
+
id: 'ExportResourcesModal.exportScopeSelectedOrders',
|
|
319
|
+
description: 'Label for Export Selected orders',
|
|
320
|
+
defaultMessage: 'Export selected: {total} orders'
|
|
321
|
+
},
|
|
322
|
+
exportScopeFilteredOrders: {
|
|
323
|
+
id: 'ExportResourcesModal.exportScopeFilteredOrders',
|
|
324
|
+
description: 'Label for Export Filtered orders',
|
|
325
|
+
defaultMessage: 'Export filtered: {total} orders'
|
|
326
|
+
},
|
|
327
|
+
exportScopeAllCustomers: {
|
|
328
|
+
id: 'ExportResourcesModal.exportScopeAllCustomers',
|
|
329
|
+
description: 'Label for Export All customers',
|
|
330
|
+
defaultMessage: 'Export all: {total} customers'
|
|
331
|
+
},
|
|
332
|
+
exportScopeSelectedCustomers: {
|
|
333
|
+
id: 'ExportResourcesModal.exportScopeSelectedCustomers',
|
|
334
|
+
description: 'Label for Export Selected customers',
|
|
335
|
+
defaultMessage: 'Export selected: {total} customers'
|
|
336
|
+
},
|
|
337
|
+
exportScopeFilteredCustomers: {
|
|
338
|
+
id: 'ExportResourcesModal.exportScopeFilteredCustomers',
|
|
339
|
+
description: 'Label for Export Filtered customers',
|
|
340
|
+
defaultMessage: 'Export filtered: {total} customers'
|
|
341
|
+
},
|
|
284
342
|
exportScopeSelectedWithoutCount: {
|
|
285
343
|
id: 'ExportResourcesModal.exportScopeSelectedWithoutCount',
|
|
286
344
|
description: 'Label for Export Selected without count',
|
|
@@ -324,63 +382,136 @@ function renderLocaleError(key) {
|
|
|
324
382
|
}
|
|
325
383
|
}
|
|
326
384
|
|
|
327
|
-
|
|
385
|
+
const Z_INDEX_DROPDOWN = 30000;
|
|
386
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
387
|
+
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
388
|
+
|
|
389
|
+
const EXPORT_OPERATION_STATES = {
|
|
390
|
+
PROCESSING: 'processing',
|
|
391
|
+
COMPLETED: 'completed',
|
|
392
|
+
FAILED: 'failed',
|
|
393
|
+
QUEUED: 'queued'
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
const EXPORT_TYPES = {
|
|
397
|
+
ALL: 'all',
|
|
398
|
+
FILTERED: 'filtered',
|
|
399
|
+
SELECTED: 'selected'
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
const EXPORTABLE_RESOURCES = {
|
|
403
|
+
CATEGORY: 'category',
|
|
404
|
+
PRODUCT: 'product',
|
|
405
|
+
PRODUCT_TYPE: 'product-type',
|
|
406
|
+
DISCOUNT_CODE: 'discount-code',
|
|
407
|
+
INVENTORY_ENTRY: 'inventory-entry',
|
|
408
|
+
ORDER: 'order',
|
|
409
|
+
CUSTOMER: 'customer'
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const OUTPUT_FORMATS = {
|
|
413
|
+
JSON: 'json',
|
|
414
|
+
CSV: 'csv'
|
|
415
|
+
};
|
|
416
|
+
const OUTPUT_FORMAT_OPTIONS = [{
|
|
417
|
+
value: OUTPUT_FORMATS.CSV,
|
|
418
|
+
label: 'CSV'
|
|
419
|
+
}, {
|
|
420
|
+
value: OUTPUT_FORMATS.JSON,
|
|
421
|
+
label: 'JSON'
|
|
422
|
+
}];
|
|
423
|
+
|
|
424
|
+
const resourceTypeMessages = {
|
|
425
|
+
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
426
|
+
exportScopeAll: messages.exportScopeAllCategories,
|
|
427
|
+
exportScopeSelected: messages.exportScopeSelectedCategories,
|
|
428
|
+
exportScopeFiltered: messages.exportScopeFilteredCategories
|
|
429
|
+
},
|
|
430
|
+
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
431
|
+
exportScopeAll: messages.exportScopeAllProducts,
|
|
432
|
+
exportScopeSelected: messages.exportScopeSelectedProducts,
|
|
433
|
+
exportScopeFiltered: messages.exportScopeFilteredProducts
|
|
434
|
+
},
|
|
435
|
+
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: {
|
|
436
|
+
exportScopeAll: messages.exportScopeAllProductTypes,
|
|
437
|
+
exportScopeSelected: messages.exportScopeSelectedProductTypes,
|
|
438
|
+
exportScopeFiltered: messages.exportScopeFilteredProductTypes
|
|
439
|
+
},
|
|
440
|
+
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
441
|
+
exportScopeAll: messages.exportScopeAllInventories,
|
|
442
|
+
exportScopeSelected: messages.exportScopeSelectedInventories,
|
|
443
|
+
exportScopeFiltered: messages.exportScopeFilteredInventories
|
|
444
|
+
},
|
|
445
|
+
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
446
|
+
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
447
|
+
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
448
|
+
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
449
|
+
},
|
|
450
|
+
[EXPORTABLE_RESOURCES.ORDER]: {
|
|
451
|
+
exportScopeAll: messages.exportScopeAllOrders,
|
|
452
|
+
exportScopeSelected: messages.exportScopeSelectedOrders,
|
|
453
|
+
exportScopeFiltered: messages.exportScopeFilteredOrders
|
|
454
|
+
},
|
|
455
|
+
[EXPORTABLE_RESOURCES.CUSTOMER]: {
|
|
456
|
+
exportScopeAll: messages.exportScopeAllCustomers,
|
|
457
|
+
exportScopeSelected: messages.exportScopeSelectedCustomers,
|
|
458
|
+
exportScopeFiltered: messages.exportScopeFilteredCustomers
|
|
459
|
+
}
|
|
460
|
+
};
|
|
461
|
+
|
|
462
|
+
function _callSuper$3(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
328
463
|
function _isNativeReflectConstruct$3() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$3 = function () { return !!t; })(); }
|
|
329
464
|
let MissingExportResourceProviderError = /*#__PURE__*/function (_Error) {
|
|
330
|
-
_inherits(MissingExportResourceProviderError, _Error);
|
|
331
|
-
var _super = _createSuper$3(MissingExportResourceProviderError);
|
|
332
465
|
function MissingExportResourceProviderError() {
|
|
333
466
|
var _this;
|
|
334
467
|
_classCallCheck(this, MissingExportResourceProviderError);
|
|
335
|
-
_this =
|
|
468
|
+
_this = _callSuper$3(this, MissingExportResourceProviderError, ['useExportResourcesContext must be used within ExportResourcesProvider']);
|
|
336
469
|
_this.name = 'MissingExportResourceProviderError';
|
|
337
470
|
return _this;
|
|
338
471
|
}
|
|
472
|
+
_inherits(MissingExportResourceProviderError, _Error);
|
|
339
473
|
return _createClass(MissingExportResourceProviderError);
|
|
340
474
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
341
475
|
|
|
342
|
-
function
|
|
476
|
+
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
343
477
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function () { return !!t; })(); }
|
|
344
478
|
let UnexpectedExportOperationStateError = /*#__PURE__*/function (_Error) {
|
|
345
|
-
_inherits(UnexpectedExportOperationStateError, _Error);
|
|
346
|
-
var _super = _createSuper$2(UnexpectedExportOperationStateError);
|
|
347
479
|
function UnexpectedExportOperationStateError(state) {
|
|
348
480
|
var _this;
|
|
349
481
|
_classCallCheck(this, UnexpectedExportOperationStateError);
|
|
350
|
-
_this =
|
|
482
|
+
_this = _callSuper$2(this, UnexpectedExportOperationStateError, [`Unexpected export operation state "${state}"`]);
|
|
351
483
|
_this.name = 'UnexpectedExportOperationStateError';
|
|
352
484
|
return _this;
|
|
353
485
|
}
|
|
486
|
+
_inherits(UnexpectedExportOperationStateError, _Error);
|
|
354
487
|
return _createClass(UnexpectedExportOperationStateError);
|
|
355
488
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
356
489
|
|
|
357
|
-
function
|
|
490
|
+
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
358
491
|
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function () { return !!t; })(); }
|
|
359
492
|
let UnexpectedResourceTypeError = /*#__PURE__*/function (_Error) {
|
|
360
|
-
_inherits(UnexpectedResourceTypeError, _Error);
|
|
361
|
-
var _super = _createSuper$1(UnexpectedResourceTypeError);
|
|
362
493
|
function UnexpectedResourceTypeError(resourceType) {
|
|
363
494
|
var _this;
|
|
364
495
|
_classCallCheck(this, UnexpectedResourceTypeError);
|
|
365
|
-
_this =
|
|
496
|
+
_this = _callSuper$1(this, UnexpectedResourceTypeError, [`Unexpected resource type "${resourceType}"`]);
|
|
366
497
|
_this.name = 'UnexpectedResourceTypeError';
|
|
367
498
|
return _this;
|
|
368
499
|
}
|
|
500
|
+
_inherits(UnexpectedResourceTypeError, _Error);
|
|
369
501
|
return _createClass(UnexpectedResourceTypeError);
|
|
370
502
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
371
503
|
|
|
372
|
-
function
|
|
504
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? _Reflect$construct__default["default"](o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
373
505
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(_Reflect$construct__default["default"](Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function () { return !!t; })(); }
|
|
374
506
|
let InvalidResponseError = /*#__PURE__*/function (_Error) {
|
|
375
|
-
_inherits(InvalidResponseError, _Error);
|
|
376
|
-
var _super = _createSuper(InvalidResponseError);
|
|
377
507
|
function InvalidResponseError(message) {
|
|
378
508
|
var _this;
|
|
379
509
|
_classCallCheck(this, InvalidResponseError);
|
|
380
|
-
_this =
|
|
510
|
+
_this = _callSuper(this, InvalidResponseError, [message]);
|
|
381
511
|
_this.name = 'InvalidResponseError';
|
|
382
512
|
return _this;
|
|
383
513
|
}
|
|
514
|
+
_inherits(InvalidResponseError, _Error);
|
|
384
515
|
return _createClass(InvalidResponseError);
|
|
385
516
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
386
517
|
|
|
@@ -393,7 +524,7 @@ function useExportResourcesContext() {
|
|
|
393
524
|
}
|
|
394
525
|
|
|
395
526
|
function checkAtLeastOneFieldChecked(fields) {
|
|
396
|
-
return fields
|
|
527
|
+
return fields?.some(field => {
|
|
397
528
|
if (field.fields) {
|
|
398
529
|
return field.isChecked || checkAtLeastOneFieldChecked(field.fields);
|
|
399
530
|
}
|
|
@@ -436,76 +567,22 @@ function validate(_ref) {
|
|
|
436
567
|
return omitEmpty__default["default"](errors);
|
|
437
568
|
}
|
|
438
569
|
|
|
439
|
-
const Z_INDEX_DROPDOWN = 30000;
|
|
440
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION = 'OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION';
|
|
441
|
-
const OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP = 'OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP';
|
|
442
|
-
|
|
443
|
-
const EXPORT_OPERATION_STATES = {
|
|
444
|
-
PROCESSING: 'processing',
|
|
445
|
-
COMPLETED: 'completed',
|
|
446
|
-
FAILED: 'failed',
|
|
447
|
-
QUEUED: 'queued'
|
|
448
|
-
};
|
|
449
|
-
|
|
450
|
-
const EXPORT_TYPES = {
|
|
451
|
-
ALL: 'all',
|
|
452
|
-
FILTERED: 'filtered',
|
|
453
|
-
SELECTED: 'selected'
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
const EXPORTABLE_RESOURCES = {
|
|
457
|
-
CATEGORY: 'category',
|
|
458
|
-
PRODUCT: 'product',
|
|
459
|
-
DISCOUNT_CODE: 'discount-code',
|
|
460
|
-
INVENTORY_ENTRY: 'inventory-entry'
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
const OUTPUT_FORMATS = {
|
|
464
|
-
JSON: 'json',
|
|
465
|
-
CSV: 'csv'
|
|
466
|
-
};
|
|
467
|
-
const OUTPUT_FORMAT_OPTIONS = [{
|
|
468
|
-
value: OUTPUT_FORMATS.CSV,
|
|
469
|
-
label: 'CSV'
|
|
470
|
-
}, {
|
|
471
|
-
value: OUTPUT_FORMATS.JSON,
|
|
472
|
-
label: 'JSON'
|
|
473
|
-
}];
|
|
474
|
-
|
|
475
|
-
const resourceTypeMessages = {
|
|
476
|
-
[EXPORTABLE_RESOURCES.CATEGORY]: {
|
|
477
|
-
exportScopeAll: messages.exportScopeAllCategories,
|
|
478
|
-
exportScopeSelected: messages.exportScopeSelectedCategories
|
|
479
|
-
},
|
|
480
|
-
[EXPORTABLE_RESOURCES.PRODUCT]: {
|
|
481
|
-
exportScopeAll: messages.exportScopeAllProducts,
|
|
482
|
-
exportScopeSelected: messages.exportScopeSelectedProducts
|
|
483
|
-
},
|
|
484
|
-
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: {
|
|
485
|
-
exportScopeAll: messages.exportScopeAllInventories,
|
|
486
|
-
exportScopeSelected: messages.exportScopeSelectedInventories
|
|
487
|
-
},
|
|
488
|
-
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: {
|
|
489
|
-
exportScopeAll: messages.exportScopeAllDiscountCodes,
|
|
490
|
-
exportScopeSelected: messages.exportScopeSelectedDiscountCodes,
|
|
491
|
-
exportScopeFiltered: messages.exportScopeFilteredDiscountCodes
|
|
492
|
-
}
|
|
493
|
-
};
|
|
494
|
-
|
|
495
570
|
function resourceTypeToFileName(resourceType) {
|
|
496
|
-
var _context;
|
|
497
571
|
const todayFormatted = moment__default["default"]().format('DD-MM-YY_HH-mm');
|
|
498
572
|
const resourceTypeMap = {
|
|
499
573
|
[EXPORTABLE_RESOURCES.CATEGORY]: 'Categories',
|
|
500
574
|
[EXPORTABLE_RESOURCES.PRODUCT]: 'Products',
|
|
575
|
+
[EXPORTABLE_RESOURCES.PRODUCT_TYPE]: 'Product_Types',
|
|
501
576
|
[EXPORTABLE_RESOURCES.DISCOUNT_CODE]: 'Discount_Codes',
|
|
502
|
-
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: 'Inventories'
|
|
577
|
+
[EXPORTABLE_RESOURCES.INVENTORY_ENTRY]: 'Inventories',
|
|
578
|
+
[EXPORTABLE_RESOURCES.CUSTOMER]: 'Customers',
|
|
579
|
+
[EXPORTABLE_RESOURCES.ORDER]: 'Orders'
|
|
503
580
|
};
|
|
504
581
|
const displayName = resourceTypeMap[resourceType];
|
|
505
582
|
if (!displayName) {
|
|
506
583
|
throw new UnexpectedResourceTypeError(resourceType);
|
|
507
584
|
}
|
|
508
|
-
return
|
|
585
|
+
return `${displayName}_Export_${todayFormatted}`;
|
|
509
586
|
}
|
|
510
587
|
function mapLocalesToOptions(locales) {
|
|
511
588
|
return _mapInstanceProperty__default["default"](locales).call(locales, locale => ({
|
|
@@ -517,14 +594,13 @@ function isFilledArray(maybeArray) {
|
|
|
517
594
|
return _Array$isArray__default["default"](maybeArray) && maybeArray.length;
|
|
518
595
|
}
|
|
519
596
|
function appendCsvOrJsonExtensionIfAbsent(fileName, fileFormat) {
|
|
520
|
-
var _context2;
|
|
521
597
|
const extensionRegex = /\.(csv|json)$/i;
|
|
522
|
-
if (!extensionRegex.test(fileName)) return
|
|
598
|
+
if (!extensionRegex.test(fileName)) return `${fileName}.${fileFormat}`;
|
|
523
599
|
return fileName;
|
|
524
600
|
}
|
|
525
601
|
function getExportLogsLink(projectKey, msg) {
|
|
526
602
|
return jsxRuntime.jsx(uiKit.Link, {
|
|
527
|
-
to:
|
|
603
|
+
to: `/${projectKey}/operations/export/logs`,
|
|
528
604
|
children: msg
|
|
529
605
|
});
|
|
530
606
|
}
|
|
@@ -554,30 +630,28 @@ function sortFieldsByFieldOrder(_ref) {
|
|
|
554
630
|
return fields;
|
|
555
631
|
}
|
|
556
632
|
function buildSelectedExportFilters(selectedResourceIds) {
|
|
557
|
-
if (!selectedResourceIds ||
|
|
558
|
-
const formattedIds = _mapInstanceProperty__default["default"](selectedResourceIds).call(selectedResourceIds, id => "
|
|
559
|
-
return
|
|
633
|
+
if (!selectedResourceIds || selectedResourceIds?.length === 0) return undefined;
|
|
634
|
+
const formattedIds = _mapInstanceProperty__default["default"](selectedResourceIds).call(selectedResourceIds, id => `"${id}"`).join(', ');
|
|
635
|
+
return `id in (${formattedIds})`;
|
|
560
636
|
}
|
|
561
637
|
function areFiltersApplied(filters) {
|
|
562
|
-
var _filters$where;
|
|
563
638
|
if (!filters) {
|
|
564
639
|
return false;
|
|
565
640
|
}
|
|
566
|
-
return filters.where !== undefined &&
|
|
641
|
+
return filters.where !== undefined && filters.where?.trim() !== '';
|
|
567
642
|
}
|
|
568
643
|
function getInitialExportType(args) {
|
|
569
|
-
|
|
570
|
-
if ((_args$selectedResourc = args.selectedResourceIds) !== null && _args$selectedResourc !== void 0 && _args$selectedResourc.length) {
|
|
644
|
+
if (args.selectedResourceIds?.length) {
|
|
571
645
|
return EXPORT_TYPES.SELECTED;
|
|
572
646
|
}
|
|
573
|
-
if (
|
|
647
|
+
if (args.filters?.total && areFiltersApplied(args.filters)) {
|
|
574
648
|
return EXPORT_TYPES.FILTERED;
|
|
575
649
|
}
|
|
576
650
|
return EXPORT_TYPES.ALL;
|
|
577
651
|
}
|
|
578
652
|
|
|
579
653
|
function ownKeys$6(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
580
|
-
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
654
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$6(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
581
655
|
const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
582
656
|
const updateFields = (fields, parentChecked, fieldName) => {
|
|
583
657
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
@@ -585,10 +659,8 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
585
659
|
if (field.isRequired) {
|
|
586
660
|
isChecked = true;
|
|
587
661
|
} else {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
var _context2;
|
|
591
|
-
isChecked = cachedSelectedGroups[_concatInstanceProperty__default["default"](_context2 = "".concat(fieldName, ".")).call(_context2, field.name)];
|
|
662
|
+
if (cachedSelectedGroups[`${fieldName}.${field.name}`] !== undefined) {
|
|
663
|
+
isChecked = cachedSelectedGroups[`${fieldName}.${field.name}`];
|
|
592
664
|
} else if (!field.isReadOnly && field.isSelectedByDefault) {
|
|
593
665
|
isChecked = true;
|
|
594
666
|
} else if (parentChecked) {
|
|
@@ -596,8 +668,7 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
596
668
|
}
|
|
597
669
|
}
|
|
598
670
|
if (field.fields) {
|
|
599
|
-
|
|
600
|
-
const updatedFields = updateFields(field.fields, isChecked, _concatInstanceProperty__default["default"](_context3 = "".concat(fieldName, ".")).call(_context3, field.name));
|
|
671
|
+
const updatedFields = updateFields(field.fields, isChecked, `${fieldName}.${field.name}`);
|
|
601
672
|
isChecked = false;
|
|
602
673
|
field.fields = updatedFields;
|
|
603
674
|
}
|
|
@@ -648,8 +719,7 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
648
719
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
649
720
|
let isExpanded = null;
|
|
650
721
|
if (field.isExpandable) {
|
|
651
|
-
|
|
652
|
-
isExpanded = (_ref = (_cachedExpandedGroups = cachedExpandedGroups[_concatInstanceProperty__default["default"](_context4 = "".concat(groupName, ".")).call(_context4, field.name)]) !== null && _cachedExpandedGroups !== void 0 ? _cachedExpandedGroups : field.isExpanded) !== null && _ref !== void 0 ? _ref : false;
|
|
722
|
+
isExpanded = cachedExpandedGroups[`${groupName}.${field.name}`] ?? field.isExpanded ?? false;
|
|
653
723
|
}
|
|
654
724
|
if (field.fields) {
|
|
655
725
|
field.fields = updateFields(field.fields, groupName);
|
|
@@ -663,10 +733,9 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
663
733
|
});
|
|
664
734
|
}
|
|
665
735
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
666
|
-
var _ref2, _cachedExpandedGroups2;
|
|
667
736
|
const updatedFields = updateFields(group.fields, group.groupName);
|
|
668
737
|
return _objectSpread$6(_objectSpread$6({}, group), {}, {
|
|
669
|
-
isExpanded:
|
|
738
|
+
isExpanded: cachedExpandedGroups[group.groupName] ?? group.isExpanded ?? false,
|
|
670
739
|
fields: updatedFields
|
|
671
740
|
});
|
|
672
741
|
});
|
|
@@ -676,7 +745,7 @@ const isRequiredGroupChecked = function () {
|
|
|
676
745
|
let dependentGroupNames = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
677
746
|
let formik = arguments.length > 1 ? arguments[1] : undefined;
|
|
678
747
|
let result = false;
|
|
679
|
-
if (dependentGroupNames
|
|
748
|
+
if (dependentGroupNames?.length) {
|
|
680
749
|
_someInstanceProperty__default["default"](dependentGroupNames).call(dependentGroupNames, dependentGroupName => {
|
|
681
750
|
var _context;
|
|
682
751
|
const dependentGroup = _findInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).groups).call(_context, group => group.groupName === dependentGroupName);
|
|
@@ -698,23 +767,20 @@ const checkAllFieldsSelected = fields => {
|
|
|
698
767
|
};
|
|
699
768
|
|
|
700
769
|
const useInitialValues = props => {
|
|
701
|
-
var _context
|
|
770
|
+
var _context;
|
|
702
771
|
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
703
772
|
locale: applicationContext.dataLocale
|
|
704
773
|
})),
|
|
705
774
|
locale = _useApplicationContex.locale;
|
|
706
|
-
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(context => {
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
710
|
-
};
|
|
711
|
-
}),
|
|
775
|
+
const _useApplicationContex2 = applicationShellConnectors.useApplicationContext(context => ({
|
|
776
|
+
projectKey: context.project?.key
|
|
777
|
+
})),
|
|
712
778
|
projectKey = _useApplicationContex2.projectKey;
|
|
713
|
-
const _useStorage = experimentalComponents.useStorage(
|
|
779
|
+
const _useStorage = experimentalComponents.useStorage(`${projectKey}/${OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION}`, {}),
|
|
714
780
|
_useStorage2 = _slicedToArray(_useStorage, 1),
|
|
715
781
|
cachedSelectedGroups = _useStorage2[0];
|
|
716
|
-
const _useStorage3 = experimentalComponents.useStorage(
|
|
717
|
-
[props.resourceType]: _reduceInstanceProperty__default["default"](
|
|
782
|
+
const _useStorage3 = experimentalComponents.useStorage(`${projectKey}/${OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP}`, {
|
|
783
|
+
[props.resourceType]: _reduceInstanceProperty__default["default"](_context = props.fieldGroups).call(_context, (acc, group) => {
|
|
718
784
|
acc[group.groupName] = group.isExpanded;
|
|
719
785
|
return acc;
|
|
720
786
|
}, {})
|
|
@@ -726,7 +792,7 @@ const useInitialValues = props => {
|
|
|
726
792
|
groups = updateFieldGroupsWithIsExpandedValue(groups, cachedExpandedGroups[props.resourceType] || {});
|
|
727
793
|
return {
|
|
728
794
|
outputFormat: props.outputFormat,
|
|
729
|
-
fileName:
|
|
795
|
+
fileName: `${resourceTypeToFileName(props.resourceType)}`,
|
|
730
796
|
locales: [locale],
|
|
731
797
|
groups: updateFieldGroupWithAdditionalFieldExtensions(groups)
|
|
732
798
|
};
|
|
@@ -742,7 +808,7 @@ async function createExportOperation(_ref) {
|
|
|
742
808
|
locales = _ref.locales,
|
|
743
809
|
filters = _ref.filters,
|
|
744
810
|
asyncDispatchFn = _ref.asyncDispatchFn;
|
|
745
|
-
const uri =
|
|
811
|
+
const uri = `/${projectKey}/export-operations`;
|
|
746
812
|
const response = await asyncDispatchFn(sdk.actions.post({
|
|
747
813
|
mcApiProxyTarget: constants.MC_API_PROXY_TARGETS.EXPORT,
|
|
748
814
|
uri: uri,
|
|
@@ -766,24 +832,20 @@ const useStartExportOperation = props => {
|
|
|
766
832
|
const intl = reactIntl.useIntl();
|
|
767
833
|
const asyncDispatch = sdk.useAsyncDispatch();
|
|
768
834
|
const showNotification = actionsGlobal.useShowNotification();
|
|
769
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
projectKey: (_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.key
|
|
774
|
-
};
|
|
775
|
-
}),
|
|
835
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
836
|
+
locale: applicationContext.dataLocale,
|
|
837
|
+
projectKey: applicationContext.project?.key
|
|
838
|
+
})),
|
|
776
839
|
projectKey = _useApplicationContex.projectKey;
|
|
777
840
|
const extractFieldsFromGroups = groups => {
|
|
778
841
|
let selectedGeneralFields = [];
|
|
779
842
|
const getSelectedFields = fields => {
|
|
780
843
|
return _filterInstanceProperty__default["default"](fields).call(fields, field => {
|
|
781
|
-
var _field$isChecked;
|
|
782
844
|
if (field.fields) {
|
|
783
845
|
return getSelectedFields(field.fields);
|
|
784
846
|
}
|
|
785
847
|
if (field.isChecked) selectedGeneralFields.push(field);
|
|
786
|
-
return
|
|
848
|
+
return field.isChecked ?? false;
|
|
787
849
|
});
|
|
788
850
|
};
|
|
789
851
|
_forEachInstanceProperty__default["default"](groups).call(groups, group => {
|
|
@@ -896,10 +958,10 @@ function ExportScopeSection() {
|
|
|
896
958
|
})
|
|
897
959
|
}), jsxRuntime.jsx(uiKit.RadioInput.Option, {
|
|
898
960
|
value: EXPORT_TYPES.SELECTED,
|
|
899
|
-
isDisabled: !
|
|
961
|
+
isDisabled: !selectedResourceIds?.length,
|
|
900
962
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
901
|
-
tone: !
|
|
902
|
-
intlMessage: selectedResourceIds
|
|
963
|
+
tone: !selectedResourceIds?.length ? 'tertiary' : undefined,
|
|
964
|
+
intlMessage: selectedResourceIds?.length ? _objectSpread$5(_objectSpread$5({}, resourceTypeMessages[resourceType].exportScopeSelected), {}, {
|
|
903
965
|
values: {
|
|
904
966
|
total: intl.formatNumber(selectedResourceIds.length)
|
|
905
967
|
}
|
|
@@ -911,25 +973,21 @@ function ExportScopeSection() {
|
|
|
911
973
|
}
|
|
912
974
|
|
|
913
975
|
const ExportFileSettingsStep = () => {
|
|
914
|
-
var _context;
|
|
915
976
|
const intl = reactIntl.useIntl();
|
|
916
977
|
const _useExportResourcesCo = useExportResourcesContext(),
|
|
917
978
|
formik = _useExportResourcesCo.formik,
|
|
918
979
|
resourceType = _useExportResourcesCo.resourceType,
|
|
919
980
|
onClose = _useExportResourcesCo.onClose;
|
|
920
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => {
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
locales: ((_applicationContext$p = applicationContext.project) === null || _applicationContext$p === void 0 ? void 0 : _applicationContext$p.languages) || []
|
|
925
|
-
};
|
|
926
|
-
}),
|
|
981
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
982
|
+
locale: applicationContext.dataLocale,
|
|
983
|
+
locales: applicationContext.project?.languages || []
|
|
984
|
+
})),
|
|
927
985
|
locales = _useApplicationContex.locales,
|
|
928
986
|
locale = _useApplicationContex.locale;
|
|
929
987
|
const areAllLocalesChecked = _valuesInstanceProperty__default["default"](formik).locales.length === locales.length;
|
|
930
988
|
return jsxRuntime.jsx(applicationComponents.FormDialog, {
|
|
931
989
|
isOpen: true,
|
|
932
|
-
title: intl.formatMessage(messages[
|
|
990
|
+
title: intl.formatMessage(messages[`modalTitle.${resourceType}`]),
|
|
933
991
|
labelPrimary: intl.formatMessage(messages.continue),
|
|
934
992
|
onPrimaryButtonClick: formik.submitForm,
|
|
935
993
|
isPrimaryButtonDisabled: !formik.isValid,
|
|
@@ -943,7 +1001,7 @@ const ExportFileSettingsStep = () => {
|
|
|
943
1001
|
scale: "l",
|
|
944
1002
|
children: jsxRuntime.jsxs(uiKit.Grid, {
|
|
945
1003
|
gridRowGap: uiKit.designTokens.spacingL,
|
|
946
|
-
gridTemplateColumns:
|
|
1004
|
+
gridTemplateColumns: `calc(${uiKit.designTokens.constraint3} + ${uiKit.designTokens.spacingL}) auto`,
|
|
947
1005
|
children: [jsxRuntime.jsx(uiKit.Grid.Item, {
|
|
948
1006
|
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
949
1007
|
intlMessage: messages.exportScope
|
|
@@ -1008,54 +1066,20 @@ const ExportFileSettingsStep = () => {
|
|
|
1008
1066
|
});
|
|
1009
1067
|
};
|
|
1010
1068
|
|
|
1011
|
-
var _ref$1 = {
|
|
1012
|
-
name: "ti75j2",
|
|
1013
|
-
styles: "margin:0"
|
|
1014
|
-
} ;
|
|
1015
|
-
const NoSearchResults = () => {
|
|
1016
|
-
return jsxRuntime.jsxs(uiKit.Card, {
|
|
1017
|
-
insetScale: "xl",
|
|
1018
|
-
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1019
|
-
scale: "s",
|
|
1020
|
-
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1021
|
-
fontWeight: "medium",
|
|
1022
|
-
intlMessage: messages.thereAreNoResults
|
|
1023
|
-
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1024
|
-
intlMessage: messages.suggestions
|
|
1025
|
-
})]
|
|
1026
|
-
}), jsxRuntime.jsxs("ul", {
|
|
1027
|
-
css: _ref$1,
|
|
1028
|
-
children: [jsxRuntime.jsx("li", {
|
|
1029
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1030
|
-
intlMessage: messages.checkTheSpelling
|
|
1031
|
-
})
|
|
1032
|
-
}), jsxRuntime.jsx("li", {
|
|
1033
|
-
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1034
|
-
intlMessage: messages.searchByEnteringTheExactFieldName
|
|
1035
|
-
})
|
|
1036
|
-
})]
|
|
1037
|
-
})]
|
|
1038
|
-
});
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
1069
|
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; }
|
|
1042
|
-
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1070
|
+
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; }
|
|
1043
1071
|
const exportFieldSelectionContextDefaultValues = {
|
|
1044
1072
|
updateExpandedGroups: (_name, _value) => {}
|
|
1045
1073
|
};
|
|
1046
1074
|
const ExportFieldSelectionContext = /*#__PURE__*/React.createContext(exportFieldSelectionContextDefaultValues);
|
|
1047
1075
|
const ExportFieldSelectionProvider = _ref => {
|
|
1048
|
-
var _context;
|
|
1049
1076
|
let resourceType = _ref.resourceType,
|
|
1050
1077
|
children = _ref.children;
|
|
1051
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
1055
|
-
};
|
|
1056
|
-
}),
|
|
1078
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
1079
|
+
projectKey: context.project?.key
|
|
1080
|
+
})),
|
|
1057
1081
|
projectKey = _useApplicationContex.projectKey;
|
|
1058
|
-
const _useStorage = experimentalComponents.useStorage(
|
|
1082
|
+
const _useStorage = experimentalComponents.useStorage(`${projectKey}/${OPERATIONS_EXPORT_RESOURCES_MODAL_EXPANDED_GROUP}`, {}),
|
|
1059
1083
|
_useStorage2 = _slicedToArray(_useStorage, 2),
|
|
1060
1084
|
cachedExpandedGroups = _useStorage2[0],
|
|
1061
1085
|
setCachedExpandedGroups = _useStorage2[1];
|
|
@@ -1093,20 +1117,18 @@ const calculateTotalSelectedFields = (group, formik) => {
|
|
|
1093
1117
|
// check `isReadOnly` fields
|
|
1094
1118
|
function countReadOnlyDependentFields(fields) {
|
|
1095
1119
|
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1096
|
-
var _field$dependentGroup;
|
|
1097
1120
|
if (field.fields) {
|
|
1098
1121
|
countReadOnlyDependentFields(field.fields);
|
|
1099
|
-
} else if (
|
|
1122
|
+
} else if (field.dependentGroupNames?.length && isRequiredGroupChecked(field.dependentGroupNames, formik)) {
|
|
1100
1123
|
result += 1;
|
|
1101
1124
|
}
|
|
1102
1125
|
});
|
|
1103
1126
|
}
|
|
1104
1127
|
function countReadOnlyFields(fields) {
|
|
1105
1128
|
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1106
|
-
var _field$dependentGroup2;
|
|
1107
1129
|
if (field.fields) {
|
|
1108
1130
|
countReadOnlyFields(field.fields);
|
|
1109
|
-
} else if (field.isReadOnly && !
|
|
1131
|
+
} else if (field.isReadOnly && !field.dependentGroupNames?.length) {
|
|
1110
1132
|
result += 1;
|
|
1111
1133
|
}
|
|
1112
1134
|
});
|
|
@@ -1163,7 +1185,7 @@ const CollapsibleFieldWrapper = _ref => {
|
|
|
1163
1185
|
registerContentNode
|
|
1164
1186
|
});
|
|
1165
1187
|
}
|
|
1166
|
-
},
|
|
1188
|
+
}, `${isForceExpanded}`);
|
|
1167
1189
|
return children({
|
|
1168
1190
|
isOpen: true,
|
|
1169
1191
|
toggle: () => {},
|
|
@@ -1181,8 +1203,7 @@ const FieldSection = _ref3 => {
|
|
|
1181
1203
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
1182
1204
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1183
1205
|
scale: "s",
|
|
1184
|
-
children: fields
|
|
1185
|
-
var _context;
|
|
1206
|
+
children: fields?.map((field, index) => {
|
|
1186
1207
|
const isAnyOfTheChildFieldsChecked = checkAtLeastOneFieldChecked(field.fields);
|
|
1187
1208
|
const allAllFieldsSelected = checkAllFieldsSelected(field.fields || []);
|
|
1188
1209
|
const checkIsChecked = () => {
|
|
@@ -1202,7 +1223,6 @@ const FieldSection = _ref3 => {
|
|
|
1202
1223
|
isForceExpanded: isForceExpanded,
|
|
1203
1224
|
field: field,
|
|
1204
1225
|
children: _ref4 => {
|
|
1205
|
-
var _context2, _field$fields3;
|
|
1206
1226
|
let isOpen = _ref4.isOpen,
|
|
1207
1227
|
toggle = _ref4.toggle,
|
|
1208
1228
|
registerContentNode = _ref4.registerContentNode;
|
|
@@ -1212,12 +1232,11 @@ const FieldSection = _ref3 => {
|
|
|
1212
1232
|
size: "20",
|
|
1213
1233
|
style: {
|
|
1214
1234
|
position: 'absolute',
|
|
1215
|
-
left:
|
|
1235
|
+
left: `calc(-1 * ${uiKit.designTokens.spacingXl})`
|
|
1216
1236
|
},
|
|
1217
1237
|
onClick: () => {
|
|
1218
1238
|
if (!isForceExpanded) {
|
|
1219
|
-
|
|
1220
|
-
updateExpandedGroups(_concatInstanceProperty__default["default"](_context3 = "".concat(groupName, ".")).call(_context3, field.name), !isOpen);
|
|
1239
|
+
updateExpandedGroups(`${groupName}.${field.name}`, !isOpen);
|
|
1221
1240
|
}
|
|
1222
1241
|
toggle();
|
|
1223
1242
|
},
|
|
@@ -1231,18 +1250,16 @@ const FieldSection = _ref3 => {
|
|
|
1231
1250
|
isChecked: checkIsChecked(),
|
|
1232
1251
|
isReadOnly: field.isReadOnly || field.isRequired,
|
|
1233
1252
|
onChange: e => {
|
|
1234
|
-
|
|
1235
|
-
const path = _concatInstanceProperty__default["default"](_context4 = "".concat(parentKeys.join('.'), ".fields[")).call(_context4, index, "]");
|
|
1253
|
+
const path = `${parentKeys.join('.')}.fields[${index}]`;
|
|
1236
1254
|
// Update all child fields
|
|
1237
1255
|
const updateAllChildFieldsChecked = (path, checked) => {
|
|
1238
1256
|
const item = get__default["default"](_valuesInstanceProperty__default["default"](formik), path);
|
|
1239
1257
|
if (item && item.fields) {
|
|
1240
|
-
var
|
|
1241
|
-
_forEachInstanceProperty__default["default"](
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
formik.setFieldValue("".concat(fieldPath, ".isChecked"), checked,
|
|
1258
|
+
var _context;
|
|
1259
|
+
_forEachInstanceProperty__default["default"](_context = item.fields).call(_context, (field, i) => {
|
|
1260
|
+
const fieldPath = `${path}.fields[${i}]`;
|
|
1261
|
+
if (!field.fields?.length) {
|
|
1262
|
+
formik.setFieldValue(`${fieldPath}.isChecked`, checked,
|
|
1246
1263
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
1247
1264
|
false);
|
|
1248
1265
|
}
|
|
@@ -1250,8 +1267,8 @@ const FieldSection = _ref3 => {
|
|
|
1250
1267
|
});
|
|
1251
1268
|
}
|
|
1252
1269
|
};
|
|
1253
|
-
if (!
|
|
1254
|
-
formik.setFieldValue(
|
|
1270
|
+
if (!field.fields?.length) {
|
|
1271
|
+
formik.setFieldValue(`${path}.isChecked`, e.target.checked,
|
|
1255
1272
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
1256
1273
|
false);
|
|
1257
1274
|
}
|
|
@@ -1260,7 +1277,7 @@ const FieldSection = _ref3 => {
|
|
|
1260
1277
|
children: [field.label, (field.isReadOnly || field.isRequired) && ' *']
|
|
1261
1278
|
})
|
|
1262
1279
|
})]
|
|
1263
|
-
}), field.fields &&
|
|
1280
|
+
}), field.fields && field.fields?.length > 0 && jsxRuntime.jsx(StyledExpandableContent, {
|
|
1264
1281
|
ref: registerContentNode,
|
|
1265
1282
|
isOpen: isOpen,
|
|
1266
1283
|
children: jsxRuntime.jsxs(uiKit.Spacings.Inline, {
|
|
@@ -1268,16 +1285,16 @@ const FieldSection = _ref3 => {
|
|
|
1268
1285
|
children: [jsxRuntime.jsx("div", {}), jsxRuntime.jsx(FieldSection, {
|
|
1269
1286
|
fields: field.fields,
|
|
1270
1287
|
formik: formik,
|
|
1271
|
-
parentKeys: [...parentKeys,
|
|
1288
|
+
parentKeys: [...parentKeys, `fields[${index}]`],
|
|
1272
1289
|
isAnySiblingChecked: isAnySiblingChecked,
|
|
1273
1290
|
isForceExpanded: isForceExpanded,
|
|
1274
1291
|
groupName: groupName
|
|
1275
1292
|
})]
|
|
1276
1293
|
})
|
|
1277
1294
|
})]
|
|
1278
|
-
},
|
|
1295
|
+
}, `${field.name}-${index}`);
|
|
1279
1296
|
}
|
|
1280
|
-
},
|
|
1297
|
+
}, `${field.name}.${isForceExpanded}`);
|
|
1281
1298
|
})
|
|
1282
1299
|
});
|
|
1283
1300
|
};
|
|
@@ -1290,13 +1307,13 @@ const StyledGroupCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
|
1290
1307
|
const StyledFieldsCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
1291
1308
|
target: "e1igkh7t1"
|
|
1292
1309
|
} )("border-radius:0;", props => props.showTopBorder && /*#__PURE__*/react.css("border-top:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";" + ("" ), "" ), ";" + ("" ));
|
|
1293
|
-
var _ref = {
|
|
1310
|
+
var _ref$1 = {
|
|
1294
1311
|
name: "2ce4ng",
|
|
1295
1312
|
styles: "overflow:hidden;height:0;margin-top:0!important"
|
|
1296
1313
|
} ;
|
|
1297
1314
|
const StyledExpandableContent = /*#__PURE__*/_styled__default["default"]("div", {
|
|
1298
1315
|
target: "e1igkh7t0"
|
|
1299
|
-
} )(props => !props.isOpen && _ref, " ", props => !props.isOpen && props.showTopBorder && /*#__PURE__*/react.css("border-top:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";" + ("" ), "" ), ";" + ("" ));
|
|
1316
|
+
} )(props => !props.isOpen && _ref$1, " ", props => !props.isOpen && props.showTopBorder && /*#__PURE__*/react.css("border-top:", uiKit.designTokens.borderWidth1, " solid ", uiKit.designTokens.colorNeutral90, ";" + ("" ), "" ), ";" + ("" ));
|
|
1300
1317
|
const FieldGroupSection = _ref2 => {
|
|
1301
1318
|
let group = _ref2.group,
|
|
1302
1319
|
index = _ref2.index,
|
|
@@ -1306,7 +1323,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
1306
1323
|
const isAtleastOneFieldChecked = React.useMemo(() => checkAtLeastOneFieldChecked(group.fields), [group.fields]);
|
|
1307
1324
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
1308
1325
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
1309
|
-
const parentKey =
|
|
1326
|
+
const parentKey = `groups[${index}]`;
|
|
1310
1327
|
const handleChangeAllFields = e => {
|
|
1311
1328
|
const item = get__default["default"](_valuesInstanceProperty__default["default"](formik), parentKey);
|
|
1312
1329
|
function updateAllFields(fields, checked) {
|
|
@@ -1389,11 +1406,41 @@ const FieldGroupSection = _ref2 => {
|
|
|
1389
1406
|
})]
|
|
1390
1407
|
});
|
|
1391
1408
|
}
|
|
1392
|
-
},
|
|
1409
|
+
}, `${isForceExpanded}`);
|
|
1410
|
+
};
|
|
1411
|
+
|
|
1412
|
+
var _ref = {
|
|
1413
|
+
name: "ti75j2",
|
|
1414
|
+
styles: "margin:0"
|
|
1415
|
+
} ;
|
|
1416
|
+
const NoSearchResults = () => {
|
|
1417
|
+
return jsxRuntime.jsxs(uiKit.Card, {
|
|
1418
|
+
insetScale: "xl",
|
|
1419
|
+
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
1420
|
+
scale: "s",
|
|
1421
|
+
children: [jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1422
|
+
fontWeight: "medium",
|
|
1423
|
+
intlMessage: messages.thereAreNoResults
|
|
1424
|
+
}), jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1425
|
+
intlMessage: messages.suggestions
|
|
1426
|
+
})]
|
|
1427
|
+
}), jsxRuntime.jsxs("ul", {
|
|
1428
|
+
css: _ref,
|
|
1429
|
+
children: [jsxRuntime.jsx("li", {
|
|
1430
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1431
|
+
intlMessage: messages.checkTheSpelling
|
|
1432
|
+
})
|
|
1433
|
+
}), jsxRuntime.jsx("li", {
|
|
1434
|
+
children: jsxRuntime.jsx(uiKit.Text.Body, {
|
|
1435
|
+
intlMessage: messages.searchByEnteringTheExactFieldName
|
|
1436
|
+
})
|
|
1437
|
+
})]
|
|
1438
|
+
})]
|
|
1439
|
+
});
|
|
1393
1440
|
};
|
|
1394
1441
|
|
|
1395
1442
|
function ownKeys$2(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
1396
|
-
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var
|
|
1443
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var _context5, _context6; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context5 = ownKeys$2(Object(t), !0)).call(_context5, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context6 = ownKeys$2(Object(t))).call(_context6, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1397
1444
|
const StyledGridCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
1398
1445
|
target: "e5mvpn60"
|
|
1399
1446
|
} )({
|
|
@@ -1401,20 +1448,16 @@ const StyledGridCard = /*#__PURE__*/_styled__default["default"](uiKit.Card, {
|
|
|
1401
1448
|
styles: "max-height:50vh;overflow:auto"
|
|
1402
1449
|
} );
|
|
1403
1450
|
const ExportFieldsSelectionStep = () => {
|
|
1404
|
-
var _context, _context7, _context8;
|
|
1405
1451
|
const intl = reactIntl.useIntl();
|
|
1406
1452
|
const _React$useState = React__default["default"].useState(''),
|
|
1407
1453
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1408
1454
|
fieldSearchTerm = _React$useState2[0],
|
|
1409
1455
|
setFieldSearchTerm = _React$useState2[1];
|
|
1410
|
-
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => {
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
projectKey: (_context$project = context.project) === null || _context$project === void 0 ? void 0 : _context$project.key
|
|
1414
|
-
};
|
|
1415
|
-
}),
|
|
1456
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(context => ({
|
|
1457
|
+
projectKey: context.project?.key
|
|
1458
|
+
})),
|
|
1416
1459
|
projectKey = _useApplicationContex.projectKey;
|
|
1417
|
-
const _useStorage = experimentalComponents.useStorage(
|
|
1460
|
+
const _useStorage = experimentalComponents.useStorage(`${projectKey}/${OPERATIONS_EXPORT_RESOURCES_MODAL_SELECTION}`, {}),
|
|
1418
1461
|
_useStorage2 = _slicedToArray(_useStorage, 2);
|
|
1419
1462
|
_useStorage2[0];
|
|
1420
1463
|
const setCachedSelectedGroups = _useStorage2[1];
|
|
@@ -1424,19 +1467,18 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1424
1467
|
resourceType = _useExportResourcesCo.resourceType,
|
|
1425
1468
|
onClose = _useExportResourcesCo.onClose;
|
|
1426
1469
|
React__default["default"].useEffect(() => {
|
|
1427
|
-
var
|
|
1470
|
+
var _context2;
|
|
1428
1471
|
formik.validateForm();
|
|
1429
1472
|
const selectedFields = {};
|
|
1430
1473
|
function getSelectedFields(field, groupName) {
|
|
1431
|
-
|
|
1432
|
-
const fieldName = field.name ? _concatInstanceProperty__default["default"](_context2 = "".concat(groupName, ".")).call(_context2, field.name) : groupName;
|
|
1474
|
+
const fieldName = field.name ? `${groupName}.${field.name}` : groupName;
|
|
1433
1475
|
if (field.fields) {
|
|
1434
|
-
var
|
|
1435
|
-
return _forEachInstanceProperty__default["default"](
|
|
1476
|
+
var _context;
|
|
1477
|
+
return _forEachInstanceProperty__default["default"](_context = field.fields).call(_context, f => getSelectedFields(f, fieldName));
|
|
1436
1478
|
}
|
|
1437
1479
|
selectedFields[fieldName] = field.isChecked;
|
|
1438
1480
|
}
|
|
1439
|
-
_forEachInstanceProperty__default["default"](
|
|
1481
|
+
_forEachInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](formik).groups).call(_context2, group => getSelectedFields(group, group.groupLabel));
|
|
1440
1482
|
setCachedSelectedGroups({
|
|
1441
1483
|
[resourceType]: selectedFields
|
|
1442
1484
|
});
|
|
@@ -1444,11 +1486,11 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1444
1486
|
}, [_valuesInstanceProperty__default["default"](formik).groups]);
|
|
1445
1487
|
// adds `isHidden` property to each field based on search term
|
|
1446
1488
|
const filteredGroups = React__default["default"].useMemo(() => {
|
|
1447
|
-
var
|
|
1489
|
+
var _context4;
|
|
1448
1490
|
const updateFields = (fields, parentMatches) => {
|
|
1449
1491
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1450
|
-
var
|
|
1451
|
-
const matches = _includesInstanceProperty__default["default"](
|
|
1492
|
+
var _context3;
|
|
1493
|
+
const matches = _includesInstanceProperty__default["default"](_context3 = field.label.toLowerCase()).call(_context3, fieldSearchTerm.toLowerCase());
|
|
1452
1494
|
let isHidden = !matches && !parentMatches;
|
|
1453
1495
|
if (field.fields) {
|
|
1454
1496
|
const updatedFields = updateFields(field.fields, matches);
|
|
@@ -1462,8 +1504,8 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1462
1504
|
});
|
|
1463
1505
|
});
|
|
1464
1506
|
};
|
|
1465
|
-
if (!
|
|
1466
|
-
return _mapInstanceProperty__default["default"](
|
|
1507
|
+
if (!fieldSearchTerm?.trim()?.length) return _valuesInstanceProperty__default["default"](formik).groups;
|
|
1508
|
+
return _mapInstanceProperty__default["default"](_context4 = _valuesInstanceProperty__default["default"](formik).groups).call(_context4, group => {
|
|
1467
1509
|
const updatedFields = updateFields(group.fields, false);
|
|
1468
1510
|
const isHidden = _everyInstanceProperty__default["default"](updatedFields).call(updatedFields, field => field.isHidden);
|
|
1469
1511
|
return _objectSpread$2(_objectSpread$2({}, group), {}, {
|
|
@@ -1507,16 +1549,13 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1507
1549
|
insetScale: "none",
|
|
1508
1550
|
children: jsxRuntime.jsx(uiKit.Grid, {
|
|
1509
1551
|
gridAutoFlow: "row",
|
|
1510
|
-
gridTemplateColumns:
|
|
1511
|
-
children: _mapInstanceProperty__default["default"](filteredGroups).call(filteredGroups, (group, index) => {
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
isForceExpanded: (fieldSearchTerm === null || fieldSearchTerm === void 0 || (_fieldSearchTerm$trim2 = _trimInstanceProperty__default["default"](fieldSearchTerm).call(fieldSearchTerm)) === null || _fieldSearchTerm$trim2 === void 0 ? void 0 : _fieldSearchTerm$trim2.length) > 0
|
|
1518
|
-
}, group.groupLabel);
|
|
1519
|
-
})
|
|
1552
|
+
gridTemplateColumns: `calc(${uiKit.designTokens.spacingL} + ${uiKit.designTokens.constraint5} + ${uiKit.designTokens.spacingL}) auto`,
|
|
1553
|
+
children: _mapInstanceProperty__default["default"](filteredGroups).call(filteredGroups, (group, index) => jsxRuntime.jsx(FieldGroupSection, {
|
|
1554
|
+
group: group,
|
|
1555
|
+
index: index,
|
|
1556
|
+
formik: formik,
|
|
1557
|
+
isForceExpanded: fieldSearchTerm?.trim()?.length > 0
|
|
1558
|
+
}, group.groupLabel))
|
|
1520
1559
|
})
|
|
1521
1560
|
}) : jsxRuntime.jsx(NoSearchResults, {})]
|
|
1522
1561
|
})
|
|
@@ -1617,8 +1656,8 @@ const loadMessages = async locale => {
|
|
|
1617
1656
|
return i18n.parseChunkImport(chunkImport);
|
|
1618
1657
|
} catch (error) {
|
|
1619
1658
|
// eslint-disable-next-line no-console
|
|
1620
|
-
console.warn(
|
|
1621
|
-
sentry.reportErrorToSentry(new Error(
|
|
1659
|
+
console.warn(`Something went wrong while loading the export-resources-modal messages for ${locale}`, error);
|
|
1660
|
+
sentry.reportErrorToSentry(new Error(`Something went wrong while loading the export-resources-modal messages for ${locale}`), {
|
|
1622
1661
|
extra: error
|
|
1623
1662
|
});
|
|
1624
1663
|
return {};
|