Skip to content

Commit

Permalink
refactor: add confirm message
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Mar 15, 2021
1 parent be2f7d0 commit e321e76
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ msgstr "Form"
msgid "form_clear_data"
msgstr "Clear data"

#: components/Sidebar
msgid "form_confirmClearData"
msgstr "Are you sure you want to delete all saved items?"

#: components/Sidebar
msgid "form_default_from"
msgstr "Default sender"
Expand Down
4 changes: 4 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ msgstr "Form"
msgid "form_clear_data"
msgstr "Pulisci dati"

#: components/Sidebar
msgid "form_confirmClearData"
msgstr "Confermi di voler eliminare tutti i dati salvati?"

#: components/Sidebar
msgid "form_default_from"
msgstr "Mittente di default"
Expand Down
7 changes: 6 additions & 1 deletion locales/volto.pot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Plone\n"
"POT-Creation-Date: 2021-03-15T10:14:14.988Z\n"
"POT-Creation-Date: 2021-03-15T11:30:24.054Z\n"
"Last-Translator: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"Language-Team: Plone i18n <plone-i18n@lists.sourceforge.net>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -43,6 +43,11 @@ msgstr ""
msgid "form_clear_data"
msgstr ""

#: components/Sidebar
# defaultMessage: Are you sure you want to delete all saved items?
msgid "form_confirmClearData"
msgstr ""

#: components/Sidebar
# defaultMessage: Default sender
msgid "form_default_from"
Expand Down
5 changes: 5 additions & 0 deletions src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ const messages = defineMessages({
id: 'form_formDataCount',
defaultMessage: '{formDataCount} item(s) stored',
},
confirmClearData: {
id: 'form_confirmClearData',
defaultMessage: 'Are you sure you want to delete all saved items?',
},
});

const Sidebar = ({
Expand Down Expand Up @@ -305,6 +309,7 @@ const Sidebar = ({
</Button>
<Confirm
open={confirmOpen}
content={intl.formatMessage(messages.confirmClearData)}
onCancel={() => setConfirmOpen(false)}
onConfirm={() => {
dispatch(clearFormData(properties['@id']));
Expand Down

0 comments on commit e321e76

Please sign in to comment.