diff --git a/assets/js/components/record_details/NewVersionButton.js b/assets/js/components/record_details/NewVersionButton.js index f3b0fcdd..892f02b5 100644 --- a/assets/js/components/record_details/NewVersionButton.js +++ b/assets/js/components/record_details/NewVersionButton.js @@ -27,12 +27,8 @@ export const NewVersionButton = ({ onError, record, disabled, ...uiProps }) => { committeeApproval?.approval_label || i18next.t("Committee approval"); const handleClick = useCallback(async () => { - if ( - ["submitted", "accepted"].includes(committeeApprovalStatus) && - !showModal - ) { - // If a request exists, we discourage creating a new version. - // This applies even if the request has been accepted. + if (committeeApprovalStatus === "submitted" && !showModal) { + // If a request is pending, we discourage creating a new version. setShowModal(true); return; } else if (showModal) { @@ -83,41 +79,25 @@ export const NewVersionButton = ({ onError, record, disabled, ...uiProps }) => { - {committeeApprovalStatus === "submitted" && - i18next.t("{{approvalLabel}} request pending", { - approvalLabel, - })} - {committeeApprovalStatus === "accepted" && - i18next.t("{{approvalLabel}} already complete", { - approvalLabel, - })} + {i18next.t("{{approvalLabel}} request pending", { + approvalLabel, + })} - {committeeApprovalStatus === "submitted" && ( - <> -

- {i18next.t( - "An {{approvalLabel}} request is already pending for an existing version of this record. " + - "A new version will not be taken into account for the {{approvalLabel}} request.", - { - approvalLabel, - } - )} -

-

- {i18next.t( - "Creating a new version while the request is pending is not recommended." - )} -

- - )} - {committeeApprovalStatus === "accepted" && ( -

- {i18next.t( - "A version of this record has already been approved. Creating a new version following an approved request is not recommended." - )} -

- )} +

+ {i18next.t( + "An {{approvalLabel}} request is already pending for an existing version of this record. " + + "A new version will not be taken into account for the {{approvalLabel}} request.", + { + approvalLabel, + } + )} +

+

+ {i18next.t( + "Creating a new version while the request is pending is not recommended." + )} +