Fix Edit Metadata to always pre-populate latest metadata - #1039
Fix Edit Metadata to always pre-populate latest metadata#1039youseihuayu-wonderful wants to merge 6 commits into
Conversation
Ignore the browsed version query param in EditDatasetMetadataFactory and fetch :latest instead, matching Edit Terms and JSF. Add component regression coverage and an issue playbook with verification steps. Co-authored-by: Cursor <cursoragent@cursor.com>
Document before/after fetch arguments, form outputs for the IQSS#1024 scenario, and the exact automated/manual checks that complete the fix. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep draft title/body on the branch for later publishing, and avoid unbound-method lint errors in the Factory regression spec. Co-authored-by: Cursor <cursoragent@cursor.com>
|
@ChengShi-1 @pdurbin |
pdurbin
left a comment
There was a problem hiding this comment.
The changes to EditDatasetMetadataFactory.tsx make sense to me but I didn't test them. I'm also not super familiar with the codebase so I'm clicking "comment" rather than "approve". I did leave a couple comments.
There was a problem hiding this comment.
Will this and the other files under "docs/issues" be removed before merging? 🤔
There was a problem hiding this comment.
Oh, now I see you wrote this:
"Optional docs under docs/issues/ are included for review context; happy to drop them from the PR if preferred."
In my opinion, they are a bit noisy but let's see what others think! 😅
| // Always load the latest version (draft if exists, otherwise latest published). | ||
| // Ignore the browsed `version` query param so Edit Metadata matches JSF / Edit Terms | ||
| // (IQSS/dataverse-frontend#1024). |
There was a problem hiding this comment.
Please copy this (or something similar) into CHANGELOG.md as well.
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@pdurbin Done — added under [Unreleased] → ### Fixed in CHANGELOG.md (same substance as this comment, phrased to match the changelog style). See the latest commit on this PR. |
| const persistentId = searchParams.get('persistentId') ?? undefined | ||
| const searchParamVersion = searchParams.get('version') ?? undefined | ||
| const version = searchParamVersionToDomainVersion(searchParamVersion) | ||
| // Always load the latest version (draft if exists, otherwise latest published). |
There was a problem hiding this comment.
Please remove comments here
| ).resolves(metadataBlocksInfoOnCreateMode) | ||
| }) | ||
|
|
||
| it('always fetches :latest when the URL carries an older published version (issue #1024)', () => { |
There was a problem hiding this comment.
Could you remove the issue number here (issue #1024) ?
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@chengshi — I removed the comments and the issue number from the test title. please take a look! |
|
Hi @youseihuayu-wonderful , thanks. Also, could you drop |
|
I clicked a wrong button to close it but i didn't mean it :( sorry for this |
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@ChengShi-1 Dropped docs/issues from the PR. |


Summary
:latest— draft if present, otherwise latest published), matching JSF andEditDatasetTermsFactory.EditDatasetMetadataFactoryused the browsedversionquery param (e.g.1.0). It now ignores that param and always fetchesDatasetNonNumericVersion.LATEST.getByPersistentId(..., ':latest', ...)and not"1.0".Test plan
npx cypress run --component --spec tests/component/sections/edit-dataset-metadata/EditDatasetMetadataFactory.spec.tsx→ 2 passing?version=1.0→ Edit Metadata → subtitle shows v2 value?version=1.0without editing still shows historical v1 metadataNotes
docs/issues/are included for review context; happy to drop them from the PR if preferred.