Skip to content

Commit

Permalink
refactor: add file attachment info text
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Mar 19, 2021
1 parent 85c511c commit 277640a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 2 deletions.
6 changes: 5 additions & 1 deletion locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ msgstr "Add field"

#: components/Sidebar
msgid "Cancel"
msgstr ""
msgstr "Cancel"

#: components/FormView
msgid "Error"
Expand All @@ -31,6 +31,10 @@ msgstr "Form"
msgid "formSubmitted"
msgstr "Form successfully submitted"

#: components/Sidebar
msgid "form_attachment_info_text"
msgstr "Attached file will be sent via email, but not stored"

#: components/Sidebar
msgid "form_clear_data"
msgstr "Clear data"
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 @@ -31,6 +31,10 @@ msgstr "Form"
msgid "formSubmitted"
msgstr "Form invato correttamente"

#: components/Sidebar
msgid "form_attachment_info_text"
msgstr "Il file allegato sarà inviato per email, ma non salvato."

#: components/Sidebar
msgid "form_clear_data"
msgstr "Pulisci dati"
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-18T12:53:43.029Z\n"
"POT-Creation-Date: 2021-03-19T10:17:44.478Z\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 @@ -38,6 +38,11 @@ msgstr ""
msgid "formSubmitted"
msgstr ""

#: components/Sidebar
# defaultMessage: Attached file will be sent via email, but not stored
msgid "form_attachment_info_text"
msgstr ""

#: components/Sidebar
# defaultMessage: Clear data
msgid "form_clear_data"
Expand Down
15 changes: 15 additions & 0 deletions src/components/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
CheckboxWidget,
SelectWidget,
ArrayWidget,
FormFieldWrapper,
} from '@plone/volto/components';

import upSVG from '@plone/volto/icons/up-key.svg';
Expand Down Expand Up @@ -139,6 +140,10 @@ const messages = defineMessages({
id: 'Cancel',
defaultMessage: 'Cancel',
},
attachmentInfoText: {
id: 'form_attachment_info_text',
defaultMessage: 'Attached file will be sent via email, but not stored',
},
});

const Sidebar = ({
Expand Down Expand Up @@ -407,6 +412,16 @@ const Sidebar = ({
]}
/>

{subblock.field_type === 'attachment' && (
<FormFieldWrapper id="attachment-info" columns={1}>
<div className="wrapper">
<p>
{intl.formatMessage(messages.attachmentInfoText)}
</p>
</div>
</FormFieldWrapper>
)}

{['select', 'radio', 'checkbox'].indexOf(
subblock.field_type,
) >= 0 && (
Expand Down

0 comments on commit 277640a

Please sign in to comment.