Skip to content

Conversation

@ChengShi-1
Copy link
Contributor

@ChengShi-1 ChengShi-1 commented Apr 28, 2025

What this PR does / why we need it:

Which issue(s) this PR closes:

Special notes for your reviewer:

  • change the test cy.wrap(repository.deaccession).should('be.calledTwice') to cy.wrap(repository.deaccession).should('have.been.called') because the original test is flaky in git environment. with the error messageTimed out retrying after 4000ms: expected deaccession to have been called exactly twice, but it was called once
  • remove the version.length == 0, since the logic seems duplicated with isSomeVersionRelease

Suggestions on how to test this:

if the dataset version is draft or is deaccessioned, should not show Deaccession Dataset Bbutton
image
image

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

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

Additional documentation:

@ChengShi-1 ChengShi-1 linked an issue Apr 28, 2025 that may be closed by this pull request
@github-actions github-actions bot added bug Something isn't working FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) GREI Re-arch GREI re-architecture-related SPA.Q2 Not related to any specific Q2 feature SPA: Dataset page (View) labels Apr 28, 2025
@ChengShi-1 ChengShi-1 added Size: 3 A percentage of a sprint. 2.1 hours. Original size: 3 labels Apr 28, 2025
@coveralls
Copy link

coveralls commented Apr 28, 2025

Coverage Status

coverage: 97.383% (-0.4%) from 97.813%
when pulling c1e7293 on 666-dataset-page-deaccession-button-appears-incorrectly
into 4684edf on develop.

@ChengShi-1 ChengShi-1 moved this to Ready for Review ⏩ in IQSS Dataverse Project Apr 28, 2025
@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project Apr 29, 2025
@ekraffmiller ekraffmiller self-assigned this Apr 29, 2025
@ChengShi-1 ChengShi-1 marked this pull request as ready for review April 29, 2025 13:37
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! I just have a suggestion for simplifying the logic

@ekraffmiller
Copy link
Contributor

ekraffmiller commented Apr 29, 2025

Hi @ChengShi-1 , I'm sorry, I was testing this against JSF and I realized this issue doesn't describe the logic correctly!
The Deaccession Dataset button should be displayed if there is any 'released' (published) version of the Dataset, even if the current version of the Dataset being viewed is not released.
So the button should be displayed if there are any publishedVersions, which are defined in this line:

  const publishedVersions =
    dataset.versionsSummaries?.filter(
      (version) => version.publishedOn && version.summary !== 'versionDeaccessioned'
    ) || []

But this logic needs to updated with the Deaccession Reason PR is merged (#664), because the deaccession info will be an object. So maybe it's best to keep this waiting until that PR is merged.

Sorry for the confusion on this! Let me know if you have questions

@ChengShi-1
Copy link
Contributor Author

Hi @ChengShi-1 , I'm sorry, I was testing this against JSF and I realized this issue doesn't describe the logic correctly! The Deaccession Dataset button should be displayed if there is any 'released' (published) version of the Dataset, even if the current version of the Dataset being viewed is not released. So the button should be displayed if there are any publishedVersions, which are defined in this line:

  const publishedVersions =
    dataset.versionsSummaries?.filter(
      (version) => version.publishedOn && version.summary !== 'versionDeaccessioned'
    ) || []

But this logic needs to updated with the Deaccession Reason PR is merged (#664), because the deaccession info will be an object. So maybe it's best to keep this waiting until that PR is merged.

Sorry for the confusion on this! Let me know if you have questions

Hi Ellen, Thanks for review! Could you please check #669 ? It solved this issue here I think. I didn't notice this before, it was my bad.

@ekraffmiller
Copy link
Contributor

Hi @ChengShi-1 , I'm sorry, I was testing this against JSF and I realized this issue doesn't describe the logic correctly! The Deaccession Dataset button should be displayed if there is any 'released' (published) version of the Dataset, even if the current version of the Dataset being viewed is not released. So the button should be displayed if there are any publishedVersions, which are defined in this line:

  const publishedVersions =
    dataset.versionsSummaries?.filter(
      (version) => version.publishedOn && version.summary !== 'versionDeaccessioned'
    ) || []

But this logic needs to updated with the Deaccession Reason PR is merged (#664), because the deaccession info will be an object. So maybe it's best to keep this waiting until that PR is merged.
Sorry for the confusion on this! Let me know if you have questions

Hi Ellen, Thanks for review! Could you please check #669 ? It solved this issue here I think. I didn't notice this before, it was my bad.

Ok, great! I will review that, and then we can probably close this. Thanks :)

@ekraffmiller
Copy link
Contributor

This issue was resolved in #669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Dataset page (View) SPA.Q2 Not related to any specific Q2 feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dataset Page: Deaccession Button appears incorrectly

4 participants