From 137ed68509e9c5498846f86abe8b57d776f9b1f4 Mon Sep 17 00:00:00 2001 From: ismay Date: Thu, 15 Feb 2024 12:18:56 +0100 Subject: [PATCH] fix: improve text for discard form modal --- .../add-job/back-to-all-jobs/index.js | 4 +--- .../add-queue/back-to-all-jobs/index.js | 4 +--- .../edit-job/back-to-all-jobs/index.js | 4 +--- .../edit-queue/back-to-all-jobs/index.js | 4 +--- i18n/en.pot | 22 ++++++++++++------- src/components/Modal/DiscardFormModal.js | 10 ++++++--- 6 files changed, 25 insertions(+), 23 deletions(-) diff --git a/cypress/integration/add-job/back-to-all-jobs/index.js b/cypress/integration/add-job/back-to-all-jobs/index.js index 050770b5..ac53fe1b 100644 --- a/cypress/integration/add-job/back-to-all-jobs/index.js +++ b/cypress/integration/add-job/back-to-all-jobs/index.js @@ -18,7 +18,5 @@ Then('the list route will be loaded', () => { }) Then('the user will be asked if they want to discard their changes', () => { - cy.findByText('Are you sure you want to discard your changes?').should( - 'exist' - ) + cy.findByText('Discard unsaved changes?').should('exist') }) diff --git a/cypress/integration/add-queue/back-to-all-jobs/index.js b/cypress/integration/add-queue/back-to-all-jobs/index.js index 7dd359c2..76e7f8ae 100644 --- a/cypress/integration/add-queue/back-to-all-jobs/index.js +++ b/cypress/integration/add-queue/back-to-all-jobs/index.js @@ -18,7 +18,5 @@ Then('the list route will be loaded', () => { }) Then('the user will be asked if they want to discard their changes', () => { - cy.findByText('Are you sure you want to discard your changes?').should( - 'exist' - ) + cy.findByText('Discard unsaved changes?').should('exist') }) diff --git a/cypress/integration/edit-job/back-to-all-jobs/index.js b/cypress/integration/edit-job/back-to-all-jobs/index.js index e2d314d8..ea6f0637 100644 --- a/cypress/integration/edit-job/back-to-all-jobs/index.js +++ b/cypress/integration/edit-job/back-to-all-jobs/index.js @@ -25,7 +25,5 @@ Then('the list route will be loaded', () => { }) Then('the user will be asked if they want to discard their changes', () => { - cy.findByText('Are you sure you want to discard your changes?').should( - 'exist' - ) + cy.findByText('Discard unsaved changes?').should('exist') }) diff --git a/cypress/integration/edit-queue/back-to-all-jobs/index.js b/cypress/integration/edit-queue/back-to-all-jobs/index.js index fdfcc493..f8eee873 100644 --- a/cypress/integration/edit-queue/back-to-all-jobs/index.js +++ b/cypress/integration/edit-queue/back-to-all-jobs/index.js @@ -40,7 +40,5 @@ Then('the list route will be loaded', () => { }) Then('the user will be asked if they want to discard their changes', () => { - cy.findByText('Are you sure you want to discard your changes?').should( - 'exist' - ) + cy.findByText('Discard unsaved changes?').should('exist') }) diff --git a/i18n/en.pot b/i18n/en.pot index 5aa8b5a2..ce1daa3a 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,8 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2024-01-02T14:28:02.554Z\n" -"PO-Revision-Date: 2024-01-02T14:28:02.554Z\n" +"POT-Creation-Date: 2024-02-15T11:19:20.108Z\n" +"PO-Revision-Date: 2024-02-15T11:19:20.108Z\n" msgid "Something went wrong" msgstr "Something went wrong" @@ -189,8 +189,8 @@ msgstr "On/off" msgid "No jobs to display" msgstr "No jobs to display" -msgid "Not scheduled" -msgstr "Not scheduled" +msgid "Now" +msgstr "Now" msgid "Hide jobs" msgstr "Hide jobs" @@ -237,11 +237,17 @@ msgstr "Are you sure you want to delete this job?" msgid "Are you sure you want to delete this queue?" msgstr "Are you sure you want to delete this queue?" -msgid "Are you sure you want to discard your changes?" -msgstr "Are you sure you want to discard your changes?" +msgid "Discard unsaved changes?" +msgstr "Discard unsaved changes?" -msgid "Discard" -msgstr "Discard" +msgid "This form has unsaved changes. Are you sure that you want to discard them?" +msgstr "This form has unsaved changes. Are you sure that you want to discard them?" + +msgid "No, keep changes" +msgstr "No, keep changes" + +msgid "Yes, discard changes" +msgstr "Yes, discard changes" msgid "Error running job" msgstr "Error running job" diff --git a/src/components/Modal/DiscardFormModal.js b/src/components/Modal/DiscardFormModal.js index 2677c523..1984970d 100644 --- a/src/components/Modal/DiscardFormModal.js +++ b/src/components/Modal/DiscardFormModal.js @@ -3,6 +3,7 @@ import PropTypes from 'prop-types' import { Button, Modal, + ModalTitle, ModalContent, ModalActions, ButtonStrip, @@ -12,8 +13,11 @@ import history from '../../services/history' const DiscardFormModal = ({ hideModal }) => ( + {i18n.t('Discard unsaved changes?')} - {i18n.t('Are you sure you want to discard your changes?')} + {i18n.t( + 'This form has unsaved changes. Are you sure that you want to discard them?' + )} @@ -22,7 +26,7 @@ const DiscardFormModal = ({ hideModal }) => ( secondary onClick={hideModal} > - {i18n.t('Cancel')} + {i18n.t('No, keep changes')}