@commercetools-frontend-extensions/export-resources-modal 5.14.6 → 5.15.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 +33 -4
- package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +33 -4
- package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +34 -5
- package/dist/declarations/src/@types/export-resources-modal-context.d.ts +1 -0
- package/dist/declarations/src/@types/export-resources-modal-types.d.ts +8 -0
- package/dist/declarations/src/export-resources-modal.d.ts +1 -1
- package/package.json +1 -1
|
@@ -3085,7 +3085,8 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3085
3085
|
resourceType = _useExportResourcesMo.resourceType,
|
|
3086
3086
|
fieldSelectionMode = _useExportResourcesMo.fieldSelectionMode,
|
|
3087
3087
|
setFieldSelectionMode = _useExportResourcesMo.setFieldSelectionMode,
|
|
3088
|
-
setLocaleOption = _useExportResourcesMo.setLocaleOption
|
|
3088
|
+
setLocaleOption = _useExportResourcesMo.setLocaleOption,
|
|
3089
|
+
isLoading = _useExportResourcesMo.isLoading;
|
|
3089
3090
|
const shouldDisableImportedCsvTemplateOption = _valuesInstanceProperty__default["default"](formik).outputFormat === OUTPUT_FORMATS.JSON;
|
|
3090
3091
|
const isUsingImportedCsvTemplate = fieldSelectionMode === 'imported-csv-template';
|
|
3091
3092
|
const handleFieldSelectionModeChange = event => {
|
|
@@ -3106,7 +3107,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3106
3107
|
})}: ${intl.formatMessage(messages.confirmSelection)}`,
|
|
3107
3108
|
iconLeftPrimaryButton: jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
3108
3109
|
onPrimaryButtonClick: formik.submitForm,
|
|
3109
|
-
isPrimaryButtonDisabled: !formik.isValid,
|
|
3110
|
+
isPrimaryButtonDisabled: isLoading || !formik.isValid,
|
|
3110
3111
|
labelSecondary: intl.formatMessage(messages.back),
|
|
3111
3112
|
onSecondaryButtonClick: () => setCurrentStep(Step.FileSettings),
|
|
3112
3113
|
onClose: onClose,
|
|
@@ -3114,7 +3115,14 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3114
3115
|
dataAttributesPrimaryButton: {
|
|
3115
3116
|
'data-tracking-target': `${resourceType}_export-start_export_button`
|
|
3116
3117
|
},
|
|
3117
|
-
children: jsxRuntime.jsx(
|
|
3118
|
+
children: isLoading ? jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
3119
|
+
scale: "m",
|
|
3120
|
+
alignItems: "center",
|
|
3121
|
+
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {
|
|
3122
|
+
scale: "l",
|
|
3123
|
+
maxDelayDuration: 0
|
|
3124
|
+
})
|
|
3125
|
+
}) : jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
3118
3126
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
3119
3127
|
scale: "xl",
|
|
3120
3128
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3247,11 +3255,29 @@ const ExportResourcesProvider = _ref => {
|
|
|
3247
3255
|
React__default["default"].useEffect(() => {
|
|
3248
3256
|
formik$1.validateForm();
|
|
3249
3257
|
}, [currentStep, fieldSelectionMode, importedHeaders, exportType]);
|
|
3258
|
+
|
|
3259
|
+
// The modal can be mounted before the data backing `fieldGroups` is ready
|
|
3260
|
+
// (the consumer opens it immediately and passes `isLoading`). Formik snapshots
|
|
3261
|
+
// the initial values once and does not reinitialize, so when the groups
|
|
3262
|
+
// arrive we set just the `groups` field — leaving any file settings the user
|
|
3263
|
+
// already changed on step 1 untouched. Guarded to run once, and only when the
|
|
3264
|
+
// form actually mounted without groups (a no-op for consumers that pass the
|
|
3265
|
+
// full `fieldGroups` upfront).
|
|
3266
|
+
const hasPopulatedFieldGroups = React__default["default"].useRef(false);
|
|
3267
|
+
React__default["default"].useLayoutEffect(() => {
|
|
3268
|
+
if (hasPopulatedFieldGroups.current) return;
|
|
3269
|
+
if (_valuesInstanceProperty__default["default"](formik$1).groups.length === 0 && initialValues.groups.length > 0) {
|
|
3270
|
+
formik$1.setFieldValue('groups', initialValues.groups);
|
|
3271
|
+
hasPopulatedFieldGroups.current = true;
|
|
3272
|
+
}
|
|
3273
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3274
|
+
}, [initialValues.groups]);
|
|
3250
3275
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
3251
3276
|
value: {
|
|
3252
3277
|
formik: formik$1,
|
|
3253
3278
|
currentStep,
|
|
3254
3279
|
setCurrentStep,
|
|
3280
|
+
isLoading: props.isLoading,
|
|
3255
3281
|
onClose: props.onClose,
|
|
3256
3282
|
resourceType: props.resourceType,
|
|
3257
3283
|
exportType: exportType,
|
|
@@ -3729,7 +3755,7 @@ const useAsyncIntlMessages = (locale, loader) => {
|
|
|
3729
3755
|
return state;
|
|
3730
3756
|
};
|
|
3731
3757
|
|
|
3732
|
-
const _excluded = ["isOpen", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3758
|
+
const _excluded = ["isOpen", "isLoading", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3733
3759
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3734
3760
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3735
3761
|
function invalidateLaunchDarklyCachedFeatureFlag(flagName) {
|
|
@@ -3752,6 +3778,8 @@ invalidateLaunchDarklyCachedFeatureFlag('enableOperationsExport');
|
|
|
3752
3778
|
const ExportResourcesModal = _ref3 => {
|
|
3753
3779
|
let _ref3$isOpen = _ref3.isOpen,
|
|
3754
3780
|
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen,
|
|
3781
|
+
_ref3$isLoading = _ref3.isLoading,
|
|
3782
|
+
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
3755
3783
|
_ref3$selectedResourc = _ref3.selectedResourceIds,
|
|
3756
3784
|
selectedResourceIds = _ref3$selectedResourc === void 0 ? [] : _ref3$selectedResourc,
|
|
3757
3785
|
_ref3$outputFormat = _ref3.outputFormat,
|
|
@@ -3778,6 +3806,7 @@ const ExportResourcesModal = _ref3 => {
|
|
|
3778
3806
|
fieldGroups: fieldGroups,
|
|
3779
3807
|
fieldOrder: fieldOrder,
|
|
3780
3808
|
isOpen: isOpen,
|
|
3809
|
+
isLoading: isLoading,
|
|
3781
3810
|
outputFormat: outputFormat,
|
|
3782
3811
|
selectedResourceIds: selectedResourceIds
|
|
3783
3812
|
}, props), {}, {
|
|
@@ -3052,7 +3052,8 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3052
3052
|
resourceType = _useExportResourcesMo.resourceType,
|
|
3053
3053
|
fieldSelectionMode = _useExportResourcesMo.fieldSelectionMode,
|
|
3054
3054
|
setFieldSelectionMode = _useExportResourcesMo.setFieldSelectionMode,
|
|
3055
|
-
setLocaleOption = _useExportResourcesMo.setLocaleOption
|
|
3055
|
+
setLocaleOption = _useExportResourcesMo.setLocaleOption,
|
|
3056
|
+
isLoading = _useExportResourcesMo.isLoading;
|
|
3056
3057
|
const shouldDisableImportedCsvTemplateOption = _valuesInstanceProperty__default["default"](formik).outputFormat === OUTPUT_FORMATS.JSON;
|
|
3057
3058
|
const isUsingImportedCsvTemplate = fieldSelectionMode === 'imported-csv-template';
|
|
3058
3059
|
const handleFieldSelectionModeChange = event => {
|
|
@@ -3073,7 +3074,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3073
3074
|
})}: ${intl.formatMessage(messages.confirmSelection)}`,
|
|
3074
3075
|
iconLeftPrimaryButton: jsxRuntime.jsx(uiKit.AngleRightIcon, {}),
|
|
3075
3076
|
onPrimaryButtonClick: formik.submitForm,
|
|
3076
|
-
isPrimaryButtonDisabled: !formik.isValid,
|
|
3077
|
+
isPrimaryButtonDisabled: isLoading || !formik.isValid,
|
|
3077
3078
|
labelSecondary: intl.formatMessage(messages.back),
|
|
3078
3079
|
onSecondaryButtonClick: () => setCurrentStep(Step.FileSettings),
|
|
3079
3080
|
onClose: onClose,
|
|
@@ -3081,7 +3082,14 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3081
3082
|
dataAttributesPrimaryButton: {
|
|
3082
3083
|
'data-tracking-target': `${resourceType}_export-start_export_button`
|
|
3083
3084
|
},
|
|
3084
|
-
children: jsxRuntime.jsx(
|
|
3085
|
+
children: isLoading ? jsxRuntime.jsx(uiKit.Spacings.Stack, {
|
|
3086
|
+
scale: "m",
|
|
3087
|
+
alignItems: "center",
|
|
3088
|
+
children: jsxRuntime.jsx(uiKit.LoadingSpinner, {
|
|
3089
|
+
scale: "l",
|
|
3090
|
+
maxDelayDuration: 0
|
|
3091
|
+
})
|
|
3092
|
+
}) : jsxRuntime.jsx(fullstory.Masking.Unmask, {
|
|
3085
3093
|
children: jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
3086
3094
|
scale: "xl",
|
|
3087
3095
|
children: [jsxRuntime.jsxs(uiKit.Spacings.Stack, {
|
|
@@ -3214,11 +3222,29 @@ const ExportResourcesProvider = _ref => {
|
|
|
3214
3222
|
React__default["default"].useEffect(() => {
|
|
3215
3223
|
formik$1.validateForm();
|
|
3216
3224
|
}, [currentStep, fieldSelectionMode, importedHeaders, exportType]);
|
|
3225
|
+
|
|
3226
|
+
// The modal can be mounted before the data backing `fieldGroups` is ready
|
|
3227
|
+
// (the consumer opens it immediately and passes `isLoading`). Formik snapshots
|
|
3228
|
+
// the initial values once and does not reinitialize, so when the groups
|
|
3229
|
+
// arrive we set just the `groups` field — leaving any file settings the user
|
|
3230
|
+
// already changed on step 1 untouched. Guarded to run once, and only when the
|
|
3231
|
+
// form actually mounted without groups (a no-op for consumers that pass the
|
|
3232
|
+
// full `fieldGroups` upfront).
|
|
3233
|
+
const hasPopulatedFieldGroups = React__default["default"].useRef(false);
|
|
3234
|
+
React__default["default"].useLayoutEffect(() => {
|
|
3235
|
+
if (hasPopulatedFieldGroups.current) return;
|
|
3236
|
+
if (_valuesInstanceProperty__default["default"](formik$1).groups.length === 0 && initialValues.groups.length > 0) {
|
|
3237
|
+
formik$1.setFieldValue('groups', initialValues.groups);
|
|
3238
|
+
hasPopulatedFieldGroups.current = true;
|
|
3239
|
+
}
|
|
3240
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3241
|
+
}, [initialValues.groups]);
|
|
3217
3242
|
return jsxRuntime.jsx(ExportResourcesContext.Provider, {
|
|
3218
3243
|
value: {
|
|
3219
3244
|
formik: formik$1,
|
|
3220
3245
|
currentStep,
|
|
3221
3246
|
setCurrentStep,
|
|
3247
|
+
isLoading: props.isLoading,
|
|
3222
3248
|
onClose: props.onClose,
|
|
3223
3249
|
resourceType: props.resourceType,
|
|
3224
3250
|
exportType: exportType,
|
|
@@ -3696,7 +3722,7 @@ const useAsyncIntlMessages = (locale, loader) => {
|
|
|
3696
3722
|
return state;
|
|
3697
3723
|
};
|
|
3698
3724
|
|
|
3699
|
-
const _excluded = ["isOpen", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3725
|
+
const _excluded = ["isOpen", "isLoading", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3700
3726
|
function ownKeys(e, r) { var t = _Object$keys__default["default"](e); if (_Object$getOwnPropertySymbols__default["default"]) { var o = _Object$getOwnPropertySymbols__default["default"](e); r && (o = _filterInstanceProperty__default["default"](o).call(o, function (r) { return _Object$getOwnPropertyDescriptor__default["default"](e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3701
3727
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty__default["default"](_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors__default["default"] ? _Object$defineProperties__default["default"](e, _Object$getOwnPropertyDescriptors__default["default"](t)) : _forEachInstanceProperty__default["default"](_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty__default["default"](e, r, _Object$getOwnPropertyDescriptor__default["default"](t, r)); }); } return e; }
|
|
3702
3728
|
function invalidateLaunchDarklyCachedFeatureFlag(flagName) {
|
|
@@ -3719,6 +3745,8 @@ invalidateLaunchDarklyCachedFeatureFlag('enableOperationsExport');
|
|
|
3719
3745
|
const ExportResourcesModal = _ref3 => {
|
|
3720
3746
|
let _ref3$isOpen = _ref3.isOpen,
|
|
3721
3747
|
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen,
|
|
3748
|
+
_ref3$isLoading = _ref3.isLoading,
|
|
3749
|
+
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
3722
3750
|
_ref3$selectedResourc = _ref3.selectedResourceIds,
|
|
3723
3751
|
selectedResourceIds = _ref3$selectedResourc === void 0 ? [] : _ref3$selectedResourc,
|
|
3724
3752
|
_ref3$outputFormat = _ref3.outputFormat,
|
|
@@ -3745,6 +3773,7 @@ const ExportResourcesModal = _ref3 => {
|
|
|
3745
3773
|
fieldGroups: fieldGroups,
|
|
3746
3774
|
fieldOrder: fieldOrder,
|
|
3747
3775
|
isOpen: isOpen,
|
|
3776
|
+
isLoading: isLoading,
|
|
3748
3777
|
outputFormat: outputFormat,
|
|
3749
3778
|
selectedResourceIds: selectedResourceIds
|
|
3750
3779
|
}, props), {}, {
|
|
@@ -15,7 +15,7 @@ import _Object$defineProperties from '@babel/runtime-corejs3/core-js-stable/obje
|
|
|
15
15
|
import _Object$defineProperty from '@babel/runtime-corejs3/core-js-stable/object/define-property';
|
|
16
16
|
import { defineMessages, FormattedMessage, useIntl, IntlProvider } from 'react-intl';
|
|
17
17
|
import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
|
|
18
|
-
import { Text, TextInput, Spacings, SelectField, CheckboxInput, ContentNotification, Link, RadioInput, TextField, AngleRightIcon, Grid, designTokens, FieldLabel, Constraints, Tooltip, SupportIcon, Stamp, IconButton, AngleDownIcon, CollapsibleMotion, Card, SearchTextInput, TagList, FlatButton, AngleUpIcon, CheckBoldIcon, DataTable } from '@commercetools-frontend/ui-kit';
|
|
18
|
+
import { Text, TextInput, Spacings, SelectField, CheckboxInput, ContentNotification, Link, RadioInput, TextField, AngleRightIcon, Grid, designTokens, FieldLabel, Constraints, Tooltip, SupportIcon, Stamp, IconButton, AngleDownIcon, CollapsibleMotion, Card, SearchTextInput, LoadingSpinner, TagList, FlatButton, AngleUpIcon, CheckBoldIcon, DataTable } from '@commercetools-frontend/ui-kit';
|
|
19
19
|
import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
|
|
20
20
|
import _valuesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/values';
|
|
21
21
|
import { FormDialog } from '@commercetools-frontend/application-components';
|
|
@@ -3042,7 +3042,8 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3042
3042
|
resourceType = _useExportResourcesMo.resourceType,
|
|
3043
3043
|
fieldSelectionMode = _useExportResourcesMo.fieldSelectionMode,
|
|
3044
3044
|
setFieldSelectionMode = _useExportResourcesMo.setFieldSelectionMode,
|
|
3045
|
-
setLocaleOption = _useExportResourcesMo.setLocaleOption
|
|
3045
|
+
setLocaleOption = _useExportResourcesMo.setLocaleOption,
|
|
3046
|
+
isLoading = _useExportResourcesMo.isLoading;
|
|
3046
3047
|
const shouldDisableImportedCsvTemplateOption = _valuesInstanceProperty(formik).outputFormat === OUTPUT_FORMATS.JSON;
|
|
3047
3048
|
const isUsingImportedCsvTemplate = fieldSelectionMode === 'imported-csv-template';
|
|
3048
3049
|
const handleFieldSelectionModeChange = event => {
|
|
@@ -3063,7 +3064,7 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3063
3064
|
})}: ${intl.formatMessage(messages.confirmSelection)}`,
|
|
3064
3065
|
iconLeftPrimaryButton: jsx(AngleRightIcon, {}),
|
|
3065
3066
|
onPrimaryButtonClick: formik.submitForm,
|
|
3066
|
-
isPrimaryButtonDisabled: !formik.isValid,
|
|
3067
|
+
isPrimaryButtonDisabled: isLoading || !formik.isValid,
|
|
3067
3068
|
labelSecondary: intl.formatMessage(messages.back),
|
|
3068
3069
|
onSecondaryButtonClick: () => setCurrentStep(Step.FileSettings),
|
|
3069
3070
|
onClose: onClose,
|
|
@@ -3071,7 +3072,14 @@ const ExportFieldsSelectionStep = () => {
|
|
|
3071
3072
|
dataAttributesPrimaryButton: {
|
|
3072
3073
|
'data-tracking-target': `${resourceType}_export-start_export_button`
|
|
3073
3074
|
},
|
|
3074
|
-
children: jsx(
|
|
3075
|
+
children: isLoading ? jsx(Spacings.Stack, {
|
|
3076
|
+
scale: "m",
|
|
3077
|
+
alignItems: "center",
|
|
3078
|
+
children: jsx(LoadingSpinner, {
|
|
3079
|
+
scale: "l",
|
|
3080
|
+
maxDelayDuration: 0
|
|
3081
|
+
})
|
|
3082
|
+
}) : jsx(Masking.Unmask, {
|
|
3075
3083
|
children: jsxs(Spacings.Stack, {
|
|
3076
3084
|
scale: "xl",
|
|
3077
3085
|
children: [jsxs(Spacings.Stack, {
|
|
@@ -3204,11 +3212,29 @@ const ExportResourcesProvider = _ref => {
|
|
|
3204
3212
|
React.useEffect(() => {
|
|
3205
3213
|
formik.validateForm();
|
|
3206
3214
|
}, [currentStep, fieldSelectionMode, importedHeaders, exportType]);
|
|
3215
|
+
|
|
3216
|
+
// The modal can be mounted before the data backing `fieldGroups` is ready
|
|
3217
|
+
// (the consumer opens it immediately and passes `isLoading`). Formik snapshots
|
|
3218
|
+
// the initial values once and does not reinitialize, so when the groups
|
|
3219
|
+
// arrive we set just the `groups` field — leaving any file settings the user
|
|
3220
|
+
// already changed on step 1 untouched. Guarded to run once, and only when the
|
|
3221
|
+
// form actually mounted without groups (a no-op for consumers that pass the
|
|
3222
|
+
// full `fieldGroups` upfront).
|
|
3223
|
+
const hasPopulatedFieldGroups = React.useRef(false);
|
|
3224
|
+
React.useLayoutEffect(() => {
|
|
3225
|
+
if (hasPopulatedFieldGroups.current) return;
|
|
3226
|
+
if (_valuesInstanceProperty(formik).groups.length === 0 && initialValues.groups.length > 0) {
|
|
3227
|
+
formik.setFieldValue('groups', initialValues.groups);
|
|
3228
|
+
hasPopulatedFieldGroups.current = true;
|
|
3229
|
+
}
|
|
3230
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3231
|
+
}, [initialValues.groups]);
|
|
3207
3232
|
return jsx(ExportResourcesContext.Provider, {
|
|
3208
3233
|
value: {
|
|
3209
3234
|
formik,
|
|
3210
3235
|
currentStep,
|
|
3211
3236
|
setCurrentStep,
|
|
3237
|
+
isLoading: props.isLoading,
|
|
3212
3238
|
onClose: props.onClose,
|
|
3213
3239
|
resourceType: props.resourceType,
|
|
3214
3240
|
exportType: exportType,
|
|
@@ -3686,7 +3712,7 @@ const useAsyncIntlMessages = (locale, loader) => {
|
|
|
3686
3712
|
return state;
|
|
3687
3713
|
};
|
|
3688
3714
|
|
|
3689
|
-
const _excluded = ["isOpen", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3715
|
+
const _excluded = ["isOpen", "isLoading", "selectedResourceIds", "outputFormat", "fieldGroups", "fieldOrder"];
|
|
3690
3716
|
function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3691
3717
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context, _context2; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context = ownKeys(Object(t), !0)).call(_context, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context2 = ownKeys(Object(t))).call(_context2, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3692
3718
|
function invalidateLaunchDarklyCachedFeatureFlag(flagName) {
|
|
@@ -3709,6 +3735,8 @@ invalidateLaunchDarklyCachedFeatureFlag('enableOperationsExport');
|
|
|
3709
3735
|
const ExportResourcesModal = _ref3 => {
|
|
3710
3736
|
let _ref3$isOpen = _ref3.isOpen,
|
|
3711
3737
|
isOpen = _ref3$isOpen === void 0 ? false : _ref3$isOpen,
|
|
3738
|
+
_ref3$isLoading = _ref3.isLoading,
|
|
3739
|
+
isLoading = _ref3$isLoading === void 0 ? false : _ref3$isLoading,
|
|
3712
3740
|
_ref3$selectedResourc = _ref3.selectedResourceIds,
|
|
3713
3741
|
selectedResourceIds = _ref3$selectedResourc === void 0 ? [] : _ref3$selectedResourc,
|
|
3714
3742
|
_ref3$outputFormat = _ref3.outputFormat,
|
|
@@ -3735,6 +3763,7 @@ const ExportResourcesModal = _ref3 => {
|
|
|
3735
3763
|
fieldGroups: fieldGroups,
|
|
3736
3764
|
fieldOrder: fieldOrder,
|
|
3737
3765
|
isOpen: isOpen,
|
|
3766
|
+
isLoading: isLoading,
|
|
3738
3767
|
outputFormat: outputFormat,
|
|
3739
3768
|
selectedResourceIds: selectedResourceIds
|
|
3740
3769
|
}, props), {}, {
|
|
@@ -16,6 +16,7 @@ export interface ExportResourcesModalContext {
|
|
|
16
16
|
formik: FormikProps<FormValues>;
|
|
17
17
|
currentStep: Step;
|
|
18
18
|
setCurrentStep: React.Dispatch<React.SetStateAction<Step>>;
|
|
19
|
+
isLoading?: boolean;
|
|
19
20
|
onClose: () => void;
|
|
20
21
|
resourceType: ResourceType;
|
|
21
22
|
exportType: ExportType;
|
|
@@ -26,6 +26,14 @@ export interface Store {
|
|
|
26
26
|
}
|
|
27
27
|
export interface ExportResourcesModalProps {
|
|
28
28
|
isOpen?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Pass `true` while the data backing `fieldGroups` is still being fetched.
|
|
31
|
+
* The modal opens immediately to the (data-independent) file settings step,
|
|
32
|
+
* and only the field selection step shows a loading spinner until the data is
|
|
33
|
+
* ready. The fetched `fieldGroups` are then merged into the form without
|
|
34
|
+
* resetting any file settings the user already changed.
|
|
35
|
+
*/
|
|
36
|
+
isLoading?: boolean;
|
|
29
37
|
resourceType: ResourceType;
|
|
30
38
|
outputFormat?: string;
|
|
31
39
|
baseFilters?: Pick<Filters, 'where'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ExportResourcesModalProps } from "./@types/index.js";
|
|
2
2
|
declare const ExportResourcesModal: {
|
|
3
|
-
({ isOpen, selectedResourceIds, outputFormat, fieldGroups, fieldOrder, ...props }: ExportResourcesModalProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
({ isOpen, isLoading, selectedResourceIds, outputFormat, fieldGroups, fieldOrder, ...props }: ExportResourcesModalProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
|
|
4
4
|
displayName: string;
|
|
5
5
|
};
|
|
6
6
|
export default ExportResourcesModal;
|
package/package.json
CHANGED