Skip to content

Save publication contributors as users, not names - #568

Merged
Abhishekfm merged 2 commits into
devfrom
fix/publication-contributors
Nov 27, 2026
Merged

Abhishekfm merged 2 commits into
devfrom
fix/publication-contributors

Conversation

@anantjain341

@anantjain341 anantjain341 commented Nov 26, 2026 •

Copy link
Copy Markdown

Depends on CivicDataLab/DataSpaceBackend#333. Merge only after that is live on dev: this PR uses the new contributors field and contributorIds input, so codegen and the build fail against a backend without them.

Fixes #560. The wizard picked real users but saved only their display names in authors. On reload it rebuilt fake ids from those names (author-${index}-${name}), so the duplicate check never matched and the same person could be added twice.

Changes

  • Wizard (publications/queries.ts, model.ts, components/DetailsStep.tsx):
    • Saving sends contributorIds (the ids from searchUsers) instead of authors.
    • The editor query asks for contributors { id fullName username profilePicture { url } }, so a reloaded contributor keeps their real id, name, username and picture, and adding them again is ignored.
  • Review step, wizard progress, preview (ReviewStep.tsx, WizardShell.tsx, preview/[id]/page.tsx): the "at least one contributor" check and the names shown use contributors.
  • Public publication page (queries.ts, page.tsx, publication-detail.ts): asks for contributors { id fullName }. New helper publicationContributorNames gives each name once; the cover, information panel (their prop is now contributorNames), SEO data and citation all use it.

Behaviour

  • authors is no longer read or sent anywhere. When contributor ids are saved, the backend clears the old names on that publication.
  • Older publications: the backend migration links saved names to users. A name that matched no user is not shown. Prod has no published publications, so this only affects drafts and dev data.
  • Contributors have no saved order, so their order on the page is not fixed.

The wizard picked real users but saved only their display names in
`authors`. On reload it rebuilt fake ids from those names, so the
duplicate check never matched and the same person could be added twice
(#560).

The wizard now sends `contributorIds` and loads `contributors` with
their real ids, so a reloaded contributor is recognised. The review
step, wizard progress, preview and public page (cover, information,
SEO data and citation) read the contributors' names instead of
`authors`.
…ames

The list now comes from contributors and the page labels it
"Contributors", so the old `authors` name was misleading. The
schema.org `author` field and the citation keep the word author.
@Abhishekfm
Abhishekfm merged commit 21fd296 into dev Nov 27, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
development — bd0d3dbe Deployed Nov 27, 2026 by anantjain341 via build (24.x) #942
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.

2 participants