@commercetools-frontend-extensions/delete-resources-modal 1.6.0 → 1.7.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.
@@ -441,7 +441,7 @@ var messages$4 = reactIntl.defineMessages({
441
441
  uploadIsTakingTooLong: {
442
442
  id: 'operations.import.resource.upload.uploadIsTakingTooLong',
443
443
  description: 'Notification message when file upload is taking longer than expected',
444
- defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
444
+ defaultMessage: 'The upload took too long. Please reduce file size or split the data into smaller files.'
445
445
  },
446
446
  missingRequiredField: {
447
447
  id: 'DeleteResourcesModal.missingRequiredField',
@@ -572,6 +572,18 @@ const useUpload = () => {
572
572
  text: intl.formatMessage(messages$4.unexpectedError)
573
573
  });
574
574
  }
575
+ } else if (error instanceof operations.PollingTimeoutError) {
576
+ actions.cancelImport();
577
+ showNotification({
578
+ kind: 'error',
579
+ domain: constants.DOMAINS.PAGE,
580
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
581
+ });
582
+ sentry.reportErrorToSentry(error, {
583
+ extra: {
584
+ fileSizeInBytes: state.droppedFile?.size
585
+ }
586
+ });
575
587
  } else {
576
588
  actions.cancelImport();
577
589
  showNotification({
@@ -441,7 +441,7 @@ var messages$4 = reactIntl.defineMessages({
441
441
  uploadIsTakingTooLong: {
442
442
  id: 'operations.import.resource.upload.uploadIsTakingTooLong',
443
443
  description: 'Notification message when file upload is taking longer than expected',
444
- defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
444
+ defaultMessage: 'The upload took too long. Please reduce file size or split the data into smaller files.'
445
445
  },
446
446
  missingRequiredField: {
447
447
  id: 'DeleteResourcesModal.missingRequiredField',
@@ -572,6 +572,18 @@ const useUpload = () => {
572
572
  text: intl.formatMessage(messages$4.unexpectedError)
573
573
  });
574
574
  }
575
+ } else if (error instanceof operations.PollingTimeoutError) {
576
+ actions.cancelImport();
577
+ showNotification({
578
+ kind: 'error',
579
+ domain: constants.DOMAINS.PAGE,
580
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
581
+ });
582
+ sentry.reportErrorToSentry(error, {
583
+ extra: {
584
+ fileSizeInBytes: state.droppedFile?.size
585
+ }
586
+ });
575
587
  } else {
576
588
  actions.cancelImport();
577
589
  showNotification({
@@ -11,7 +11,7 @@ import { defineMessages, useIntl, FormattedMessage, IntlProvider } from 'react-i
11
11
  import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
12
12
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
13
13
  import React, { useContext, useState, useEffect } from 'react';
14
- import { deleteImportContainer, EnabledDropArea, FileDroppedArea, ActiveDragDropArea, useFileUpload, getRowCount, toBytes, hasSingleKeyColumn, isAbortError, HttpError, IMPORT_MAX_FILE_SIZE_MB, IMPORT_LEGACY_MAX_FILE_SIZE_MB, IMPORT_MAX_ITEM_COUNT, IMPORT_LEGACY_MAX_ROW_COUNT, FileDropArea as FileDropArea$1, UploadingModal, mapFileUploadErrorsToUploadFileErrorRows, processFileImportJob, processUploadedFile } from '@commercetools-frontend-extensions/operations';
14
+ import { deleteImportContainer, EnabledDropArea, FileDroppedArea, ActiveDragDropArea, useFileUpload, getRowCount, toBytes, hasSingleKeyColumn, isAbortError, HttpError, PollingTimeoutError, IMPORT_MAX_FILE_SIZE_MB, IMPORT_LEGACY_MAX_FILE_SIZE_MB, IMPORT_MAX_ITEM_COUNT, IMPORT_LEGACY_MAX_ROW_COUNT, FileDropArea as FileDropArea$1, UploadingModal, mapFileUploadErrorsToUploadFileErrorRows, processFileImportJob, processUploadedFile } from '@commercetools-frontend-extensions/operations';
15
15
  import { jsx, jsxs } from '@emotion/react/jsx-runtime';
16
16
  import { FormDialog, InfoDialog } from '@commercetools-frontend/application-components';
17
17
  import { Masking } from '@commercetools-frontend/fullstory';
@@ -423,7 +423,7 @@ var messages$4 = defineMessages({
423
423
  uploadIsTakingTooLong: {
424
424
  id: 'operations.import.resource.upload.uploadIsTakingTooLong',
425
425
  description: 'Notification message when file upload is taking longer than expected',
426
- defaultMessage: 'Upload timed out. Please reduce your file size or split the data into smaller files and try again.'
426
+ defaultMessage: 'The upload took too long. Please reduce file size or split the data into smaller files.'
427
427
  },
428
428
  missingRequiredField: {
429
429
  id: 'DeleteResourcesModal.missingRequiredField',
@@ -554,6 +554,18 @@ const useUpload = () => {
554
554
  text: intl.formatMessage(messages$4.unexpectedError)
555
555
  });
556
556
  }
557
+ } else if (error instanceof PollingTimeoutError) {
558
+ actions.cancelImport();
559
+ showNotification({
560
+ kind: 'error',
561
+ domain: DOMAINS.PAGE,
562
+ text: intl.formatMessage(messages$4.uploadIsTakingTooLong)
563
+ });
564
+ reportErrorToSentry(error, {
565
+ extra: {
566
+ fileSizeInBytes: state.droppedFile?.size
567
+ }
568
+ });
557
569
  } else {
558
570
  actions.cancelImport();
559
571
  showNotification({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@commercetools-frontend-extensions/delete-resources-modal",
3
3
  "description": "Shared import modal for deleting resources",
4
- "version": "1.6.0",
4
+ "version": "1.7.1",
5
5
  "license": "BSD-3-Clause",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -23,7 +23,7 @@
23
23
  "@formatjs/cli": "6.7.4",
24
24
  "babel-plugin-module-resolver": "^5.0.2",
25
25
  "jest": "30.2.0",
26
- "lodash": "4.17.21",
26
+ "lodash": "4.17.23",
27
27
  "lodash.truncate": "4.4.2",
28
28
  "moment": "2.30.1",
29
29
  "omit-empty-es": "^1.1.3",
@@ -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.4.0"
34
+ "@commercetools-frontend-extensions/operations": "3.6.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@commercetools-frontend/actions-global": "25.1.0",