@commercetools-frontend-extensions/export-resources-modal 5.16.2 → 5.16.3

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.
@@ -270,6 +270,11 @@ var messages = reactIntl.defineMessages({
270
270
  description: 'Label for "Start export" button',
271
271
  defaultMessage: 'Start export'
272
272
  },
273
+ startingExport: {
274
+ id: 'ExportResourcesModal.startingExport',
275
+ description: 'Label for the "Start export" button while the export operation is being started',
276
+ defaultMessage: 'Starting export…'
277
+ },
273
278
  fieldDefinitions: {
274
279
  id: 'ExportResourcesModal.fieldDefinitions',
275
280
  description: 'Label for "Field definitions" link',
@@ -1953,6 +1958,7 @@ const useStartExportOperation = props => {
1953
1958
  dismissAfter: 5000
1954
1959
  });
1955
1960
  if (typeof props.onExportSuccess === 'function') props.onExportSuccess();
1961
+ if (typeof props.onClose === 'function') props.onClose();
1956
1962
  break;
1957
1963
  default:
1958
1964
  throw new UnexpectedExportOperationStateError(response.state);
@@ -1974,8 +1980,6 @@ const useStartExportOperation = props => {
1974
1980
  domain: constants.DOMAINS.PAGE
1975
1981
  });
1976
1982
  }
1977
- } finally {
1978
- if (typeof props.onClose === 'function') props.onClose();
1979
1983
  }
1980
1984
  };
1981
1985
  return {
@@ -3328,7 +3332,7 @@ const ExportResourcesProvider = _ref => {
3328
3332
  setCurrentStep(Step.ValidationErrors);
3329
3333
  }
3330
3334
  } else {
3331
- startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3335
+ await startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3332
3336
  }
3333
3337
  }
3334
3338
  });
@@ -3456,7 +3460,8 @@ const ExportConfirmationStep = () => {
3456
3460
  currentStep: 3,
3457
3461
  totalSteps: TOTAL_STEPS
3458
3462
  }), ": ")).call(_context2, intl.formatMessage(messages.exportPreview)),
3459
- labelPrimary: intl.formatMessage(messages.startExport),
3463
+ labelPrimary: intl.formatMessage(formik.isSubmitting ? messages.startingExport : messages.startExport),
3464
+ isPrimaryButtonDisabled: formik.isSubmitting,
3460
3465
  onPrimaryButtonClick: formik.submitForm,
3461
3466
  labelSecondary: intl.formatMessage(messages.selectDifferentFields),
3462
3467
  onSecondaryButtonClick: returnToFieldsSelection,
@@ -270,6 +270,11 @@ var messages = reactIntl.defineMessages({
270
270
  description: 'Label for "Start export" button',
271
271
  defaultMessage: 'Start export'
272
272
  },
273
+ startingExport: {
274
+ id: 'ExportResourcesModal.startingExport',
275
+ description: 'Label for the "Start export" button while the export operation is being started',
276
+ defaultMessage: 'Starting export…'
277
+ },
273
278
  fieldDefinitions: {
274
279
  id: 'ExportResourcesModal.fieldDefinitions',
275
280
  description: 'Label for "Field definitions" link',
@@ -1953,6 +1958,7 @@ const useStartExportOperation = props => {
1953
1958
  dismissAfter: 5000
1954
1959
  });
1955
1960
  if (typeof props.onExportSuccess === 'function') props.onExportSuccess();
1961
+ if (typeof props.onClose === 'function') props.onClose();
1956
1962
  break;
1957
1963
  default:
1958
1964
  throw new UnexpectedExportOperationStateError(response.state);
@@ -1974,8 +1980,6 @@ const useStartExportOperation = props => {
1974
1980
  domain: constants.DOMAINS.PAGE
1975
1981
  });
1976
1982
  }
1977
- } finally {
1978
- if (typeof props.onClose === 'function') props.onClose();
1979
1983
  }
1980
1984
  };
1981
1985
  return {
@@ -3295,7 +3299,7 @@ const ExportResourcesProvider = _ref => {
3295
3299
  setCurrentStep(Step.ValidationErrors);
3296
3300
  }
3297
3301
  } else {
3298
- startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3302
+ await startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3299
3303
  }
