Files
co-lite/openspec/changes/add-page-drafts-and-templates/tasks.md
T

24 lines
1.8 KiB
Markdown

# Tasks: add-page-drafts-and-templates
Design: `design.md` and `docs/superpowers/specs/2026-12-03-page-builder-design.md` (change 2). Every task is TDD. Work is serial in the main session, with a self-review per task.
## 1. Data and services
- [x] 1.1 SQL: `sql/01-page-draft.sql`, `sql/99-rollback.sql`; mirror 01 into `local/seed/`; apply locally.
- [x] 1.2 services-counter: `draft` on the entity and DTO, `hasDraft` on list rows; save rules for published pages; publish (re-validate, slug check) and discard endpoints; `findPublished` unchanged.
- Verify: `mvn -T 1C -B -pl solvway-services-counter -am verify`
- [x] 1.3 mobile-api: `POST /api/admin/pages/{id}/publish` and `/discard`, scoped, refusals relayed like save.
- Verify: `mvn -T 1C -B -pl solvway-mobile-api -am verify`
## 2. Portal
- [x] 2.1 BFF routes for publish and discard; services; the editor loads the draft, the published-page banner with Publish changes and Discard changes (confirm); preview shows the draft; list badge.
- [x] 2.2 Templates (`pageTemplates.ts`, with a rules test) and the start picker on New page; Duplicate in the list and editor.
- [x] 2.3 Labels in `defaultMessages.ts` and `zh_CN.seed.json`, `npm run i18n:sql`, `sql/02-draft-template-labels.sql`; rollback lines.
- Verify (2.1 to 2.3): `cd solvway-admin-portal && npx vitest run; echo VITEST=$? && npx tsc --noEmit && npm run lint`
## 3. Release
- [x] 3.1 `docs/deployment.md`: SQL rows (01 before services-counter starts), the draft behaviour for staff.
- [x] 3.2 Live check (Playwright), on disposable pages: edit a published page and save (the visitor still sees the old version, preview shows the new); Publish changes; Discard changes; New page from each template (refused without an event, then saved); Duplicate; 1280 and 360 px.