From 8c6e0638d682f58d1cb716659d7b7e91a6592a83 Mon Sep 17 00:00:00 2001 From: Rob Gietema Date: Thu, 12 Sep 2024 09:59:09 +0200 Subject: [PATCH] Add hidden field. --- frontend/packages/volto-form-block/src/index.js | 2 ++ .../volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx | 3 +++ 2 files changed, 5 insertions(+) diff --git a/frontend/packages/volto-form-block/src/index.js b/frontend/packages/volto-form-block/src/index.js index b9fd846..5bcb7fd 100644 --- a/frontend/packages/volto-form-block/src/index.js +++ b/frontend/packages/volto-form-block/src/index.js @@ -69,7 +69,9 @@ const applyConfig = (config) => { 'label_datetime_field', 'File Upload', 'label_email', + 'hidden', ], + additionalFactory: [{ value: 'hidden', label: 'Hidden' }], defaultSender: 'noreply@plone.org', defaultSenderName: 'Plone', additionalFields: [], diff --git a/frontend/packages/volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx b/frontend/packages/volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx index f08c958..1a3f53c 100644 --- a/frontend/packages/volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx +++ b/frontend/packages/volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx @@ -22,6 +22,8 @@ class Edit extends Component { render() { const FormSchema = config.blocks.blocksConfig.schemaForm.blockSchema; const filterFactory = config.blocks.blocksConfig.schemaForm.filterFactory; + const additionalFactory = + config.blocks.blocksConfig.schemaForm.additionalFactory; const schema = FormSchema(this.props); const { data } = this.props; @@ -60,6 +62,7 @@ class Edit extends Component { widget: 'schema', default: defaultEmptyData, filterFactory, + additionalFactory, }, }, required: [],