Skip to content

Commit

Permalink
feat: additionalFields from config
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Aug 3, 2021
1 parent fe39c0a commit 29cacb1
Show file tree
Hide file tree
Showing 16 changed files with 147 additions and 46 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ In Edit, you can export and clear stored data from the sidebar.

<img alt="Form export" src="./docs/store-export-data.png" width="400" />

## Additional fields

In addition to the fields described above, you can add any field you want.
If you need a field that is not supported, PRs are always welcome, but if you have to use a custom field tailored on your project needs, then you can add additional custom fields.

```jsx
config.blocks.blocksConfig.form.additionalFields.push({
id: 'field type id',
label:
intl.formatMessage(messages.customFieldLabel) ||
'Label for field type select, translation obj or string',
component: MyCustomWidget,
});
```

## Static fields

In backend integration, you can add in block data an object called `static_fields` and the form block will show those in form view as readonly and will aggregate those with user compiled data.
Expand Down
8 changes: 8 additions & 0 deletions locales/de/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/en/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr "Errore"
msgid "Form"
msgstr "Form"

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

#: components/Form
msgid "formSubmitted"
msgstr "Form successfully submitted"
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr "Use as 'reply to'"
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr "If selected, this will be the address the receiver can use to reply."

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/es/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/eu/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/fr/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr "Erreur"
msgid "Form"
msgstr "Formulaire"

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

#: components/Form
msgid "formSubmitted"
msgstr "Formulaire soumis avec succès"
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/it/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr "Errore"
msgid "Form"
msgstr "Form"

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

#: components/Form
msgid "formSubmitted"
msgstr "Form invato correttamente"
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr "Usa come 'reply to'"
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr "Se selezionato, questo sarà l'indirizzo a cui il destinatario potrà rispondere."

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/ja/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/nl/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
8 changes: 8 additions & 0 deletions locales/pt/LC_MESSAGES/volto.po
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ msgstr ""
msgid "Form"
msgstr ""

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

#: components/Form
msgid "formSubmitted"
msgstr ""
Expand Down Expand Up @@ -175,3 +179,7 @@ msgstr ""
#: components/Sidebar
msgid "form_useAsReplyTo_description"
msgstr ""

#: components/Sidebar
msgid "title"
msgstr ""
Loading

0 comments on commit 29cacb1

Please sign in to comment.