@commercetools-frontend-extensions/import-resources-modal 1.14.1 → 1.15.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.
@@ -549,6 +549,11 @@ var messages$5 = reactIntl.defineMessages({
549
549
  description: 'Generic notification message when file upload fails',
550
550
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
551
551
  },
552
+ uploadIsTakingTooLong: {
553
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
554
+ description: 'Notification message when file upload is taking longer than expected',
555
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
556
+ },
552
557
  missingRequiredField: {
553
558
  id: 'ImportResourcesModal.missingRequiredField',
554
559
  description: 'Error message displayed when a required field is missing',
@@ -1031,6 +1036,19 @@ const useUpload = () => {
1031
1036
  } else if (error.errorData?.invalid > 0) {
1032
1037
  actions.setUploadFileResponse(error.errorData);
1033
1038
  actions.setCurrentStep(CurrentStep$1.UploadResult);
1039
+ } else if (error.statusCode === 408) {
1040
+ actions.cancelImport();
1041
+ showNotification({
1042
+ kind: 'error',
1043
+ domain: constants.DOMAINS.PAGE,
1044
+ text: intl.formatMessage(messages$5.uploadIsTakingTooLong)
1045
+ });
1046
+ sentry.reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
1047
+ extra: {
1048
+ resourceType: state.resourceType,
1049
+ fileSizeInBytes: state.droppedFile?.size
1050
+ }
1051
+ });
1034
1052
  } else {
1035
1053
  actions.cancelImport();
1036
1054
  showNotification({
@@ -549,6 +549,11 @@ var messages$5 = reactIntl.defineMessages({
549
549
  description: 'Generic notification message when file upload fails',
550
550
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
551
551
  },
552
+ uploadIsTakingTooLong: {
553
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
554
+ description: 'Notification message when file upload is taking longer than expected',
555
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
556
+ },
552
557
  missingRequiredField: {
553
558
  id: 'ImportResourcesModal.missingRequiredField',
554
559
  description: 'Error message displayed when a required field is missing',
@@ -1031,6 +1036,19 @@ const useUpload = () => {
1031
1036
  } else if (error.errorData?.invalid > 0) {
1032
1037
  actions.setUploadFileResponse(error.errorData);
1033
1038
  actions.setCurrentStep(CurrentStep$1.UploadResult);
1039
+ } else if (error.statusCode === 408) {
1040
+ actions.cancelImport();
1041
+ showNotification({
1042
+ kind: 'error',
1043
+ domain: constants.DOMAINS.PAGE,
1044
+ text: intl.formatMessage(messages$5.uploadIsTakingTooLong)
1045
+ });
1046
+ sentry.reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
1047
+ extra: {
1048
+ resourceType: state.resourceType,
1049
+ fileSizeInBytes: state.droppedFile?.size
1050
+ }
1051
+ });
1034
1052
  } else {
1035
1053
  actions.cancelImport();
1036
1054
  showNotification({
@@ -528,6 +528,11 @@ var messages$5 = defineMessages({
528
528
  description: 'Generic notification message when file upload fails',
529
529
  defaultMessage: 'An unexpected error occurred during the file upload. Please try again, or contact support if this error occurs again.'
530
530
  },
531
+ uploadIsTakingTooLong: {
532
+ id: 'operations.import.resource.upload.uploadIsTakingTooLong',
533
+ description: 'Notification message when file upload is taking longer than expected',
534
+ defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
535
+ },
531
536
  missingRequiredField: {
532
537
  id: 'ImportResourcesModal.missingRequiredField',
533
538
  description: 'Error message displayed when a required field is missing',
@@ -1010,6 +1015,19 @@ const useUpload = () => {
1010
1015
  } else if (error.errorData?.invalid > 0) {
1011
1016
  actions.setUploadFileResponse(error.errorData);
1012
1017
  actions.setCurrentStep(CurrentStep$1.UploadResult);
1018
+ } else if (error.statusCode === 408) {
1019
+ actions.cancelImport();
1020
+ showNotification({
1021
+ kind: 'error',
1022
+ domain: DOMAINS.PAGE,
1023
+ text: intl.formatMessage(messages$5.uploadIsTakingTooLong)
1024
+ });
1025
+ reportErrorToSentry(new Error('Upload File Error: The upload request timed out (408 Request Timeout)'), {
1026
+ extra: {
1027
+ resourceType: state.resourceType,
1028
+ fileSizeInBytes: state.droppedFile?.size
1029
+ }
1030
+ });
1013
1031
  } else {
1014
1032
  actions.cancelImport();
1015
1033
  showNotification({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/import-resources-modal",
3
3
  "description": "Shared import modal for importing resources",
4
- "version": "1.14.1",
4
+ "version": "1.15.1",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -22,7 +22,7 @@
22
22
  "@emotion/styled": "11.14.1",
23
23
  "@formatjs/cli": "6.7.4",
24
24
  "babel-plugin-module-resolver": "^5.0.2",
25
- "jest": "29.7.0",
25
+ "jest": "30.2.0",
26
26
  "lodash": "4.17.21",
27
27
  "lodash.truncate": "4.4.2",
28
28
  "moment": "2.30.1",
@@ -31,27 +31,27 @@
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.2.1"
34
+ "@commercetools-frontend-extensions/operations": "3.4.0"
35
35
  },
36
36
  "devDependencies": {
37
- "@commercetools-frontend/actions-global": "24.13.0",
38
- "@commercetools-frontend/application-components": "24.13.0",
39
- "@commercetools-frontend/application-shell": "24.13.0",
40
- "@commercetools-frontend/application-shell-connectors": "24.13.0",
41
- "@commercetools-frontend/constants": "24.13.0",
37
+ "@commercetools-frontend/actions-global": "25.1.0",
38
+ "@commercetools-frontend/application-components": "25.1.0",
39
+ "@commercetools-frontend/application-shell": "25.1.0",
40
+ "@commercetools-frontend/application-shell-connectors": "25.1.0",
41
+ "@commercetools-frontend/constants": "25.1.0",
42
42
  "@commercetools-frontend/fullstory": "4.0.3",
43
- "@commercetools-frontend/i18n": "24.13.0",
44
- "@commercetools-frontend/jest-preset-mc-app": "24.13.0",
45
- "@commercetools-frontend/permissions": "24.13.0",
46
- "@commercetools-frontend/sdk": "24.13.0",
47
- "@commercetools-frontend/sentry": "24.13.0",
43
+ "@commercetools-frontend/i18n": "25.1.0",
44
+ "@commercetools-frontend/jest-preset-mc-app": "25.1.0",
45
+ "@commercetools-frontend/permissions": "25.1.0",
46
+ "@commercetools-frontend/sdk": "25.1.0",
47
+ "@commercetools-frontend/sentry": "25.1.0",
48
48
  "@commercetools-frontend/ui-kit": "20.3.0",
49
49
  "@commercetools-uikit/data-table": "20.3.0",
50
50
  "@commercetools-uikit/design-system": "20.3.0",
51
51
  "@commercetools-uikit/icons": "20.3.0",
52
52
  "@commercetools-uikit/select-field": "20.3.0",
53
53
  "@preconstruct/cli": "2.8.12",
54
- "@types/jest": "29.5.14",
54
+ "@types/jest": "30.0.0",
55
55
  "@types/lodash.truncate": "^4.4.7",
56
56
  "@types/papaparse": "5.5.2",
57
57
  "@types/testing-library__jest-dom": "^5.14.5",
@@ -63,17 +63,17 @@
63
63
  "rimraf": "6.1.2"
64
64
  },
65
65
  "peerDependencies": {
66
- "@commercetools-frontend/actions-global": "23.x || 24.x",
67
- "@commercetools-frontend/application-components": "23.x || 24.x",
68
- "@commercetools-frontend/application-shell": "23.x || 24.x",
69
- "@commercetools-frontend/application-shell-connectors": "23.x || 24.x",
70
- "@commercetools-frontend/constants": "23.x || 24.x",
66
+ "@commercetools-frontend/actions-global": "24.x || 25.x",
67
+ "@commercetools-frontend/application-components": "24.x || 25.x",
68
+ "@commercetools-frontend/application-shell": "24.x || 25.x",
69
+ "@commercetools-frontend/application-shell-connectors": "24.x || 25.x",
70
+ "@commercetools-frontend/constants": "24.x || 25.x",
71
71
  "@commercetools-frontend/fullstory": "2.x || 3.x || 4.x",
72
- "@commercetools-frontend/i18n": "23.x || 24.x",
73
- "@commercetools-frontend/jest-preset-mc-app": "23.x || 24.x",
74
- "@commercetools-frontend/permissions": "23.x || 24.x",
75
- "@commercetools-frontend/sdk": "23.x || 24.x",
76
- "@commercetools-frontend/sentry": "23.x || 24.x",
72
+ "@commercetools-frontend/i18n": "24.x || 25.x",
73
+ "@commercetools-frontend/jest-preset-mc-app": "24.x || 25.x",
74
+ "@commercetools-frontend/permissions": "24.x || 25.x",
75
+ "@commercetools-frontend/sdk": "24.x || 25.x",
76
+ "@commercetools-frontend/sentry": "24.x || 25.x",
77
77
  "@commercetools-frontend/ui-kit": "19.x || 20.x",
78
78
  "@commercetools-uikit/design-system": "19.x || 20.x",
79
79
  "@commercetools-uikit/icons": "19.x || 20.x",