Shared Content: reusable blocks centers can place on their own pages
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- next.js, typescript
- Ambito
- backend, full-stack
Direzione di ricerca
Read ADR 022, docs/shared-content.md, docs/coding-guide.md, docs/revalidation.md, and ADR 005 first; also review src/utilities/clearLayoutRelationships.ts and the linked design issues #1152, #1344, and #1352. Resolve the listed design decisions before implementation, then follow the shared-content checklist and add the specified access and revalidation fan-out tests. Done means the acceptance criteria pass, including safe rendering for missing or unpublished references and preserved references when duplicating pages.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Part of #564 — Shared Content (Pages, Media, etc.). ADR 022 is the design; this is its second shared collection, after Shared Media.
What
A shared collection of reusable blocks, written by Shared Content Editors and readable by every center, plus a layout block that lets a center place one on its own Page or Home Page by reference. When an editor changes a reusable block, every center page using it updates.
We chose reusable blocks over whole shared pages. A center can take one section of shared content without taking the rest of the page, and a page built from reusable blocks already gives us what a shared page would.
This also covers page templates. Template pages on the template tenant (#1152 — Create a new template tenant) can be built from reusable blocks. "Duplicate Page For…" already keeps references to Shared Content when it copies a page (pointsOnlyAtSharedContent in src/utilities/clearLayoutRelationships.ts), so a new center's copied pages keep pointing at the shared sections and stay current.
First content: the national pages Andy listed in #564 (How to Use the Forecast, Avalanche Problems, Danger Scale, Basic Avalanche Safety, Seguridad de Avalanchas Básica, Grief and Loss).
Decisions to make before building
- What one document holds. Either a single layout block, or a small
blocksarray that forms a section. A section makes templates easier to build, because a template is then a few reusable blocks rather than many. - Which blocks are allowed inside. ADR 022 decision 4 says a shared document never contains a part one center owns. So blocks that point at tenant-scoped collections (Team, Sponsors, Document, Gallery, event and blog lists, forms, and center Media) can't be used inside a reusable block. Image slots must use the Shared library, so this depends on #1344 (Shared Content: offer the Shared library on ImageText, LinkPreview, ImageLinkGrid and other image slots) for any image block other than Media.
- Nesting. A reusable block inside a reusable block hits the known gap in
findDocumentsWithReferences: a referencing document with no tenant stops the revalidation walk (seedocs/revalidation.md). Either disallow nesting, or fix the gap first. - Layout only, or also inside rich text. A layout block covers pages. A Lexical variant would let one appear inside a Post, but it would be stored as JSON, where
ON DELETE set nulldoesn't reach (see #1249). - Drafts. Whether the collection has drafts, and that center pages render only the published version.
- A Center / Shared choice from day one. If centers get reusable blocks of their own (#1352 — Center reusable blocks: a center's own blocks, reusable across its pages), ADR 022 decision 5 puts both behind one block with a "Center library / Shared library" choice, as Media does. Settle this before building. Adding the choice later means a missing source value would have to mean shared for this block, the opposite of image slots, or else existing blocks need a backfill.
Acceptance criteria
- The collection follows every applicable step of
docs/shared-content.md: no tenant field,accessBySharedContent, the Shared Content admin group andadmin.hidden, a revalidation hook,SHARED_CONTENT_COLLECTIONS, seed data, Suggest an Edit, the reference count, and the "Where this is used" panel. - A layout block (named per
docs/coding-guide.md) references one document and is available on Pages and Home Pages, following ADR 005. - The block renders nothing, rather than crashing, when the referenced document is missing or unpublished.
- Publishing a change to a reusable block revalidates every center page that uses it.
- Duplicating a page that uses a reusable block to another center keeps the reference.
- Server tests cover access (the ADR 022 matrix), and a test proves the revalidation fan-out.
Out of scope
- Whole shared pages, and a "replace page with…" action.
- Center-specific sections inside a shared document (ADR 022 decision 4). A center adds its own content around the reusable block on its own page.
- Lingua principale
- TypeScript
- Stelle
- 6
- Fork
- 2
- Merge medio
- 1g 11h
- PR unite (30g)
- 35
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna 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 NWACus/web
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement needs-triage tenant:a3
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NWACus/web#1190 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug ready-for-agent
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NWACus/web#1154 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
Media browser returns "Not found" for repositories using the SHA-256 object formatForse già presa @adamchodera l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Follow-ups from #312Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
janhesters/remixcn#318 ·
I maintainer di solito rispondono entro 1 giorno
-
Interceptor LaunchTestProfile.sh: no Windows (Git Bash/MSYS) branch, test profile never launchesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
danielmiessler/LifeOS#3150 ·
I maintainer di solito rispondono entro 5 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·