3300
3304
  }
3301
3305
  });
@@ -3423,7 +3427,8 @@ const ExportConfirmationStep = () => {
3423
3427
  currentStep: 3,
3424
3428
  totalSteps: TOTAL_STEPS
3425
3429
  }), ": ")).call(_context2, intl.formatMessage(messages.exportPreview)),
3426
- labelPrimary: intl.formatMessage(messages.startExport),
3430
+ labelPrimary: intl.formatMessage(formik.isSubmitting ? messages.startingExport : messages.startExport),
3431
+ isPrimaryButtonDisabled: formik.isSubmitting,
3427
3432
  onPrimaryButtonClick: formik.submitForm,
3428
3433
  labelSecondary: intl.formatMessage(messages.selectDifferentFields),
3429
3434
  onSecondaryButtonClick: returnToFieldsSelection,
@@ -228,6 +228,11 @@ var messages = defineMessages({
228
228
  description: 'Label for "Start export" button',
229
229
  defaultMessage: 'Start export'
230
230
  },
231
+ startingExport: {
232
+ id: 'ExportResourcesModal.startingExport',
233
+ description: 'Label for the "Start export" button while the export operation is being started',
234
+ defaultMessage: 'Starting export…'
235
+ },
231
236
  fieldDefinitions: {
232
237
  id: 'ExportResourcesModal.fieldDefinitions',
233
238
  description: 'Label for "Field definitions" link',
@@ -1911,6 +1916,7 @@ const useStartExportOperation = props => {
1911
1916
  dismissAfter: 5000
1912
1917
  });
1913
1918
  if (typeof props.onExportSuccess === 'function') props.onExportSuccess();
1919
+ if (typeof props.onClose === 'function') props.onClose();
1914
1920
  break;
1915
1921
  default:
1916
1922
  throw new UnexpectedExportOperationStateError(response.state);
@@ -1932,8 +1938,6 @@ const useStartExportOperation = props => {
1932
1938
  domain: DOMAINS.PAGE
1933
1939
  });
1934
1940
  }
1935
- } finally {
1936
- if (typeof props.onClose === 'function') props.onClose();
1937
1941
  }
1938
1942
  };
1939
1943
  return {
@@ -3286,7 +3290,7 @@ const ExportResourcesProvider = _ref => {
3286
3290
  setCurrentStep(Step.ValidationErrors);
3287
3291
  }
3288
3292
  } else {
3289
- startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3293
+ await startExportOperation(values, exportType, fieldSelectionMode, localeOption, importedHeaders, selectedStoreKey);
3290
3294
  }
3291
3295
  }
3292
3296
  });
@@ -3414,7 +3418,8 @@ const ExportConfirmationStep = () => {
3414
3418
  currentStep: 3,
3415
3419
  totalSteps: TOTAL_STEPS
3416
3420
  }), ": ")).call(_context2, intl.formatMessage(messages.exportPreview)),
3417
- labelPrimary: intl.formatMessage(messages.startExport),
3421
+ labelPrimary: intl.formatMessage(formik.isSubmitting ? messages.startingExport : messages.startExport),
3422
+ isPrimaryButtonDisabled: formik.isSubmitting,
3418
3423
  onPrimaryButtonClick: formik.submitForm,
3419
3424
  labelSecondary: intl.formatMessage(messages.selectDifferentFields),
3420
3425
  onSecondaryButtonClick: returnToFieldsSelection,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/export-resources-modal",
3
3
  "description": "Shared export modal for exporting resources",
4
- "version": "5.16.2",
4
+ "version": "5.16.3",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -26,7 +26,7 @@
26
26
  "moment": "^2.30.1",
27
27
  "omit-empty-es": "^1.1.3",
28
28
  "prop-types": "^15.8.1",
29
- "@commercetools-frontend-extensions/operations": "4.7.0"
29
+ "@commercetools-frontend-extensions/operations": "4.7.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@commercetools-frontend/actions-global": "27.8.0",