@commercetools-frontend-extensions/unpublish-products-modal 1.6.0 → 1.6.1

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.
@@ -422,6 +422,11 @@ var messages$4 = reactIntl.defineMessages({
422
422
  description: 'Generic notification message when file upload fails',
423
423
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
424
424
  },
425
+ uploadIsTakingTooLong: {
426
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
427
+ description: 'Notification message when file upload is taking longer than expected',
428
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
429
+ },
425
430
  missingRequiredField: {
426
431
  id: 'UnpublishProductsModal.missingRequiredField',
427
432
  description: 'Error message displayed when a required field is missing',
@@ -525,6 +530,19 @@ const useUpload = () => {
525
530
  } else if (error.errorData?.invalid > 0) {
526
531
  actions.setUploadFileResponse(error.errorData);
527
532
  actions.setCurrentStep('upload-error');
533
+ } else if (error.statusCode === 408) {
534
+ actions.cancelImport();
535
+ showNotification({
536
+ kind: 'error',
537
+ domain: constants.DOMAINS.PAGE,
538
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
539
+ });
540
+ sentry.reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
541
+ extra: {
542
+ error,
543
+ fileSizeInBytes: state.droppedFile?.size
544
+ }
545
+ });
528
546
  } else {
529
547
  actions.cancelImport();
530
548
  showNotification({
@@ -422,6 +422,11 @@ var messages$4 = reactIntl.defineMessages({
422
422
  description: 'Generic notification message when file upload fails',
423
423
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
424
424
  },
425
+ uploadIsTakingTooLong: {
426
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
427
+ description: 'Notification message when file upload is taking longer than expected',
428
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
429
+ },
425
430
  missingRequiredField: {
426
431
  id: 'UnpublishProductsModal.missingRequiredField',
427
432
  description: 'Error message displayed when a required field is missing',
@@ -525,6 +530,19 @@ const useUpload = () => {
525
530
  } else if (error.errorData?.invalid > 0) {
526
531
  actions.setUploadFileResponse(error.errorData);
527
532
  actions.setCurrentStep('upload-error');
533
+ } else if (error.statusCode === 408) {
534
+ actions.cancelImport();
535
+ showNotification({
536
+ kind: 'error',
537
+ domain: constants.DOMAINS.PAGE,
538
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
539
+ });
540
+ sentry.reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
541
+ extra: {
542
+ error,
543
+ fileSizeInBytes: state.droppedFile?.size
544
+ }
545
+ });
528
546
  } else {
529
547
  actions.cancelImport();
530
548
  showNotification({
@@ -404,6 +404,11 @@ var messages$4 = defineMessages({
404
404
  description: 'Generic notification message when file upload fails',
405
405
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
406
406
  },
407
+ uploadIsTakingTooLong: {
408
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
409
+ description: 'Notification message when file upload is taking longer than expected',
410
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
411
+ },
407
412
  missingRequiredField: {
408
413
  id: 'UnpublishProductsModal.missingRequiredField',
409
414
  description: 'Error message displayed when a required field is missing',
@@ -507,6 +512,19 @@ const useUpload = () => {
507
512
  } else if (error.errorData?.invalid > 0) {
508
513
  actions.setUploadFileResponse(error.errorData);
509
514
  actions.setCurrentStep('upload-error');
515
+ } else if (error.statusCode === 408) {
516
+ actions.cancelImport();
517
+ showNotification({
518
+ kind: 'error',
519
+ domain: DOMAINS.PAGE,
520
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
521
+ });
522
+ reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
523
+ extra: {
524
+ error,
525
+ fileSizeInBytes: state.droppedFile?.size
526
+ }
527
+ });
510
528
  } else {
511
529
  actions.cancelImport();
512
530
  showNotification({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/unpublish-products-modal",
3
3
  "description": "Shared import modal for unpublishing products",
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -31,7 +31,7 @@
31
31
  "pluralize": "8.0.0",
32
32
  "prop-types": "15.8.1",
33
33
  "ramda": "^0.32.0",
34
- "@commercetools-frontend-extensions/operations": "3.3.0"
34
+ "@commercetools-frontend-extensions/operations": "3.4.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@commercetools-frontend/actions-global": "25.1.0",