Skip to content

Commit

Permalink
fix: improve text for discard form modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay authored and ismay committed Feb 20, 2024
1 parent 7e5be87 commit 914ccb6
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 23 deletions.
4 changes: 1 addition & 3 deletions cypress/integration/add-job/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
4 changes: 1 addition & 3 deletions cypress/integration/add-queue/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
4 changes: 1 addition & 3 deletions cypress/integration/edit-job/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
4 changes: 1 addition & 3 deletions cypress/integration/edit-queue/back-to-all-jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})
22 changes: 14 additions & 8 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions src/components/Modal/DiscardFormModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types'
import {
Button,
Modal,
ModalTitle,
ModalContent,
ModalActions,
ButtonStrip,
Expand All @@ -12,8 +13,11 @@ import history from '../../services/history'

const DiscardFormModal = ({ hideModal }) => (
<Modal open small onClose={hideModal}>
<ModalTitle>{i18n.t('Discard unsaved changes?')}</ModalTitle>
<ModalContent>
{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?'
)}
</ModalContent>
<ModalActions>
<ButtonStrip end>
Expand All @@ -22,7 +26,7 @@ const DiscardFormModal = ({ hideModal }) => (
secondary
onClick={hideModal}
>
{i18n.t('Cancel')}
{i18n.t('No, keep changes')}
</Button>
<Button
name="discard-form"
Expand All @@ -32,7 +36,7 @@ const DiscardFormModal = ({ hideModal }) => (
history.push('/')
}}
>
{i18n.t('Discard')}
{i18n.t('Yes, discard changes')}
</Button>
</ButtonStrip>
</ModalActions>
Expand Down

1 comment on commit 914ccb6

@dhis2-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.