The content form shows a Layout tab with the raw blocks and blocks_layout fields
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- react, typescript
- Domain
- frontend
Research direction
Start with packages/cmsui/components/ContentForm/ContentForm.tsx and the schema handling in routes/add.tsx, routes/edit.tsx, and routes/translate.tsx; compare the existing Volto helper mentioned in the issue. Add a unit test for a layout fieldset that becomes empty and one that retains other fields. Done means the content form hides blocks and blocks_layout and omits an empty Layout tab across all three views.
Written by the indexing model from the issue text.
Description
Problem
The content form in the CMS UI (the Content tab of the add, edit and translate views) shows a Layout tab. It holds the blocks and blocks_layout fields, which are raw JSON fields that editors must not edit by hand. Aurora edits the page body in the Blocks tab, so this tab shouldn't be there.
The tab comes from the content type schema. GET @types/Document returns:
{ "id": "layout", "title": "Layout", "fields": ["blocks", "blocks_layout"] }
with blocks and blocks_layout as json widgets. ContentForm (packages/cmsui/components/ContentForm/ContentForm.tsx) gets the schema from @types unchanged in routes/add.tsx, routes/edit.tsx and routes/translate.tsx, and SchemaFieldsets renders every fieldset that has fields, so the Layout tab appears.
Steps to reproduce
- Log in and edit a page.
- Open the Content tab.
- A Layout tab is listed next to the other fieldsets, with the Blocks and Blocks Layout fields.
How Volto handles it
Volto's Form removes these fields before rendering, in removeBlocksLayoutFields (packages/volto/src/components/manage/Form/Form.jsx): it filters blocks and blocks_layout out of the layout fieldset and drops the fieldset when it ends up empty.
Aurora has no equivalent. The only place that skips these fields today is the source panel of routes/translate.tsx, which leaves out blocks, blocks_layout and changeNote when it lists the source values, but its form still shows the tab.
Expected
The content form doesn't show blocks or blocks_layout, and doesn't show the Layout tab when those were its only fields. If a behavior adds other fields to the layout fieldset, the tab stays with those fields.
Possible direction
Port removeBlocksLayoutFields as a schema helper (in @plone/helpers or @plone/cmsui) and apply it once where the form gets its schema, so the add, edit and translate views all use it, with a unit test for both cases (a fieldset that becomes empty, and one that keeps other fields).
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 10
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 82
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from plone/aurora
-
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
01 type: bug 99 tag: UX Accessibility
Difficulty 1/5 Under an hour Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
01 type: bug 30 needs: triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
01 type: bug 02 type: regression 30 needs: triage 99 tag: UX Accessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quasarframework/quasar#18614 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 65/100
microsoft/monaco-editor#5626 ·
Maintainers usually reply within 1 day
-
bug/1-unconfirmed kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 86/100
521xueweihan/HelloGitHub#4714 ·