Skip to content

Commit b6a8e48

Browse files
committed
Render title and description.
1 parent 56eae8a commit b6a8e48

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

frontend/packages/volto-form-block/src/schemaFormBlock/EditSchemaForm.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ class Edit extends Component {
4343

4444
return (
4545
<>
46+
{data.title && <h2>{data.title}</h2>}
47+
{data.description && (
48+
<p className="documentDescription">{data.description}</p>
49+
)}
4650
<Form
4751
schema={{
4852
fieldsets: [

frontend/packages/volto-form-block/src/schemaFormBlock/ViewSchemaForm.jsx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,21 @@ const FormBlockView = ({ data, id, properties, metadata, path }) => {
7171
};
7272

7373
return (
74-
<Form
75-
schema={data.schema}
76-
formData={initialData}
77-
onSubmit={onSubmit}
78-
resetOnCancel={true}
79-
onCancel={data.show_cancel ? onCancel : null}
80-
submitLabel={data.submit_label || intl.formatMessage(messages.submit)}
81-
cancelLabel={data.cancel_label || intl.formatMessage(messages.cancel)}
82-
/>
74+
<>
75+
{data.title && <h2>{data.title}</h2>}
76+
{data.description && (
77+
<p className="documentDescription">{data.description}</p>
78+
)}
79+
<Form
80+
schema={data.schema}
81+
formData={initialData}
82+
onSubmit={onSubmit}
83+
resetOnCancel={true}
84+
onCancel={data.show_cancel ? onCancel : null}
85+
submitLabel={data.submit_label || intl.formatMessage(messages.submit)}
86+
cancelLabel={data.cancel_label || intl.formatMessage(messages.cancel)}
87+
/>
88+
</>
8389
);
8490
};
8591

0 commit comments

Comments
 (0)