@commercetools-frontend-extensions/export-resources-modal 5.14.5 → 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.
Files changed (22) hide show
  1. package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.dev.js +38 -9
  2. package/dist/commercetools-frontend-extensions-export-resources-modal.cjs.prod.js +38 -9
  3. package/dist/commercetools-frontend-extensions-export-resources-modal.esm.js +39 -10
  4. package/dist/{de-6b509aa7.cjs.dev.js → de-878f4246.cjs.prod.js} +22 -6
  5. package/dist/{de-b9fb4989.esm.js → de-887390c8.esm.js} +22 -6
  6. package/dist/{de-8110043f.cjs.prod.js → de-ecf9ace2.cjs.dev.js} +22 -6
  7. package/dist/declarations/src/@types/export-resources-modal-context.d.ts +1 -0
  8. package/dist/declarations/src/@types/export-resources-modal-types.d.ts +8 -0
  9. package/dist/declarations/src/export-resources-modal.d.ts +1 -1
  10. package/dist/{en-de85a5ef.esm.js → en-02b20e80.esm.js} +18 -2
  11. package/dist/{en-9fe86528.cjs.prod.js → en-3a95336a.cjs.dev.js} +18 -2
  12. package/dist/{en-377deb39.cjs.dev.js → en-b0f71eaf.cjs.prod.js} +18 -2
  13. package/dist/{es-0ea45787.cjs.dev.js → es-374aed1b.cjs.prod.js} +22 -6
  14. package/dist/{es-dd446447.cjs.prod.js → es-a1b34b9f.cjs.dev.js} +22 -6
  15. package/dist/{es-86ebb4a7.esm.js → es-d39432b2.esm.js} +22 -6
  16. package/dist/{fr-FR-1315b28a.esm.js → fr-FR-136fb625.esm.js} +22 -6
  17. package/dist/{fr-FR-019c40ab.cjs.dev.js → fr-FR-4bdab72f.cjs.prod.js} +22 -6
  18. package/dist/{fr-FR-52103608.cjs.prod.js → fr-FR-c903e733.cjs.dev.js} +22 -6
  19. package/dist/{pt-BR-d60b6d53.cjs.prod.js → pt-BR-0b67e9af.cjs.dev.js} +22 -6
  20. package/dist/{pt-BR-7a41a387.cjs.dev.js → pt-BR-3ff0daf8.cjs.prod.js} +22 -6
  21. package/dist/{pt-BR-37a2fffc.esm.js → pt-BR-b19cfc58.esm.js} +22 -6
  22. 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(fullstory.Masking.Unmask, {
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,
@@ -3667,17 +3693,17 @@ const getChunkImport = locale => {
3667
3693
  const intlLocale = i18n.mapLocaleToIntlLocale(locale);
3668
3694
  switch (intlLocale) {
3669
3695
  case 'de':
3670
- return Promise.resolve().then(function () { return require('./de-6b509aa7.cjs.dev.js'); });
3696
+ return Promise.resolve().then(function () { return require('./de-ecf9ace2.cjs.dev.js'); });
3671
3697
  case 'es':
3672
- return Promise.resolve().then(function () { return require('./es-0ea45787.cjs.dev.js'); });
3698
+ return Promise.resolve().then(function () { return require('./es-a1b34b9f.cjs.dev.js'); });
3673
3699
  case 'fr-FR':
3674
- return Promise.resolve().then(function () { return require('./fr-FR-019c40ab.cjs.dev.js'); });
3700
+ return Promise.resolve().then(function () { return require('./fr-FR-c903e733.cjs.dev.js'); });
3675
3701
  case 'ja':
3676
3702
  return Promise.resolve().then(function () { return require('./ja-9bd5f452.cjs.dev.js'); });
3677
3703
  case 'pt-BR':
3678
- return Promise.resolve().then(function () { return require('./pt-BR-7a41a387.cjs.dev.js'); });
3704
+ return Promise.resolve().then(function () { return require('./pt-BR-0b67e9af.cjs.dev.js'); });
3679
3705
  default:
3680
- return Promise.resolve().then(function () { return require('./en-377deb39.cjs.dev.js'); });
3706
+ return Promise.resolve().then(function () { return require('./en-3a95336a.cjs.dev.js'); });
3681
3707
  }
3682
3708
  };
3683
3709
  const loadMessages = async locale => {
@@ -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(fullstory.Masking.Unmask, {
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,
@@ -3634,17 +3660,17 @@ const getChunkImport = locale => {
3634
3660
  const intlLocale = i18n.mapLocaleToIntlLocale(locale);
3635
3661
  switch (intlLocale) {
3636
3662
  case 'de':
3637
- return Promise.resolve().then(function () { return require('./de-8110043f.cjs.prod.js'); });
3663
+ return Promise.resolve().then(function () { return require('./de-878f4246.cjs.prod.js'); });
3638
3664
  case 'es':
3639
- return Promise.resolve().then(function () { return require('./es-dd446447.cjs.prod.js'); });
3665
+ return Promise.resolve().then(function () { return require('./es-374aed1b.cjs.prod.js'); });
3640
3666
  case 'fr-FR':
3641
- return Promise.resolve().then(function () { return require('./fr-FR-52103608.cjs.prod.js'); });
3667
+ return Promise.resolve().then(function () { return require('./fr-FR-4bdab72f.cjs.prod.js'); });
3642
3668
  case 'ja':
3643
3669
  return Promise.resolve().then(function () { return require('./ja-37632763.cjs.prod.js'); });
3644
3670
  case 'pt-BR':
3645
- return Promise.resolve().then(function () { return require('./pt-BR-d60b6d53.cjs.prod.js'); });
3671
+ return Promise.resolve().then(function () { return require('./pt-BR-3ff0daf8.cjs.prod.js'); });
3646
3672
  default:
3647
- return Promise.resolve().then(function () { return require('./en-9fe86528.cjs.prod.js'); });
3673
+ return Promise.resolve().then(function () { return require('./en-b0f71eaf.cjs.prod.js'); });
3648
3674
  }
3649
3675
  };
3650
3676
  const loadMessages = async locale => {
@@ -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(Masking.Unmask, {
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,
@@ -3624,17 +3650,17 @@ const getChunkImport = locale => {
3624
3650
  const intlLocale = mapLocaleToIntlLocale(locale);
3625
3651
  switch (intlLocale) {
3626
3652
  case 'de':
3627
- return import('./de-b9fb4989.esm.js');
3653
+ return import('./de-887390c8.esm.js');
3628
3654
  case 'es':
3629
- return import('./es-86ebb4a7.esm.js');
3655
+ return import('./es-d39432b2.esm.js');
3630
3656
  case 'fr-FR':
3631
- return import('./fr-FR-1315b28a.esm.js');
3657
+ return import('./fr-FR-136fb625.esm.js');
3632
3658
  case 'ja':
3633
3659
  return import('./ja-73c088a7.esm.js');
3634
3660
  case 'pt-BR':
3635
- return import('./pt-BR-37a2fffc.esm.js');
3661
+ return import('./pt-BR-b19cfc58.esm.js');
3636
3662
  default:
3637
- return import('./en-de85a5ef.esm.js');
3663
+ return import('./en-02b20e80.esm.js');
3638
3664
  }
3639
3665
  };
3640
3666
  const loadMessages = async locale => {
@@ -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), {}, {
@@ -179,7 +179,7 @@ var de = {
179
179
  },
180
180
  "ExportResourcesModal.exportScopeAllProductTailorings": {
181
181
  developer_comment: "Label for Export All product tailorings",
182
- string: "Export tailored products for {total, plural, one {# product} other {# products}} in all stores"
182
+ string: "Maßgeschneiderte Produkte für {total, plural, one {# Produkt} other {# Produkte}} in allen Shops exportieren"
183
183
  },
184
184
  "ExportResourcesModal.exportScopeAllProductTypes": {
185
185
  developer_comment: "Label for Export All product types",
@@ -189,6 +189,10 @@ var de = {
189
189
  developer_comment: "Label for Export All products",
190
190
  string: "Alle exportieren: {total, plural, one {# Produkt} other {# Produkte}}"
191
191
  },
192
+ "ExportResourcesModal.exportScopeAllStandalonePrices": {
193
+ developer_comment: "Label for Export All standalone prices",
194
+ string: "Exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
195
+ },
192
196
  "ExportResourcesModal.exportScopeFilteredBusinessUnits": {
193
197
  developer_comment: "Label for Export Filtered business units",
194
198
  string: "Export gefiltert: {total, plural, one {# business unit} other {# business units}}"
@@ -211,7 +215,7 @@ var de = {
211
215
  },
212
216
  "ExportResourcesModal.exportScopeFilteredProductTailorings": {
213
217
  developer_comment: "Label for Export Filtered product tailorings",
214
- string: "Export tailored products for the {total, plural, one {# filtered product} other {# filtered products}}"
218
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# gefiltertes Produkt} other {# gefilterte Produkte}} exportieren"
215
219
  },
216
220
  "ExportResourcesModal.exportScopeFilteredProductTypes": {
217
221
  developer_comment: "Label for Export Filtered product types",
@@ -221,6 +225,10 @@ var de = {
221
225
  developer_comment: "Label for Export Filtered products",
222
226
  string: "Export gefiltert: {total, plural, one {# Produkt} other {# Produkte}}"
223
227
  },
228
+ "ExportResourcesModal.exportScopeFilteredStandalonePrices": {
229
+ developer_comment: "Label for Export Filtered standalone prices",
230
+ string: "Gefiltert exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
231
+ },
224
232
  "ExportResourcesModal.exportScopeFilteredWithoutCount": {
225
233
  developer_comment: "Label for Export Filtered without count",
226
234
  string: "Gefilterte exportieren"
@@ -247,7 +255,7 @@ var de = {
247
255
  },
248
256
  "ExportResourcesModal.exportScopeSelectedProductTailorings": {
249
257
  developer_comment: "Label for Export Selected product tailorings",
250
- string: "Export tailored products for the {total, plural, one {# selected product} other {# selected products}}"
258
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# ausgewähltes Produkt} other {# ausgewählte Produkte}} exportieren"
251
259
  },
252
260
  "ExportResourcesModal.exportScopeSelectedProductTypes": {
253
261
  developer_comment: "Label for Export Selected product types",
@@ -257,6 +265,10 @@ var de = {
257
265
  developer_comment: "Label for Export Selected products",
258
266
  string: "Export ausgewählt: {total, plural, one {# Produkt} other {# Produkte}}"
259
267
  },
268
+ "ExportResourcesModal.exportScopeSelectedStandalonePrices": {
269
+ developer_comment: "Label for Export Selected standalone prices",
270
+ string: "Exportieren ausgewählt: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
271
+ },
260
272
  "ExportResourcesModal.exportScopeSelectedWithoutCount": {
261
273
  developer_comment: "Label for Export Selected without count",
262
274
  string: "Auswahl exportieren"
@@ -383,12 +395,16 @@ var de = {
383
395
  },
384
396
  "ExportResourcesModal.modalTitle.productTailoring": {
385
397
  developer_comment: "Label for the product tailorings modal title",
386
- string: "Export tailored products"
398
+ string: "Maßgeschneiderte Produkte exportieren"
387
399
  },
388
400
  "ExportResourcesModal.modalTitle.productType": {
389
401
  developer_comment: "Label for the product types modal title",
390
402
  string: "Produkttypen exportieren"
391
403
  },
404
+ "ExportResourcesModal.modalTitle.standalonePrice": {
405
+ developer_comment: "Label for the standalone prices modal title",
406
+ string: "Einzelpreise exportieren"
407
+ },
392
408
  "ExportResourcesModal.moreInformation": {
393
409
  developer_comment: "A label for more information",
394
410
  string: "Weitere Informationen finden Sie unter {documentationLink}"
@@ -470,8 +486,8 @@ var de = {
470
486
  string: "Wählen Sie unterschiedliche Felder aus"
471
487
  },
472
488
  "ExportResourcesModal.selectFieldsFromImportedCSV": {
473
- developer_comment: "Label for \"Select fields from an imported CSV\" button",
474
- string: "Wählen Sie Felder aus einer importierten CSV aus"
489
+ developer_comment: "Label for \"Select any field from an imported CSV\" button",
490
+ string: "Select any field from an imported CSV"
475
491
  },
476
492
  "ExportResourcesModal.selectFieldsFromLimitedList": {
477
493
  developer_comment: "Label for \"Select fields from a limited list\" button",
@@ -177,7 +177,7 @@ var de = {
177
177
  },
178
178
  "ExportResourcesModal.exportScopeAllProductTailorings": {
179
179
  developer_comment: "Label for Export All product tailorings",
180
- string: "Export tailored products for {total, plural, one {# product} other {# products}} in all stores"
180
+ string: "Maßgeschneiderte Produkte für {total, plural, one {# Produkt} other {# Produkte}} in allen Shops exportieren"
181
181
  },
182
182
  "ExportResourcesModal.exportScopeAllProductTypes": {
183
183
  developer_comment: "Label for Export All product types",
@@ -187,6 +187,10 @@ var de = {
187
187
  developer_comment: "Label for Export All products",
188
188
  string: "Alle exportieren: {total, plural, one {# Produkt} other {# Produkte}}"
189
189
  },
190
+ "ExportResourcesModal.exportScopeAllStandalonePrices": {
191
+ developer_comment: "Label for Export All standalone prices",
192
+ string: "Exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
193
+ },
190
194
  "ExportResourcesModal.exportScopeFilteredBusinessUnits": {
191
195
  developer_comment: "Label for Export Filtered business units",
192
196
  string: "Export gefiltert: {total, plural, one {# business unit} other {# business units}}"
@@ -209,7 +213,7 @@ var de = {
209
213
  },
210
214
  "ExportResourcesModal.exportScopeFilteredProductTailorings": {
211
215
  developer_comment: "Label for Export Filtered product tailorings",
212
- string: "Export tailored products for the {total, plural, one {# filtered product} other {# filtered products}}"
216
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# gefiltertes Produkt} other {# gefilterte Produkte}} exportieren"
213
217
  },
214
218
  "ExportResourcesModal.exportScopeFilteredProductTypes": {
215
219
  developer_comment: "Label for Export Filtered product types",
@@ -219,6 +223,10 @@ var de = {
219
223
  developer_comment: "Label for Export Filtered products",
220
224
  string: "Export gefiltert: {total, plural, one {# Produkt} other {# Produkte}}"
221
225
  },
226
+ "ExportResourcesModal.exportScopeFilteredStandalonePrices": {
227
+ developer_comment: "Label for Export Filtered standalone prices",
228
+ string: "Gefiltert exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
229
+ },
222
230
  "ExportResourcesModal.exportScopeFilteredWithoutCount": {
223
231
  developer_comment: "Label for Export Filtered without count",
224
232
  string: "Gefilterte exportieren"
@@ -245,7 +253,7 @@ var de = {
245
253
  },
246
254
  "ExportResourcesModal.exportScopeSelectedProductTailorings": {
247
255
  developer_comment: "Label for Export Selected product tailorings",
248
- string: "Export tailored products for the {total, plural, one {# selected product} other {# selected products}}"
256
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# ausgewähltes Produkt} other {# ausgewählte Produkte}} exportieren"
249
257
  },
250
258
  "ExportResourcesModal.exportScopeSelectedProductTypes": {
251
259
  developer_comment: "Label for Export Selected product types",
@@ -255,6 +263,10 @@ var de = {
255
263
  developer_comment: "Label for Export Selected products",
256
264
  string: "Export ausgewählt: {total, plural, one {# Produkt} other {# Produkte}}"
257
265
  },
266
+ "ExportResourcesModal.exportScopeSelectedStandalonePrices": {
267
+ developer_comment: "Label for Export Selected standalone prices",
268
+ string: "Exportieren ausgewählt: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
269
+ },
258
270
  "ExportResourcesModal.exportScopeSelectedWithoutCount": {
259
271
  developer_comment: "Label for Export Selected without count",
260
272
  string: "Auswahl exportieren"
@@ -381,12 +393,16 @@ var de = {
381
393
  },
382
394
  "ExportResourcesModal.modalTitle.productTailoring": {
383
395
  developer_comment: "Label for the product tailorings modal title",
384
- string: "Export tailored products"
396
+ string: "Maßgeschneiderte Produkte exportieren"
385
397
  },
386
398
  "ExportResourcesModal.modalTitle.productType": {
387
399
  developer_comment: "Label for the product types modal title",
388
400
  string: "Produkttypen exportieren"
389
401
  },
402
+ "ExportResourcesModal.modalTitle.standalonePrice": {
403
+ developer_comment: "Label for the standalone prices modal title",
404
+ string: "Einzelpreise exportieren"
405
+ },
390
406
  "ExportResourcesModal.moreInformation": {
391
407
  developer_comment: "A label for more information",
392
408
  string: "Weitere Informationen finden Sie unter {documentationLink}"
@@ -468,8 +484,8 @@ var de = {
468
484
  string: "Wählen Sie unterschiedliche Felder aus"
469
485
  },
470
486
  "ExportResourcesModal.selectFieldsFromImportedCSV": {
471
- developer_comment: "Label for \"Select fields from an imported CSV\" button",
472
- string: "Wählen Sie Felder aus einer importierten CSV aus"
487
+ developer_comment: "Label for \"Select any field from an imported CSV\" button",
488
+ string: "Select any field from an imported CSV"
473
489
  },
474
490
  "ExportResourcesModal.selectFieldsFromLimitedList": {
475
491
  developer_comment: "Label for \"Select fields from a limited list\" button",
@@ -179,7 +179,7 @@ var de = {
179
179
  },
180
180
  "ExportResourcesModal.exportScopeAllProductTailorings": {
181
181
  developer_comment: "Label for Export All product tailorings",
182
- string: "Export tailored products for {total, plural, one {# product} other {# products}} in all stores"
182
+ string: "Maßgeschneiderte Produkte für {total, plural, one {# Produkt} other {# Produkte}} in allen Shops exportieren"
183
183
  },
184
184
  "ExportResourcesModal.exportScopeAllProductTypes": {
185
185
  developer_comment: "Label for Export All product types",
@@ -189,6 +189,10 @@ var de = {
189
189
  developer_comment: "Label for Export All products",
190
190
  string: "Alle exportieren: {total, plural, one {# Produkt} other {# Produkte}}"
191
191
  },
192
+ "ExportResourcesModal.exportScopeAllStandalonePrices": {
193
+ developer_comment: "Label for Export All standalone prices",
194
+ string: "Exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
195
+ },
192
196
  "ExportResourcesModal.exportScopeFilteredBusinessUnits": {
193
197
  developer_comment: "Label for Export Filtered business units",
194
198
  string: "Export gefiltert: {total, plural, one {# business unit} other {# business units}}"
@@ -211,7 +215,7 @@ var de = {
211
215
  },
212
216
  "ExportResourcesModal.exportScopeFilteredProductTailorings": {
213
217
  developer_comment: "Label for Export Filtered product tailorings",
214
- string: "Export tailored products for the {total, plural, one {# filtered product} other {# filtered products}}"
218
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# gefiltertes Produkt} other {# gefilterte Produkte}} exportieren"
215
219
  },
216
220
  "ExportResourcesModal.exportScopeFilteredProductTypes": {
217
221
  developer_comment: "Label for Export Filtered product types",
@@ -221,6 +225,10 @@ var de = {
221
225
  developer_comment: "Label for Export Filtered products",
222
226
  string: "Export gefiltert: {total, plural, one {# Produkt} other {# Produkte}}"
223
227
  },
228
+ "ExportResourcesModal.exportScopeFilteredStandalonePrices": {
229
+ developer_comment: "Label for Export Filtered standalone prices",
230
+ string: "Gefiltert exportieren: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
231
+ },
224
232
  "ExportResourcesModal.exportScopeFilteredWithoutCount": {
225
233
  developer_comment: "Label for Export Filtered without count",
226
234
  string: "Gefilterte exportieren"
@@ -247,7 +255,7 @@ var de = {
247
255
  },
248
256
  "ExportResourcesModal.exportScopeSelectedProductTailorings": {
249
257
  developer_comment: "Label for Export Selected product tailorings",
250
- string: "Export tailored products for the {total, plural, one {# selected product} other {# selected products}}"
258
+ string: "Maßgeschneiderte Produkte für das {total, plural, one {# ausgewähltes Produkt} other {# ausgewählte Produkte}} exportieren"
251
259
  },
252
260
  "ExportResourcesModal.exportScopeSelectedProductTypes": {
253
261
  developer_comment: "Label for Export Selected product types",
@@ -257,6 +265,10 @@ var de = {
257
265
  developer_comment: "Label for Export Selected products",
258
266
  string: "Export ausgewählt: {total, plural, one {# Produkt} other {# Produkte}}"
259
267
  },
268
+ "ExportResourcesModal.exportScopeSelectedStandalonePrices": {
269
+ developer_comment: "Label for Export Selected standalone prices",
270
+ string: "Exportieren ausgewählt: {total, plural, one {# Einzelpreis} other {# Einzelpreise}}"
271
+ },
260
272
  "ExportResourcesModal.exportScopeSelectedWithoutCount": {
261
273
  developer_comment: "Label for Export Selected without count",
262
274
  string: "Auswahl exportieren"
@@ -383,12 +395,16 @@ var de = {
383
395
  },
384
396
  "ExportResourcesModal.modalTitle.productTailoring": {
385
397
  developer_comment: "Label for the product tailorings modal title",
386
- string: "Export tailored products"
398
+ string: "Maßgeschneiderte Produkte exportieren"
387
399
  },
388
400
  "ExportResourcesModal.modalTitle.productType": {
389
401
  developer_comment: "Label for the product types modal title",
390
402
  string: "Produkttypen exportieren"
391
403
  },
404
+ "ExportResourcesModal.modalTitle.standalonePrice": {
405
+ developer_comment: "Label for the standalone prices modal title",
406
+ string: "Einzelpreise exportieren"
407
+ },
392
408
  "ExportResourcesModal.moreInformation": {
393
409
  developer_comment: "A label for more information",
394
410
  string: "Weitere Informationen finden Sie unter {documentationLink}"
@@ -470,8 +486,8 @@ var de = {
470
486
  string: "Wählen Sie unterschiedliche Felder aus"
471
487
  },
472
488
  "ExportResourcesModal.selectFieldsFromImportedCSV": {
473
- developer_comment: "Label for \"Select fields from an imported CSV\" button",
474
- string: "Wählen Sie Felder aus einer importierten CSV aus"
489
+ developer_comment: "Label for \"Select any field from an imported CSV\" button",
490
+ string: "Select any field from an imported CSV"
475
491
  },
476
492
  "ExportResourcesModal.selectFieldsFromLimitedList": {
477
493
  developer_comment: "Label for \"Select fields from a limited list\" button",
@@ -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;