Skip to content

Show Export Metadata for the latest published dataset version and Draft version#1013

Merged
pdurbin merged 16 commits into
developfrom
1008-the-export-metadata-button-is-misleading-when-viewing-an-older-version-of-a-dataset-because-it-gives-you-the-latest-published-version
Jul 20, 2026
Merged

Show Export Metadata for the latest published dataset version and Draft version#1013
pdurbin merged 16 commits into
developfrom
1008-the-export-metadata-button-is-misleading-when-viewing-an-older-version-of-a-dataset-because-it-gives-you-the-latest-published-version

Conversation

@ChengShi-1

@ChengShi-1 ChengShi-1 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

  • Export Metadata use case
  • Show "Export Metadata" button, only for the latest released dataset version
  • also show "Export Metadata" button when it's draft version for dataset admin

Which issue(s) this PR closes:

Special notes for your reviewer:

  • Added Export Metadata use case from js-dataverse newest package. Previously, we fetch the results directly in front end repo, so I removed it and now we are fetching through the use case layer.
  • Removed datasetIsReleased, datasetIsDeaccessioned param from ExportMetadataDropdown component, using useExportMetadata instead to handle showing/hiding the "Export Metadata" button
  • For deaccessioned version, we are hiding the button as well, and we'd like to show it in last non-deaccessioned version like the api bahaved

Suggestions on how to test this:

  • create a dataset and upload file
  • update some metadata and publish so there are multiple versions of this dataset
  • check in file version, the "Export Metadata" button on dataset pages and file pages, only show for the latest released dataset version, and hide for other versions
  • Also, for a draft version, as a member of the collection having permission to view the draft, the button should show and return draft version metadata

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

image

Is there a release notes or changelog update needed for this change?:

yes

Additional documentation:

@coveralls

coveralls commented Jul 7, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 97.861% (+0.4%) from 97.414% — 1008-the-export-metadata-button-is-misleading-when-viewing-an-older-version-of-a-dataset-because-it-gives-you-the-latest-published-version into develop

Comment thread CHANGELOG.md Outdated
@ChengShi-1 ChengShi-1 self-assigned this Jul 9, 2026
@ChengShi-1 ChengShi-1 added Size: 10 A percentage of a sprint. 7 hours. Original size: 10 labels Jul 9, 2026
@ChengShi-1
ChengShi-1 marked this pull request as ready for review July 13, 2026 17:54
@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Jul 13, 2026
@ChengShi-1 ChengShi-1 removed their assignment Jul 13, 2026
@ChengShi-1 ChengShi-1 linked an issue Jul 13, 2026 that may be closed by this pull request
@cmbz cmbz added FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) labels Jul 15, 2026
@pdurbin pdurbin self-assigned this Jul 16, 2026
@pdurbin pdurbin moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Jul 16, 2026
@ChengShi-1 ChengShi-1 changed the title Show Export Metadata only for the latest released dataset version Show Export Metadata for the latest released dataset version and Draft version Jul 16, 2026
This reverts commit 27ecb48, reversing
changes made to 089202e.
@ChengShi-1 ChengShi-1 self-assigned this Jul 16, 2026
@ChengShi-1

Copy link
Copy Markdown
Contributor Author

Hi @pdurbin !The dev branch changed significantly after our latest merged PR: #1000. I need to resolve some merge conflicts, so I’ve removed you as a reviewer. I’ll fix them soon and reassign you once everything is ready. Thanks for your patience!

@ChengShi-1

Copy link
Copy Markdown
Contributor Author

Hi @pdurbin !The dev branch changed significantly after our latest merged PR: #1000. I need to resolve some merge conflicts, so I’ve removed you as a reviewer. I’ll fix them soon and reassign you once everything is ready. Thanks for your patience!

It's ok to review again, I just re-assign :)

<ExportMetadataDropdown
datasetPersistentId={datasetPersistentId}
datasetVersion={datasetVersion}
canUpdateDataset={permissions.canEditOwnerDataset}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope this is the right place to put this comment but @ChengShi-1 and I just discussed how the Member role (which is what Preview URLs use) should be enough to export the various metadata formats.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this@pdurbin , I just finish the fix

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is working great now. Thanks! Here's a screenshot:

Screenshot 2026-07-16 at 3 51 44 PM

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChengShi-1 oh, above can you please update "Also, for a draft version, as a dataset owner, the button should show and return draft version metadata"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, just updated!

Comment thread CHANGELOG.md Outdated
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
@ChengShi-1 ChengShi-1 changed the title Show Export Metadata for the latest released dataset version and Draft version Show Export Metadata for the latest published dataset version and Draft version Jul 16, 2026

@pdurbin pdurbin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good. Tests are passing. I tested the functionality. I'm happy to merge this myself, if that's agreeable to everyone.

@github-project-automation github-project-automation Bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Jul 17, 2026
@pdurbin pdurbin moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Jul 17, 2026
@pdurbin
pdurbin merged commit 6678464 into develop Jul 20, 2026
10 of 14 checks passed
@github-project-automation github-project-automation Bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Jul 20, 2026
@pdurbin pdurbin removed their assignment Jul 20, 2026
@pdurbin pdurbin moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) GREI Re-arch GREI re-architecture-related Original size: 10 Size: 10 A percentage of a sprint. 7 hours. SPA

Projects

Status: Done 🧹

4 participants