Fix Edit Metadata to always pre-populate latest metadata - #1039
Fix Edit Metadata to always pre-populate latest metadata#1039youseihuayu-wonderful wants to merge 9 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. |
|
@youseihuayu-wonderful can you please rebase or merge the latest from the "develop" branch to see if the failing Chromatic checks are skipped? This is the change we made to skip them for forks: |
@pdurbin Done — I merged the latest develop, and both Chromatic jobs are now skipped. The other CI checks didn’t rerun. Should I close and reopen the PR to trigger them? |
Huh. Thanks for noticing that! They were skipped on this PR of your as well: For reference, there should be checks called "test" etc. like this:
I took that screenshot from #1050 where you haven't yet pulled in my "skip Chromatic checks for forks" PR (#1043). I hope that PR of mine isn't causing the other checks to be skipped! |
|
@youseihuayu-wonderful can you please rebase or merge develop into your branch. This is to pick up the following PR which @ChengShi-1 and I hope will allow the checks to run on forks: |
…data-latest-version
@pdurbin I fix — and the #1055 triggered the fork checks successfully. All relevant checks passed, including Edit Dataset Metadata E2E (4/4). The overall E2E failure is the S3 issue tracked in #1053. |



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.