diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b8fc4fc..e0c767dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ * [UIBULKED-559](https://folio-org.atlassian.net/browse/UIBULKED-559) Update subfield validation in MARC form. * [UIBULKED-558](https://folio-org.atlassian.net/browse/UIBULKED-558) Add translation for new "Member" column. * [UIBULKED-556](https://folio-org.atlassian.net/browse/UIBULKED-556) ECS - remove link to affected record in Optimistic error for holdings and items. +* [UIBULKED-497](https://folio-org.atlassian.net/browse/UIBULKED-497) "Are you sure" preview displays outdated values after User changed selection on bulk edit form and clicked "Confirm changes". ## [4.1.4](https://github.com/folio-org/ui-bulk-edit/tree/v4.1.4) (2024-05-29) diff --git a/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditInAppPreviewModal.css b/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditInAppPreviewModal.css index 45d0d440..76592c82 100644 --- a/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditInAppPreviewModal.css +++ b/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditInAppPreviewModal.css @@ -2,6 +2,12 @@ max-width: 1024px; } +.previewLoading { + display: flex; + justify-content: center; + align-items: center; +} + .previewModalFooter { width: 100%; display: flex; diff --git a/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditPreviewModal.js b/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditPreviewModal.js index 24d33b73..50917f7c 100644 --- a/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditPreviewModal.js +++ b/src/components/BulkEditPane/BulkEditListResult/BulkEditInAppPreviewModal/BulkEditPreviewModal.js @@ -10,6 +10,7 @@ import { APPROACHES, EDITING_STEPS, FILE_KEYS, + JOB_STATUSES, } from '../../../../constants'; import { useBulkOperationStart, @@ -74,8 +75,8 @@ export const BulkEditPreviewModal = ({ { callout({ type: 'error', @@ -89,31 +91,41 @@ export const BulkEditPreviewModalList = ({ }; return ( - <> - {renderMessageBanner()} + bulkDetails?.status !== JOB_STATUSES.DATA_MODIFICATION_IN_PROGRESS ? + ( + <> + {renderMessageBanner()} - + + - + - {contentData.length > 0 && ( - - )} - + {contentData.length > 0 && ( + + )} + + ) + : +
+ +
); }; diff --git a/src/constants/core.js b/src/constants/core.js index 61cfdc1b..8bf67bda 100644 --- a/src/constants/core.js +++ b/src/constants/core.js @@ -57,6 +57,7 @@ export const JOB_STATUSES = { CANCELLED: 'CANCELLED', SCHEDULED: 'SCHEDULED', FAILED: 'FAILED', + DATA_MODIFICATION_IN_PROGRESS: 'DATA_MODIFICATION_IN_PROGRESS', }; export const EDITING_STEPS = { diff --git a/src/hooks/useConfirmChanges.js b/src/hooks/useConfirmChanges.js index 5b2ddc5d..a65e0a6d 100644 --- a/src/hooks/useConfirmChanges.js +++ b/src/hooks/useConfirmChanges.js @@ -33,7 +33,7 @@ export const useConfirmChanges = ({ const [isPreviewModalOpened, setIsPreviewModalOpened] = useState(false); const [isPreviewLoading, setIsPreviewLoading] = useState(false); - const { bulkDetails } = useBulkOperationDetails({ id: bulkOperationId }); + const { bulkDetails } = useBulkOperationDetails({ id: bulkOperationId, interval: 1000 * 3 }); const { bulkOperationStart } = useBulkOperationStart(); const totalRecords = bulkDetails?.totalNumOfRecords;