From 020145aa1fca9474f15d805fd3955b39bcc386ad Mon Sep 17 00:00:00 2001 From: Mikita Siadykh Date: Thu, 20 Feb 2025 12:52:22 +0300 Subject: [PATCH] UIREC-428 Fix disable state on Piece form --- CHANGELOG.md | 1 + src/Piece/PieceForm/PieceForm.js | 1 + .../PieceForm/PieceFormActionButtons/PieceFormActionButtons.js | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ac8fb37..35ce1847 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * *Breaking* Update "Send claim" action to use `pieces.send-claims` interface. Refs UIREC-412. * Add permissions to view claims. Refs UIREC-430. * Migrate to shared GA workflows. Refs UIREC-431. +* Fix disable state on Piece form. Refs UIREC-428. ## [6.0.6](https://github.com/folio-org/ui-receiving/tree/v6.0.6) (2025-01-06) [Full Changelog](https://github.com/folio-org/ui-receiving/compare/v6.0.5...v6.0.6) diff --git a/src/Piece/PieceForm/PieceForm.js b/src/Piece/PieceForm/PieceForm.js index 77ca5cf7..ebe374a4 100644 --- a/src/Piece/PieceForm/PieceForm.js +++ b/src/Piece/PieceForm/PieceForm.js @@ -419,6 +419,7 @@ export default stripesFinalForm({ subscription: { hasValidationErrors: true, values: true, + errors: true, }, mutators: { setLocationValue: setLocationValueFormMutator, diff --git a/src/Piece/PieceForm/PieceFormActionButtons/PieceFormActionButtons.js b/src/Piece/PieceForm/PieceFormActionButtons/PieceFormActionButtons.js index 7e5435fd..538fe4f2 100644 --- a/src/Piece/PieceForm/PieceFormActionButtons/PieceFormActionButtons.js +++ b/src/Piece/PieceForm/PieceFormActionButtons/PieceFormActionButtons.js @@ -46,7 +46,7 @@ export const PieceFormActionButtons = ({ }); const saveButtonLabelId = 'stripes-components.saveAndClose'; const isSaveDisabled = actionsDisabled?.[PIECE_ACTION_NAMES.saveAndClose]; - const isActionsMenuDisabled = isSaveDisabled && actionsDisabled?.[PIECE_ACTION_NAMES.delete]; + const isActionsMenuDisabled = isSaveDisabled && (actionsDisabled?.[PIECE_ACTION_NAMES.delete] || !isEditMode); if (actionMenu.length === 0) { return (