@commercetools-frontend-extensions/export-resources-modal 0.0.0-canary-20240903083427 → 0.0.0-canary-20240904084742
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/README.md +4 -8
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +269 -140
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +263 -134
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +266 -138
- package/dist/declarations/src/@hooks/index.d.ts +4 -0
- package/dist/declarations/src/@hooks/use-convert-custom-type-definitions-for-export.d.ts +8 -0
- package/dist/declarations/src/@hooks/use-export-resources-modal-context.d.ts +2 -0
- package/dist/declarations/src/@hooks/use-initial-values.d.ts +2 -0
- package/dist/declarations/src/@hooks/use-start-export-operation.d.ts +4 -0
- package/dist/declarations/src/@types/custom-type-definition.d.ts +38 -0
- package/dist/declarations/src/@types/export-api.d.ts +3 -1
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +1 -2
- package/dist/declarations/src/@types/form.d.ts +0 -3
- package/dist/declarations/src/@types/index.d.ts +1 -0
- package/dist/declarations/src/index.d.ts +1 -0
- package/package.json +3 -1
|
@@ -31,24 +31,25 @@ var _reduceInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/ins
|
|
|
31
31
|
var experimentalComponents = require('@commercetools-frontend/experimental-components');
|
|
32
32
|
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
33
33
|
var omitEmpty = require('omit-empty-es');
|
|
34
|
+
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
35
|
+
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
36
|
+
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
34
37
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
35
38
|
var _Array$isArray = require('@babel/runtime-corejs3/core-js-stable/array/is-array');
|
|
36
39
|
var _Set = require('@babel/runtime-corejs3/core-js-stable/set');
|
|
37
40
|
var _sortInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/sort');
|
|
38
41
|
var _indexOfInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/index-of');
|
|
39
42
|
var moment = require('moment');
|
|
40
|
-
var _someInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/some');
|
|
41
|
-
var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
|
|
42
|
-
var _everyInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/every');
|
|
43
43
|
var actionsGlobal = require('@commercetools-frontend/actions-global');
|
|
44
44
|
var constants = require('@commercetools-frontend/constants');
|
|
45
45
|
var sdk = require('@commercetools-frontend/sdk');
|
|
46
|
+
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
47
|
+
var l10n = require('@commercetools-frontend/l10n');
|
|
46
48
|
var _styled = require('@emotion/styled/base');
|
|
47
49
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
48
50
|
var throttle = require('lodash/throttle');
|
|
49
51
|
var react = require('@emotion/react');
|
|
50
52
|
var get = require('lodash/get');
|
|
51
|
-
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
52
53
|
var formik = require('formik');
|
|
53
54
|
var i18n = require('@commercetools-frontend/i18n');
|
|
54
55
|
var sentry = require('@commercetools-frontend/sentry');
|
|
@@ -69,15 +70,15 @@ var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construc
|
|
|
69
70
|
var _reduceInstanceProperty__default = /*#__PURE__*/_interopDefault(_reduceInstanceProperty);
|
|
70
71
|
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
71
72
|
var omitEmpty__default = /*#__PURE__*/_interopDefault(omitEmpty);
|
|
73
|
+
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
74
|
+
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
75
|
+
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
72
76
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
73
77
|
var _Array$isArray__default = /*#__PURE__*/_interopDefault(_Array$isArray);
|
|
74
78
|
var _Set__default = /*#__PURE__*/_interopDefault(_Set);
|
|
75
79
|
var _sortInstanceProperty__default = /*#__PURE__*/_interopDefault(_sortInstanceProperty);
|
|
76
80
|
var _indexOfInstanceProperty__default = /*#__PURE__*/_interopDefault(_indexOfInstanceProperty);
|
|
77
81
|
var moment__default = /*#__PURE__*/_interopDefault(moment);
|
|
78
|
-
var _someInstanceProperty__default = /*#__PURE__*/_interopDefault(_someInstanceProperty);
|
|
79
|
-
var _findInstanceProperty__default = /*#__PURE__*/_interopDefault(_findInstanceProperty);
|
|
80
|
-
var _everyInstanceProperty__default = /*#__PURE__*/_interopDefault(_everyInstanceProperty);
|
|
81
82
|
var _styled__default = /*#__PURE__*/_interopDefault(_styled);
|
|
82
83
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
83
84
|
var throttle__default = /*#__PURE__*/_interopDefault(throttle);
|
|
@@ -116,6 +117,11 @@ var messages = reactIntl.defineMessages({
|
|
|
116
117
|
description: 'Label for the discount codes modal title',
|
|
117
118
|
defaultMessage: 'Export discount codes'
|
|
118
119
|
},
|
|
120
|
+
'modalTitle.customer': {
|
|
121
|
+
id: 'ExportResourcesModal.modalTitle.customer',
|
|
122
|
+
description: 'Label for the customers modal title',
|
|
123
|
+
defaultMessage: 'Export customers'
|
|
124
|
+
},
|
|
119
125
|
outputFormat: {
|
|
120
126
|
id: 'ExportResourcesModal.outputFormat',
|
|
121
127
|
description: 'File format like (csv, xls, ...etc)',
|
|
@@ -362,14 +368,14 @@ var messages = reactIntl.defineMessages({
|
|
|
362
368
|
}
|
|
363
369
|
});
|
|
364
370
|
|
|
365
|
-
function ownKeys$
|
|
366
|
-
function _objectSpread$
|
|
371
|
+
function ownKeys$7(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
372
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys$7(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys$7(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
367
373
|
function renderFileNameError(key) {
|
|
368
374
|
switch (key) {
|
|
369
375
|
case 'missing':
|
|
370
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
376
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.missingFileNameError));
|
|
371
377
|
case 'invalidInput':
|
|
372
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
378
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.invalidFileNameError));
|
|
373
379
|
default:
|
|
374
380
|
return null;
|
|
375
381
|
}
|
|
@@ -377,7 +383,7 @@ function renderFileNameError(key) {
|
|
|
377
383
|
function renderLocaleError(key) {
|
|
378
384
|
switch (key) {
|
|
379
385
|
case 'missing':
|
|
380
|
-
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$
|
|
386
|
+
return jsxRuntime.jsx(reactIntl.FormattedMessage, _objectSpread$7({}, messages.missingLocaleError));
|
|
381
387
|
default:
|
|
382
388
|
return null;
|
|
383
389
|
}
|
|
@@ -524,14 +530,99 @@ function useExportResourcesModalContext() {
|
|
|
524
530
|
return context;
|
|
525
531
|
}
|
|
526
532
|
|
|
527
|
-
|
|
528
|
-
return fields
|
|
529
|
-
|
|
530
|
-
|
|
533
|
+
const isAnyFieldChecked = fields => {
|
|
534
|
+
return _someInstanceProperty__default["default"](fields).call(fields, field => field.isChecked || field.fields && isAnyFieldChecked(field.fields));
|
|
535
|
+
};
|
|
536
|
+
const hasDependentFields = field => {
|
|
537
|
+
var _context;
|
|
538
|
+
return Boolean(field?.dependentGroupNames && field.dependentGroupNames.length > 0 || field?.dependentFieldNames && field.dependentFieldNames.length > 0 || field?.fields && _someInstanceProperty__default["default"](_context = field.fields).call(_context, nestedField => hasDependentFields(nestedField)));
|
|
539
|
+
};
|
|
540
|
+
const isFieldOrNestedFieldChecked = (field, fieldName) => {
|
|
541
|
+
if (field.name === fieldName && field.isChecked) {
|
|
542
|
+
return true;
|
|
543
|
+
}
|
|
544
|
+
if (field.fields) {
|
|
545
|
+
var _context2;
|
|
546
|
+
return _someInstanceProperty__default["default"](_context2 = field.fields).call(_context2, nestedField => {
|
|
547
|
+
return nestedField.isChecked || isFieldOrNestedFieldChecked(nestedField, fieldName);
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
return false;
|
|
551
|
+
};
|
|
552
|
+
const getIndependentFields = group => {
|
|
553
|
+
const independentFields = [];
|
|
554
|
+
const findIndependentFields = fields => {
|
|
555
|
+
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
556
|
+
if (!field.dependentGroupNames?.length && !field.dependentFieldNames?.length) {
|
|
557
|
+
independentFields.push(field);
|
|
558
|
+
}
|
|
559
|
+
if (field.fields) {
|
|
560
|
+
findIndependentFields(field.fields);
|
|
561
|
+
}
|
|
562
|
+
});
|
|
563
|
+
};
|
|
564
|
+
findIndependentFields(group.fields);
|
|
565
|
+
return independentFields;
|
|
566
|
+
};
|
|
567
|
+
const checkDependentFields = (independentFields, dependentFieldNames) => {
|
|
568
|
+
return _someInstanceProperty__default["default"](dependentFieldNames).call(dependentFieldNames, fieldName => _someInstanceProperty__default["default"](independentFields).call(independentFields, field => {
|
|
569
|
+
if (field.name === fieldName) {
|
|
570
|
+
if (field.fields) {
|
|
571
|
+
var _context3;
|
|
572
|
+
return _someInstanceProperty__default["default"](_context3 = field.fields).call(_context3, nestedField => isFieldOrNestedFieldChecked(nestedField, fieldName));
|
|
573
|
+
}
|
|
574
|
+
if (isFieldOrNestedFieldChecked(field, fieldName)) {
|
|
575
|
+
return true;
|
|
576
|
+
}
|
|
531
577
|
}
|
|
532
|
-
return
|
|
578
|
+
return false;
|
|
579
|
+
}));
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Checks if any dependent fields are checked within the field groups
|
|
584
|
+
*
|
|
585
|
+
* This function iterates over the provided dependent group names and checks if any fields within those groups
|
|
586
|
+
* are checked. It considers both independent fields and their nested fields within
|
|
587
|
+
* the specified dependent field names
|
|
588
|
+
*
|
|
589
|
+
* @param groups - The array of field groups
|
|
590
|
+
* @param dependentGroupNames - The names of the groups to check for dependencies
|
|
591
|
+
* @param dependentFieldNames - The names of the fields to check within the groups
|
|
592
|
+
* @returns True if any dependent fields are checked otherwise false
|
|
593
|
+
*/
|
|
594
|
+
const isAnyDependentChecked = function (groups) {
|
|
595
|
+
let dependentGroupNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
596
|
+
let dependentFieldNames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
597
|
+
return _someInstanceProperty__default["default"](dependentGroupNames).call(dependentGroupNames, groupName => {
|
|
598
|
+
const group = _findInstanceProperty__default["default"](groups).call(groups, g => g.groupName === groupName);
|
|
599
|
+
if (group) {
|
|
600
|
+
const independentFields = getIndependentFields(group);
|
|
601
|
+
const isADependentFieldChecked = isAnyFieldChecked(independentFields);
|
|
602
|
+
const isFieldDependentChecked = checkDependentFields(independentFields, dependentFieldNames);
|
|
603
|
+
if (dependentFieldNames.length > 0) {
|
|
604
|
+
return isADependentFieldChecked && isFieldDependentChecked;
|
|
605
|
+
}
|
|
606
|
+
return isADependentFieldChecked || isFieldDependentChecked;
|
|
607
|
+
}
|
|
608
|
+
return false;
|
|
533
609
|
});
|
|
534
|
-
}
|
|
610
|
+
};
|
|
611
|
+
const areAllFieldsChecked = fields => {
|
|
612
|
+
return _everyInstanceProperty__default["default"](fields).call(fields, field => field.fields ? areAllFieldsChecked(field.fields) : field.isChecked || field.isRequired || hasDependentFields(field));
|
|
613
|
+
};
|
|
614
|
+
const getTotalCheckedFields = group => {
|
|
615
|
+
const countCheckedFields = fields => {
|
|
616
|
+
return _reduceInstanceProperty__default["default"](fields).call(fields, (total, field) => {
|
|
617
|
+
if (field.fields) {
|
|
618
|
+
return total + countCheckedFields(field.fields);
|
|
619
|
+
}
|
|
620
|
+
return total + (field.isChecked ? 1 : 0);
|
|
621
|
+
}, 0);
|
|
622
|
+
};
|
|
623
|
+
return countCheckedFields(group.fields);
|
|
624
|
+
};
|
|
625
|
+
|
|
535
626
|
function validate(_ref) {
|
|
536
627
|
let values = _valuesInstanceProperty__default["default"](_ref),
|
|
537
628
|
step = _ref.step;
|
|
@@ -554,8 +645,8 @@ function validate(_ref) {
|
|
|
554
645
|
if (step === 2) {
|
|
555
646
|
const allFields = _reduceInstanceProperty__default["default"](groups).call(groups, (acc, group) => _concatInstanceProperty__default["default"](acc).call(acc, group.fields), []);
|
|
556
647
|
const checkedFieldsCount = _filterInstanceProperty__default["default"](allFields).call(allFields, field => {
|
|
557
|
-
if (field.fields) return
|
|
558
|
-
return !field.isRequired &&
|
|
648
|
+
if (field.fields) return isAnyFieldChecked(field.fields);
|
|
649
|
+
return !field.isRequired && field.isChecked;
|
|
559
650
|
}).length;
|
|
560
651
|
if (checkedFieldsCount < 1) {
|
|
561
652
|
errors.fields.missing = true;
|
|
@@ -657,8 +748,8 @@ function getInitialExportType(args) {
|
|
|
657
748
|
return EXPORT_TYPES.ALL;
|
|
658
749
|
}
|
|
659
750
|
|
|
660
|
-
function ownKeys$
|
|
661
|
-
function _objectSpread$
|
|
751
|
+
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; }
|
|
752
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var _context2, _context3; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context2 = ownKeys$6(Object(t), !0)).call(_context2, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context3 = ownKeys$6(Object(t))).call(_context3, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
662
753
|
const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
663
754
|
const updateFields = (fields, isParentChecked, parentFieldPath) => {
|
|
664
755
|
return _mapInstanceProperty__default["default"](fields).call(fields, field => {
|
|
@@ -668,7 +759,7 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
668
759
|
} else {
|
|
669
760
|
if (cachedSelectedGroups[`${parentFieldPath}.${field.name}`] !== undefined) {
|
|
670
761
|
isChecked = cachedSelectedGroups[`${parentFieldPath}.${field.name}`];
|
|
671
|
-
} else if (!field
|
|
762
|
+
} else if (!hasDependentFields(field) && field.isSelectedByDefault) {
|
|
672
763
|
isChecked = true;
|
|
673
764
|
} else if (isParentChecked) {
|
|
674
765
|
isChecked = true;
|
|
@@ -679,7 +770,7 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
679
770
|
updatedFields = updateFields(field.fields, isChecked, `${parentFieldPath}.${field.name}`);
|
|
680
771
|
isChecked = false;
|
|
681
772
|
}
|
|
682
|
-
return _objectSpread$
|
|
773
|
+
return _objectSpread$6(_objectSpread$6({}, field), {}, {
|
|
683
774
|
isChecked,
|
|
684
775
|
fields: updatedFields
|
|
685
776
|
});
|
|
@@ -687,7 +778,7 @@ const updateFieldGroupsWithIsCheckedValue = (groups, cachedSelectedGroups) => {
|
|
|
687
778
|
};
|
|
688
779
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
689
780
|
const updatedFields = updateFields(group.fields, false, group.groupName);
|
|
690
|
-
return _objectSpread$
|
|
781
|
+
return _objectSpread$6(_objectSpread$6({}, group), {}, {
|
|
691
782
|
fields: updatedFields
|
|
692
783
|
});
|
|
693
784
|
});
|
|
@@ -699,7 +790,7 @@ const updateFieldGroupWithAdditionalFieldExtensions = groups => {
|
|
|
699
790
|
if (field.fields) {
|
|
700
791
|
field.fields = updateAdditionalFieldExtensions(field.fields, updatedAdditionalFieldExtensions);
|
|
701
792
|
}
|
|
702
|
-
return _objectSpread$
|
|
793
|
+
return _objectSpread$6(_objectSpread$6({}, field), {}, {
|
|
703
794
|
additionalFieldExtensions: updatedAdditionalFieldExtensions
|
|
704
795
|
});
|
|
705
796
|
});
|
|
@@ -716,9 +807,9 @@ const updateFieldGroupWithAdditionalFieldExtensions = groups => {
|
|
|
716
807
|
}, []);
|
|
717
808
|
}
|
|
718
809
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
719
|
-
return _objectSpread$
|
|
810
|
+
return _objectSpread$6(_objectSpread$6({}, group), {}, {
|
|
720
811
|
dependentGroupNames: combineDependentGroupNames(group.fields),
|
|
721
|
-
fields: updateAdditionalFieldExtensions(group.fields,
|
|
812
|
+
fields: updateAdditionalFieldExtensions(group.fields, [])
|
|
722
813
|
});
|
|
723
814
|
});
|
|
724
815
|
};
|
|
@@ -733,7 +824,7 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
733
824
|
field.fields = updateFields(field.fields, groupName);
|
|
734
825
|
}
|
|
735
826
|
if (isExpanded !== null) {
|
|
736
|
-
return _objectSpread$
|
|
827
|
+
return _objectSpread$6(_objectSpread$6({}, field), {}, {
|
|
737
828
|
isExpanded
|
|
738
829
|
});
|
|
739
830
|
}
|
|
@@ -742,7 +833,7 @@ const updateFieldGroupsWithIsExpandedValue = (groups, cachedExpandedGroups) => {
|
|
|
742
833
|
}
|
|
743
834
|
return _mapInstanceProperty__default["default"](groups).call(groups, group => {
|
|
744
835
|
const updatedFields = updateFields(group.fields, group.groupName);
|
|
745
|
-
return _objectSpread$
|
|
836
|
+
return _objectSpread$6(_objectSpread$6({}, group), {}, {
|
|
746
837
|
isExpanded: cachedExpandedGroups[group.groupName] ?? group.isExpanded ?? false,
|
|
747
838
|
fields: updatedFields
|
|
748
839
|
});
|
|
@@ -755,35 +846,28 @@ const mapFormikErrors = error => {
|
|
|
755
846
|
};
|
|
756
847
|
}
|
|
757
848
|
if (_Array$isArray__default["default"](error)) {
|
|
758
|
-
return _reduceInstanceProperty__default["default"](error).call(error, (errorAggregator, currentError) => _objectSpread$
|
|
849
|
+
return _reduceInstanceProperty__default["default"](error).call(error, (errorAggregator, currentError) => _objectSpread$6(_objectSpread$6({}, errorAggregator), {}, {
|
|
759
850
|
[currentError]: true
|
|
760
851
|
}), {});
|
|
761
852
|
}
|
|
762
853
|
if (!error) return {};
|
|
763
854
|
return error;
|
|
764
855
|
};
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if (
|
|
774
|
-
|
|
856
|
+
const updateFieldDependenciesStatus = formik => {
|
|
857
|
+
var _context;
|
|
858
|
+
const updateFields = (fields, path) => {
|
|
859
|
+
_forEachInstanceProperty__default["default"](fields).call(fields, (field, index) => {
|
|
860
|
+
const currentPath = `${path}.fields[${index}]`;
|
|
861
|
+
if (hasDependentFields(field)) {
|
|
862
|
+
formik.setFieldValue(`${currentPath}.isChecked`, isAnyDependentChecked(_valuesInstanceProperty__default["default"](formik).groups, field.dependentGroupNames, field.dependentFieldNames), false);
|
|
863
|
+
}
|
|
864
|
+
if (field.fields) {
|
|
865
|
+
updateFields(field.fields, currentPath);
|
|
775
866
|
}
|
|
776
|
-
return result;
|
|
777
867
|
});
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
};
|
|
781
|
-
const checkAllFieldsSelected = fields => {
|
|
782
|
-
return _everyInstanceProperty__default["default"](fields).call(fields, field => {
|
|
783
|
-
if (field.fields) {
|
|
784
|
-
return checkAllFieldsSelected(field.fields);
|
|
785
|
-
}
|
|
786
|
-
return field.isChecked || field.isRequired || field.isReadOnly;
|
|
868
|
+
};
|
|
869
|
+
_forEachInstanceProperty__default["default"](_context = _valuesInstanceProperty__default["default"](formik).groups).call(_context, (group, index) => {
|
|
870
|
+
updateFields(group.fields, `groups[${index}]`);
|
|
787
871
|
});
|
|
788
872
|
};
|
|
789
873
|
|
|
@@ -864,21 +948,21 @@ const useStartExportOperation = props => {
|
|
|
864
948
|
})),
|
|
865
949
|
projectKey = _useApplicationContex.projectKey;
|
|
866
950
|
const extractFieldNamesFromGroups = groups => {
|
|
867
|
-
let
|
|
868
|
-
const
|
|
951
|
+
let checkedFields = [];
|
|
952
|
+
const getCheckedFields = fields => {
|
|
869
953
|
return _filterInstanceProperty__default["default"](fields).call(fields, field => {
|
|
870
954
|
if (field.fields) {
|
|
871
|
-
return
|
|
955
|
+
return getCheckedFields(field.fields);
|
|
872
956
|
}
|
|
873
|
-
if (field.isChecked)
|
|
957
|
+
if (field.isChecked) checkedFields.push(field);
|
|
874
958
|
return field.isChecked ?? false;
|
|
875
959
|
});
|
|
876
960
|
};
|
|
877
961
|
_forEachInstanceProperty__default["default"](groups).call(groups, group => {
|
|
878
|
-
|
|
962
|
+
getCheckedFields(group.fields);
|
|
879
963
|
});
|
|
880
964
|
return sortFieldsByFieldOrder({
|
|
881
|
-
fieldNames: extractFieldNamesAndAdditionalFieldExtensions(
|
|
965
|
+
fieldNames: extractFieldNamesAndAdditionalFieldExtensions(checkedFields),
|
|
882
966
|
fieldOrder: props.fieldOrder
|
|
883
967
|
});
|
|
884
968
|
};
|
|
@@ -886,6 +970,20 @@ const useStartExportOperation = props => {
|
|
|
886
970
|
try {
|
|
887
971
|
if (!projectKey) throw new Error('Project key is missing');
|
|
888
972
|
const fields = extractFieldNamesFromGroups(values.groups);
|
|
973
|
+
let where = undefined;
|
|
974
|
+
let filters = undefined;
|
|
975
|
+
if (exportType === EXPORT_TYPES.SELECTED && props.selectedResourceIds?.length) {
|
|
976
|
+
where = buildSelectedExportFilters(props.selectedResourceIds);
|
|
977
|
+
} else if (exportType === EXPORT_TYPES.FILTERED) {
|
|
978
|
+
if (props.filters?.queryPredicate) {
|
|
979
|
+
where = props.filters.queryPredicate;
|
|
980
|
+
}
|
|
981
|
+
if (props.filters?.searchQuery) {
|
|
982
|
+
filters = {
|
|
983
|
+
query: props.filters.searchQuery
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
}
|
|
889
987
|
const response = await createExportOperation({
|
|
890
988
|
projectKey,
|
|
891
989
|
resourceType: props.resourceType,
|
|
@@ -893,8 +991,8 @@ const useStartExportOperation = props => {
|
|
|
893
991
|
fileFormat: values.outputFormat,
|
|
894
992
|
locales: values.locales,
|
|
895
993
|
fields,
|
|
896
|
-
where
|
|
897
|
-
filters
|
|
994
|
+
where,
|
|
995
|
+
filters
|
|
898
996
|
}, asyncDispatch);
|
|
899
997
|
switch (response.state) {
|
|
900
998
|
case EXPORT_OPERATION_STATES.QUEUED:
|
|
@@ -933,6 +1031,82 @@ const useStartExportOperation = props => {
|
|
|
933
1031
|
};
|
|
934
1032
|
};
|
|
935
1033
|
|
|
1034
|
+
const _excluded$1 = ["fieldDefinitions"];
|
|
1035
|
+
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; }
|
|
1036
|
+
function _objectSpread$5(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$5(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$5(Object(t))).call(_context4, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
1037
|
+
const customFieldKey = 'custom.fields';
|
|
1038
|
+
const getCustomFieldFullName = _ref => {
|
|
1039
|
+
var _context;
|
|
1040
|
+
let customFieldPrefix = _ref.customFieldPrefix,
|
|
1041
|
+
key = _ref.key;
|
|
1042
|
+
return _filterInstanceProperty__default["default"](_context = [customFieldPrefix, customFieldKey, key]).call(_context, Boolean).join('.');
|
|
1043
|
+
};
|
|
1044
|
+
const transformAndLocalizeTypeDefinitions = function () {
|
|
1045
|
+
let typeDefinitions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
1046
|
+
return _mapInstanceProperty__default["default"](typeDefinitions).call(typeDefinitions, _ref2 => {
|
|
1047
|
+
let fieldDefinitions = _ref2.fieldDefinitions,
|
|
1048
|
+
typeDefinition = _objectWithoutProperties(_ref2, _excluded$1);
|
|
1049
|
+
return {
|
|
1050
|
+
type: l10n.applyTransformedLocalizedFields(typeDefinition, [{
|
|
1051
|
+
from: 'nameAllLocales',
|
|
1052
|
+
to: 'name'
|
|
1053
|
+
}]),
|
|
1054
|
+
fields: _mapInstanceProperty__default["default"](fieldDefinitions).call(fieldDefinitions, fieldDefinition => _objectSpread$5({}, l10n.applyTransformedLocalizedFields(fieldDefinition, [{
|
|
1055
|
+
from: 'labelAllLocales',
|
|
1056
|
+
to: 'label'
|
|
1057
|
+
}])))
|
|
1058
|
+
};
|
|
1059
|
+
});
|
|
1060
|
+
};
|
|
1061
|
+
const useConvertCustomTypeDefinitionsForExport = () => {
|
|
1062
|
+
const _useApplicationContex = applicationShellConnectors.useApplicationContext(applicationContext => ({
|
|
1063
|
+
language: applicationContext.dataLocale,
|
|
1064
|
+
languages: applicationContext.project?.languages
|
|
1065
|
+
})),
|
|
1066
|
+
language = _useApplicationContex.language,
|
|
1067
|
+
languages = _useApplicationContex.languages;
|
|
1068
|
+
const convertCustomTypeDefinitionsForExport = _ref3 => {
|
|
1069
|
+
let customTypeDefinitions = _ref3.customTypeDefinitions,
|
|
1070
|
+
customFieldPrefix = _ref3.customFieldPrefix,
|
|
1071
|
+
expandAll = _ref3.expandAll;
|
|
1072
|
+
if (!customTypeDefinitions) return [];
|
|
1073
|
+
const transformedCustomTypeDefinitions = transformAndLocalizeTypeDefinitions(customTypeDefinitions);
|
|
1074
|
+
return _mapInstanceProperty__default["default"](transformedCustomTypeDefinitions).call(transformedCustomTypeDefinitions, customTypeDefinition => {
|
|
1075
|
+
var _context2;
|
|
1076
|
+
return {
|
|
1077
|
+
isExpandable: true,
|
|
1078
|
+
isExpanded: expandAll,
|
|
1079
|
+
name: customTypeDefinition.type.key,
|
|
1080
|
+
label: l10n.formatLocalizedString({
|
|
1081
|
+
nameAllLocales: customTypeDefinition.type.name
|
|
1082
|
+
}, {
|
|
1083
|
+
key: 'nameAllLocales',
|
|
1084
|
+
locale: language,
|
|
1085
|
+
fallbackOrder: languages,
|
|
1086
|
+
fallback: customTypeDefinition.type.key
|
|
1087
|
+
}),
|
|
1088
|
+
fields: _mapInstanceProperty__default["default"](_context2 = customTypeDefinition.fields).call(_context2, fieldDefinition => ({
|
|
1089
|
+
name: getCustomFieldFullName({
|
|
1090
|
+
customFieldPrefix: customFieldPrefix,
|
|
1091
|
+
key: fieldDefinition.name
|
|
1092
|
+
}),
|
|
1093
|
+
label: l10n.formatLocalizedString({
|
|
1094
|
+
labelAllLocales: fieldDefinition.label
|
|
1095
|
+
}, {
|
|
1096
|
+
key: 'labelAllLocales',
|
|
1097
|
+
locale: language,
|
|
1098
|
+
fallbackOrder: languages,
|
|
1099
|
+
fallback: fieldDefinition.name
|
|
1100
|
+
})
|
|
1101
|
+
}))
|
|
1102
|
+
};
|
|
1103
|
+
});
|
|
1104
|
+
};
|
|
1105
|
+
return {
|
|
1106
|
+
convertCustomTypeDefinitionsForExport
|
|
1107
|
+
};
|
|
1108
|
+
};
|
|
1109
|
+
|
|
936
1110
|
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; }
|
|
937
1111
|
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; }
|
|
938
1112
|
function ExportScopeSection() {
|
|
@@ -1122,50 +1296,8 @@ const useExportFieldSelectionContext = () => {
|
|
|
1122
1296
|
return React.useContext(ExportFieldSelectionContext);
|
|
1123
1297
|
};
|
|
1124
1298
|
|
|
1125
|
-
const calculateTotalSelectedFields = (group, formik) => {
|
|
1126
|
-
let result = 0;
|
|
1127
|
-
// Check `isChecked` fields
|
|
1128
|
-
function countSelectedFields(fields) {
|
|
1129
|
-
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1130
|
-
if (field.fields) {
|
|
1131
|
-
countSelectedFields(field.fields);
|
|
1132
|
-
} else if (field.isChecked) {
|
|
1133
|
-
result += 1;
|
|
1134
|
-
}
|
|
1135
|
-
});
|
|
1136
|
-
}
|
|
1137
|
-
countSelectedFields(group.fields);
|
|
1138
|
-
// check `isReadOnly` fields
|
|
1139
|
-
function countReadOnlyDependentFields(fields) {
|
|
1140
|
-
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1141
|
-
if (field.fields) {
|
|
1142
|
-
countReadOnlyDependentFields(field.fields);
|
|
1143
|
-
} else if (field.dependentGroupNames?.length && isAnyDependentGroupChecked(field.dependentGroupNames, _valuesInstanceProperty__default["default"](formik).groups)) {
|
|
1144
|
-
result += 1;
|
|
1145
|
-
}
|
|
1146
|
-
});
|
|
1147
|
-
}
|
|
1148
|
-
function countReadOnlyFields(fields) {
|
|
1149
|
-
_forEachInstanceProperty__default["default"](fields).call(fields, field => {
|
|
1150
|
-
if (field.fields) {
|
|
1151
|
-
countReadOnlyFields(field.fields);
|
|
1152
|
-
} else if (field.isReadOnly && !field.dependentGroupNames?.length) {
|
|
1153
|
-
result += 1;
|
|
1154
|
-
}
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
if (result > 0) {
|
|
1158
|
-
countReadOnlyFields(group.fields);
|
|
1159
|
-
}
|
|
1160
|
-
if (group.dependentGroupNames) {
|
|
1161
|
-
countReadOnlyDependentFields(group.fields);
|
|
1162
|
-
}
|
|
1163
|
-
return result;
|
|
1164
|
-
};
|
|
1165
1299
|
const ExportFieldSelectionStamp = _ref => {
|
|
1166
1300
|
let group = _ref.group;
|
|
1167
|
-
const _useExportResourcesMo = useExportResourcesModalContext(),
|
|
1168
|
-
formik = _useExportResourcesMo.formik;
|
|
1169
1301
|
const _useIntl = reactIntl.useIntl(),
|
|
1170
1302
|
formatMessage = _useIntl.formatMessage;
|
|
1171
1303
|
return jsxRuntime.jsx(uiKit.Card, {
|
|
@@ -1177,7 +1309,7 @@ const ExportFieldSelectionStamp = _ref => {
|
|
|
1177
1309
|
tone: "secondary",
|
|
1178
1310
|
isCondensed: true,
|
|
1179
1311
|
label: formatMessage(messages.selected, {
|
|
1180
|
-
total:
|
|
1312
|
+
total: getTotalCheckedFields(group)
|
|
1181
1313
|
})
|
|
1182
1314
|
})
|
|
1183
1315
|
})
|
|
@@ -1225,19 +1357,13 @@ const FieldSection = _ref3 => {
|
|
|
1225
1357
|
return jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
1226
1358
|
scale: "s",
|
|
1227
1359
|
children: fields?.map((field, index) => {
|
|
1228
|
-
const
|
|
1229
|
-
const
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
if (field.dependentGroupNames) {
|
|
1236
|
-
return isAnyDependentGroupChecked(field.dependentGroupNames, _valuesInstanceProperty__default["default"](formik).groups);
|
|
1237
|
-
}
|
|
1238
|
-
return isAnySiblingChecked;
|
|
1239
|
-
}
|
|
1240
|
-
return isAnyOfTheChildFieldsChecked || field.isChecked;
|
|
1360
|
+
const hasDependents = Boolean(field.dependentGroupNames?.length || field.dependentFieldNames?.length);
|
|
1361
|
+
const isAnyOfTheChildFieldsChecked = isAnyFieldChecked(field.fields || []);
|
|
1362
|
+
const allFieldsChecked = areAllFieldsChecked(field.fields || []);
|
|
1363
|
+
const getIsChecked = () => {
|
|
1364
|
+
const isParent = Boolean(field.fields && field.fields?.length > 0);
|
|
1365
|
+
if (isParent) return areAllFieldsChecked(field.fields);
|
|
1366
|
+
return field.isChecked;
|
|
1241
1367
|
};
|
|
1242
1368
|
if (field.isHidden) return null;
|
|
1243
1369
|
return jsxRuntime.jsx(CollapsibleFieldWrapper, {
|
|
@@ -1267,11 +1393,12 @@ const FieldSection = _ref3 => {
|
|
|
1267
1393
|
scale: "s",
|
|
1268
1394
|
alignItems: "center",
|
|
1269
1395
|
children: jsxRuntime.jsxs(uiKit.CheckboxInput, {
|
|
1270
|
-
isIndeterminate: field.isExpandable && !
|
|
1271
|
-
isChecked:
|
|
1272
|
-
isReadOnly:
|
|
1396
|
+
isIndeterminate: field.isExpandable && !allFieldsChecked && isAnyOfTheChildFieldsChecked,
|
|
1397
|
+
isChecked: getIsChecked(),
|
|
1398
|
+
isReadOnly: hasDependents || field.isRequired,
|
|
1273
1399
|
onChange: e => {
|
|
1274
1400
|
const path = `${parentKeys.join('.')}.fields[${index}]`;
|
|
1401
|
+
const checked = e.target.checked;
|
|
1275
1402
|
// Update all child fields
|
|
1276
1403
|
const updateAllChildFieldsChecked = (path, checked) => {
|
|
1277
1404
|
const item = get__default["default"](_valuesInstanceProperty__default["default"](formik), path);
|
|
@@ -1280,7 +1407,7 @@ const FieldSection = _ref3 => {
|
|
|
1280
1407
|
_forEachInstanceProperty__default["default"](_context = item.fields).call(_context, (field, i) => {
|
|
1281
1408
|
const fieldPath = `${path}.fields[${i}]`;
|
|
1282
1409
|
if (!field.fields?.length) {
|
|
1283
|
-
formik.setFieldValue(`${fieldPath}.isChecked`, checked,
|
|
1410
|
+
formik.setFieldValue(`${fieldPath}.isChecked`, checked || field.isRequired,
|
|
1284
1411
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
1285
1412
|
false);
|
|
1286
1413
|
}
|
|
@@ -1289,13 +1416,13 @@ const FieldSection = _ref3 => {
|
|
|
1289
1416
|
}
|
|
1290
1417
|
};
|
|
1291
1418
|
if (!field.fields?.length) {
|
|
1292
|
-
formik.setFieldValue(`${path}.isChecked`,
|
|
1419
|
+
formik.setFieldValue(`${path}.isChecked`, checked || field.isRequired,
|
|
1293
1420
|
// pass `false` to avoid revalidating the form with intermediate values
|
|
1294
1421
|
false);
|
|
1295
1422
|
}
|
|
1296
|
-
updateAllChildFieldsChecked(path,
|
|
1423
|
+
updateAllChildFieldsChecked(path, checked);
|
|
1297
1424
|
},
|
|
1298
|
-
children: [field.label, (
|
|
1425
|
+
children: [field.label, (hasDependents || field.isRequired) && ' *']
|
|
1299
1426
|
})
|
|
1300
1427
|
})]
|
|
1301
1428
|
}), field.fields && field.fields?.length > 0 && jsxRuntime.jsx(StyledExpandableContent, {
|
|
@@ -1340,8 +1467,8 @@ const FieldGroupSection = _ref2 => {
|
|
|
1340
1467
|
index = _ref2.index,
|
|
1341
1468
|
formik = _ref2.formik,
|
|
1342
1469
|
isForceExpanded = _ref2.isForceExpanded;
|
|
1343
|
-
const
|
|
1344
|
-
const
|
|
1470
|
+
const allFieldsChecked = React.useMemo(() => areAllFieldsChecked(group.fields), [group.fields]);
|
|
1471
|
+
const isAnyFieldInGroupChecked = React.useMemo(() => isAnyFieldChecked(group.fields), [group.fields]);
|
|
1345
1472
|
const _useExportFieldSelect = useExportFieldSelectionContext(),
|
|
1346
1473
|
updateExpandedGroups = _useExportFieldSelect.updateExpandedGroups;
|
|
1347
1474
|
const parentKey = `groups[${index}]`;
|
|
@@ -1354,7 +1481,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
1354
1481
|
fields: updateAllFields(field.fields, checked)
|
|
1355
1482
|
});
|
|
1356
1483
|
}
|
|
1357
|
-
if (field.
|
|
1484
|
+
if (field.isRequired) return field;
|
|
1358
1485
|
return _objectSpread$2(_objectSpread$2({}, field), {}, {
|
|
1359
1486
|
isChecked: checked
|
|
1360
1487
|
});
|
|
@@ -1391,8 +1518,8 @@ const FieldGroupSection = _ref2 => {
|
|
|
1391
1518
|
icon: isOpen ? jsxRuntime.jsx(uiKit.AngleDownIcon, {}) : jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
1392
1519
|
label: ""
|
|
1393
1520
|
}), jsxRuntime.jsx(uiKit.CheckboxInput, {
|
|
1394
|
-
isIndeterminate: !
|
|
1395
|
-
isChecked:
|
|
1521
|
+
isIndeterminate: !allFieldsChecked && isAnyFieldInGroupChecked,
|
|
1522
|
+
isChecked: allFieldsChecked,
|
|
1396
1523
|
onChange: handleChangeAllFields,
|
|
1397
1524
|
children: group.groupLabel
|
|
1398
1525
|
})]
|
|
@@ -1414,7 +1541,7 @@ const FieldGroupSection = _ref2 => {
|
|
|
1414
1541
|
fields: group.fields,
|
|
1415
1542
|
formik: formik,
|
|
1416
1543
|
parentKeys: [parentKey],
|
|
1417
|
-
isAnySiblingChecked:
|
|
1544
|
+
isAnySiblingChecked: isAnyFieldInGroupChecked,
|
|
1418
1545
|
groupName: group.groupName,
|
|
1419
1546
|
isForceExpanded: isForceExpanded
|
|
1420
1547
|
})
|
|
@@ -1507,23 +1634,24 @@ const ExportFieldsSelectionStep = () => {
|
|
|
1507
1634
|
React__default["default"].useEffect(() => {
|
|
1508
1635
|
var _context2;
|
|
1509
1636
|
formik.validateForm();
|
|
1510
|
-
|
|
1511
|
-
|
|
1637
|
+
updateFieldDependenciesStatus(formik);
|
|
1638
|
+
const checkedFields = {};
|
|
1639
|
+
function getCheckedFields(field, groupName) {
|
|
1512
1640
|
const fieldName = field.name ? `${groupName}.${field.name}` : groupName;
|
|
1513
1641
|
if (field.fields) {
|
|
1514
1642
|
var _context;
|
|
1515
|
-
return _forEachInstanceProperty__default["default"](_context = field.fields).call(_context, f =>
|
|
1643
|
+
return _forEachInstanceProperty__default["default"](_context = field.fields).call(_context, f => getCheckedFields(f, fieldName));
|
|
1516
1644
|
}
|
|
1517
|
-
|
|
1645
|
+
checkedFields[fieldName] = field.isChecked;
|
|
1518
1646
|
}
|
|
1519
1647
|
_forEachInstanceProperty__default["default"](_context2 = _valuesInstanceProperty__default["default"](formik).groups).call(_context2, group => {
|
|
1520
1648
|
var _context3;
|
|
1521
1649
|
_forEachInstanceProperty__default["default"](_context3 = group.fields).call(_context3, field => {
|
|
1522
|
-
|
|
1650
|
+
getCheckedFields(field, group.groupName);
|
|
1523
1651
|
});
|
|
1524
1652
|
});
|
|
1525
1653
|
setCachedSelectedGroups({
|
|
1526
|
-
[resourceType]:
|
|
1654
|
+
[resourceType]: checkedFields
|
|
1527
1655
|
});
|
|
1528
1656
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1529
1657
|
}, [_valuesInstanceProperty__default["default"](formik).groups]);
|
|
@@ -1778,3 +1906,4 @@ ExportResourcesModal.defaultProps = {
|
|
|
1778
1906
|
exports.EXPORTABLE_RESOURCES = EXPORTABLE_RESOURCES;
|
|
1779
1907
|
exports.EXPORT_TYPES = EXPORT_TYPES;
|
|
1780
1908
|
exports["default"] = ExportResourcesModal;
|
|
1909
|
+
exports.useConvertCustomTypeDefinitionsForExport = useConvertCustomTypeDefinitionsForExport;
|