feat(website): display version comment on review cards for revocations#6395
feat(website): display version comment on review cards for revocations#6395theosanderson-agent wants to merge 1 commit into
Conversation
When submitting a revocation the submitter can supply a version comment (the reason for revocation), but the review page had no way to see it before approving the entry. The card showed only a generic "This is a revocation entry..." message, which made it impossible to double-check the comment before releasing. Surface the version comment alongside the revocation marker on the review card. To make the data available without an extra fetch (the existing `/get-data-to-edit` endpoint explicitly errors for revocations and is not appropriate to repurpose for read-only display), expose the comment on the list response: - Add `versionComment: String?` to `SequenceEntryStatus`. - In `getSequences`, extract the value from `unprocessed_data.metadata.versionComment` using a JSONB scalar path. - Update the website's zod schema and render a `Version comment` KeyValueComponent on the review card for revocations with a comment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Details> The existing /get-data-to-edit endpoint (used by useGetMetadataAndAnnotations to populate the review card's metadata) explicitly errors for revocations, so it was not appropriate to repurpose. Returning the comment on the list response means no extra HTTP round-trip per card.@theosanderson-agent Try making an alternative PR which: renames this endpoint to /get-original-data-for-entry and makes it not error for revocations and uses that instead |
|
Opened #6412 as the alternative you suggested: Happy to close this PR in favour of #6412 if that approach looks right. |
Summary
Fixes #6394 (and addresses #4522).
Previously, when reviewing a revocation entry on the review page, there was no way to see the version comment the submitter entered when creating the revocation. The card only showed a generic message: "This is a revocation entry, which will create a new version that revokes this accession". This made it impossible to double-check the revocation reason before approving the entry.
This PR surfaces the version comment alongside the existing revocation marker on the review card.
Changes
Backend
versionComment: String?toSequenceEntryStatus(SubmissionTypes.kt).getSequences(SubmissionDatabaseService.kt), extract the value fromunprocessed_data.metadata.versionCommentusing a JSONB scalar path. After the V1.27 migration the comment lives there for revocations.Website
versionCommentto thesequenceEntryStatuszod schema.Version commentKeyValueComponenton the review card whenever the entry is a revocation and a comment was provided.Design notes
/get-data-to-editendpoint (used byuseGetMetadataAndAnnotationsto populate the review card's metadata) explicitly errors for revocations, so it was not appropriate to repurpose. Returning the comment on the list response means no extra HTTP round-trip per card.versionCommentis already part of the processed metadata and rendered via the existingMetadataList. The new card field is gated onisRevocationto avoid showing it twice.Test plan
versionCommentvia the normal metadata list (unchanged behavior).CI=1 npm run test(website) — 646 tests passing including newshould show the version comment for revocation entriescase.CI=1 npm run check-types(website) — clean.npm run format(website) — clean../gradlew compileKotlin && ./gradlew ktlintFormat(backend) — clean.🤖 Generated with Claude Code
🚀 Preview: Add
previewlabel to enable