Skip to content

feat(publications): Resources frontend — detail, listing, authoring, linking#420

Open
Deepthi-Chand wants to merge 2 commits into
devfrom
feature/resources
Open

feat(publications): Resources frontend — detail, listing, authoring, linking#420
Deepthi-Chand wants to merge 2 commits into
devfrom
feature/resources

Conversation

@Deepthi-Chand

Copy link
Copy Markdown
Contributor

Resources (internal name Publication) — frontend

The UI for the new Resource entity. Users only see "Resource" (single source: lib/constants/resourceLabel.ts); the code and API use Publication.

Backend PR: CivicDataLab/DataSpaceBackend#104 — merge/deploy first (this depends on its GraphQL schema).

What's included

Read side

  • Detail page /(user)/publications/[id] — inline PDF + YouTube, download cards for other file types, empty-state for zero-block resources.
  • Explore listing /publications (reuses ListingComponent type="publication") + a "Resources" entry in the Explore nav.
  • Unified search: publication type + detail redirect.

Authoring (dashboard)

  • Resources list + Create; create/edit shell (Metadata / Content / Publish tabs); a shared typed metadata form (title, abstract, authors, date, license, Resource Type, sectors, geographies, external link — a normal form, not the datasets' dynamic-metadata renderer); block editor (YouTube input + file dropzone, reorder, remove); publish toggle + owner-only "linked to N" flag. Resources entry added to the dashboard sidebar.

Linking

  • PublicationLinkPicker embedded in the Use Case & Collaborative assign pages (published resources only).

Infra

  • config/codegen.ts documents glob widened to include components/** so shared components' graphql() docs are typed.

Test plan

  • npm run generate (codegen) succeeds against the branch's schema.
  • npx tsc --noEmitzero new errors over the repo's pre-existing baseline.
  • npm run lint — clean on all new/touched files.
  • Layer 6 browser flows + visual checklist — written into app/[locale]/(user)/publications/architecture.md, run on request (create end-to-end, block editor, edit round-trip, inline PDF/YouTube, Explore filters, unified-search result, UC/Collab link picker, "Resource" label spot-check).

Reviewer notes

  • opub-ui Button variants are success|basic|interactive|critical (no primary/secondary); its Combobox multi-select types say string but pass/return value-arrays at runtime — PublicationForm casts at that single boundary rather than typing the component any.
  • Generated gql/generated/{graphql,gql}.ts are gitignored (regenerated at build) — run npm install + npm run generate in a clean checkout.

Docs: app/[locale]/(user)/publications/architecture.md (FE slice, links the backend doc).

🤖 Generated with Claude Code

…ring, linking)

Read side:
- (user)/publications/[id]: detail page with inline PDF + YouTube and download
  cards for other file types; Explore listing at /publications; 'Resources'
  entry in the Explore nav.
- Unified search: publication type + detail redirect.

Authoring (dashboard):
- publications list + Create; create/edit shell (Metadata / Content / Publish
  tabs) with a shared typed metadata form (title, abstract, authors, date,
  license, Resource Type, sectors, geographies, external link — a normal form,
  not the dynamic-metadata renderer); block editor (YouTube + file dropzone,
  reorder, remove); publish toggle + 'linked to N' flag.
- Resources sidebar entry on the dashboard.

Linking:
- PublicationLinkPicker embedded in the Use Case & Collaborative assign pages
  (published resources only).

Infra: single RESOURCE_LABEL constant (UI says 'Resource', code says
publication); codegen documents glob widened to include components/. Verified:
codegen + tsc (zero new errors) + eslint clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant