Skip to content

File: Use Case File Has Been Deleted#302

Merged
ofahimIQSS merged 6 commits intodevelopfrom
301-file-has-been-deleted-use-case
May 14, 2025
Merged

File: Use Case File Has Been Deleted#302
ofahimIQSS merged 6 commits intodevelopfrom
301-file-has-been-deleted-use-case

Conversation

@ChengShi-1
Copy link
Contributor

What this PR does / why we need it:

Create a new use case based on this API endpoint to know if a particular file that existed in a previous version of the dataset no longer exists in the latest version.
This is needed for the SPA to know when to allow the File edition in both file page or file in a datset page.

Which issue(s) this PR closes:

Related Dataverse PRs:

  • Depends on #

Special notes for your reviewer:

Suggestions on how to test this:

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

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue May 9, 2025 that may be closed by this pull request
@github-actions github-actions bot added FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) GREI Re-arch GREI re-architecture-related SPA.Q2 Not related to any specific Q2 feature labels May 9, 2025
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 labels May 9, 2025
@ChengShi-1 ChengShi-1 moved this to In Progress 💻 in IQSS Dataverse Project May 9, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review May 9, 2025 17:10
@ChengShi-1 ChengShi-1 moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project May 9, 2025
@g-saracca g-saracca moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project May 12, 2025
@g-saracca g-saracca self-assigned this May 12, 2025
Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

@ChengShi-1 just two minor comments, one above about a naming convention and could you please add also an integration test to check whether this use case / api endpoint returns true or false when a file has been replaced.
I believe it should return true also when a file has been replaced and we need that behaviour for the SPA.

await expect(sut.fileHasBeenDeleted(nonExistentFiledId)).rejects.toThrow(expectedError)
})

test('should return True when the dataset is published and the file has not been deleted', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

could we change the naming of this test, is a little bit confusing, you are testing both first that is not deleted and then that is indeed deleted.

Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

Looks great! thanks for applying the changes cheng 🙏🏼

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project May 14, 2025
@ofahimIQSS
Copy link
Contributor

nothing suspicious going on here - things look to be passing. Merged!

@ofahimIQSS ofahimIQSS merged commit 6966a11 into develop May 14, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Ready for QA ⏩ to Merged 🚀 in IQSS Dataverse Project May 14, 2025
@ofahimIQSS ofahimIQSS deleted the 301-file-has-been-deleted-use-case branch May 14, 2025 17:58
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA.Q2 Not related to any specific Q2 feature

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

File Has Been Deleted Use Case

3 participants