The content form shows a Layout tab with the raw blocks and blocks_layout fields
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia da packages/cmsui/components/ContentForm/ContentForm.tsx e dalla gestione dello schema in routes/add.tsx, routes/edit.tsx e routes/translate.tsx; confronta l’helper Volto esistente menzionato nell’issue. Aggiungi un test unitario per un fieldset Layout che diventa vuoto e uno per un fieldset che conserva altri campi. Il lavoro è completato quando il modulo dei contenuti nasconde blocks e blocks_layout e omette una scheda Layout vuota in tutte e tre le viste.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- JavaScript
- Stelle
- 13
- Fork
- 10
- Merge medio
- 2g 14h
- PR unite (30g)
- 82
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di plone/aurora
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 63/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug 30 needs: triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug 99 tag: UX Accessibility
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug 30 needs: triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
01 type: bug 02 type: regression 30 needs: triage 99 tag: UX Accessibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di plone/aurora
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
[Docs] CONTRIBUTING.md links to retired GitHub Learning Lab and Try Git sitesForse già presa @adityamukesh l’ha presa oggi. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
reillywalter/win-dev-doctor#92 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature] 新增「查看完整听歌设备记录」接口Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100