Skip to content

Conversation

@ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Oct 14, 2025

What this PR does / why we need it:

Inspired from Edit terms page, related to 2025 Q3 features.

Adds an api to allow the user to update the terms of access for restricted files of a given dataset

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

(included them in usecases.md)

  • If the dataset is already published, this action creates a DRAFT version containing the new terms.
  • Unspecified fields are treated as omissions: sending only fileAccessRequest will update that field and leave all other terms absent (undefined). In practice, the new values you send fully replace the previous set of terms — so if you omit a field, you are effectively clearing it unless you include its original value in the new input.

Suggestions on how to test this:

  1. check github actions, they should be all checked. it has to wait for backend pr
  2. make sure changelog is updated

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

yes

@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 SPA.Q3.2025.3 Dataset Page: Edit Terms FY26 Sprint 8 FY26 Sprint 8 (2025-10-08 - 2025-10-22) labels Oct 14, 2025
@github-actions github-actions bot added GREI Re-arch GREI re-architecture-related SPA: Edit Dataset Page labels Oct 14, 2025
@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Oct 14, 2025
@cmbz cmbz added the FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) label Oct 23, 2025
@ekraffmiller ekraffmiller self-assigned this Oct 23, 2025
@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Oct 23, 2025
@ekraffmiller ekraffmiller requested a review from Copilot October 23, 2025 18:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to update the terms of access for restricted files in a dataset, enabling users to modify fields such as fileAccessRequest, termsOfAccessForRestrictedFiles, and other access-related properties.

Key changes:

  • Implemented UpdateTermsOfAccess use case with supporting repository methods and transformers
  • Added comprehensive test coverage (unit, integration, and functional tests)
  • Updated documentation with usage examples and important notes about behavior with published datasets

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/datasets/domain/useCases/UpdateTermsOfAccess.ts New use case implementing the update terms of access functionality
src/datasets/domain/repositories/IDatasetsRepository.ts Added interface method for updateTermsOfAccess
src/datasets/infra/repositories/DatasetsRepository.ts Implemented repository method with API endpoint integration
src/datasets/infra/repositories/transformers/termsOfAccessTransformers.ts New transformer to convert TermsOfAccess model to API payload format
src/datasets/domain/models/Dataset.ts Added blank line for formatting
src/datasets/index.ts Exported new updateTermsOfAccess use case
test/unit/datasets/UpdateTermsOfAccess.test.ts Unit tests for the use case
test/integration/datasets/DatasetsRepository.test.ts Integration tests covering various scenarios including published datasets
test/functional/datasets/UpdateTermsOfAccess.test.ts Functional tests validating end-to-end behavior
docs/useCases.md Added documentation with usage examples and behavioral notes
src/datasets/domain/useCases/SetAvailableLicensesForDatasetType.ts Added JSDoc parameters documentation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Hi @ChengShi-1 it looks good, I just have a question about the TermsOfAccessInputType


type TermsOfAccessInput = TermsOfAccess & { termsOfAccess?: string }

export const transformTermsOfAccessToUpdatePayload = (terms: TermsOfAccessInput) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this method need TermsOfAccessInput type, since it is only passed a TermsOfAccess type? Is it meant to be called somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. It is not used somewhere else, so I remove it.

Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

looks good, approved

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project Oct 24, 2025
@ekraffmiller ekraffmiller removed their assignment Oct 24, 2025
@ofahimIQSS
Copy link
Contributor

test integration failing

@ChengShi-1
Copy link
Contributor Author

@ofahimIQSS

test integration failing

test fixed.

@ChengShi-1
Copy link
Contributor Author

@ekraffmiller Could you help to merge this? Thanks!

@cmbz cmbz added the FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) label Nov 5, 2025
@ChengShi-1 ChengShi-1 merged commit a937365 into develop Nov 7, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project Nov 7, 2025
@ekraffmiller
Copy link
Contributor

@ChengShi-1 I'm sorry I didn't see your message! Thanks for doing the merge 👍

@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Nov 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 8 FY26 Sprint 8 (2025-10-08 - 2025-10-22) FY26 Sprint 9 FY26 Sprint 9 (2025-10-22 - 2025-11-05) FY26 Sprint 10 FY26 Sprint 10 (2025-11-05 - 2025-11-19) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Edit Dataset Page SPA.Q3.2025.3 Dataset Page: Edit Terms

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Set Dataset Terms of Access

5 participants