Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENG-6459][ENG-6637][ENG-6638] Add Create new preprint version button #2423

Conversation

futa-ikeda
Copy link
Contributor

@futa-ikeda futa-ikeda commented Dec 6, 2024

Todo

  • Add Withdrawn preprint detail test

Purpose

  • Add a new "Create new version" button to the preprint detail page

Summary of Changes

  • Add a new canCreateNewVersion attr to preprint model
    • Only admins can create a new version
    • Only preprints that is the latest version can create a new version
    • Only preprints that are were published at some point (whether they are withdrawn or not, doesn't matter)
  • Update tombstone page for preprint versions

Screenshot(s)

  • Accepted
    image

  • Rejected (for pre-moderation providers)
    image

  • Withdrawn
    image

Side Effects

QA Notes

Copy link
Contributor

@brianjgeiger brianjgeiger left a comment

Choose a reason for hiding this comment

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

A lot of TODOs in those tests, but I presume they'll come with later tickets.

@brianjgeiger
Copy link
Contributor

Well those aren't helpful test failure messages

153) [Chrome 131.0] Exam Partition 3 - Acceptance | preprints | detail: Accepted preprint detail page
     global failure: Error

     http://localhost:7357/assets/vendor-bd608453ad69303c53031e33554ea087.js:263465

155) [Chrome 131.0] Exam Partition 3 - Acceptance | preprints | detail: Pre-mod: Rejected preprint detail page
     global failure: Error

     http://localhost:7357/assets/vendor-bd608453ad69303c53031e33554ea087.js:263465

Comment on lines 46 to 47
ReviewsState.WITHDRAWAL_REJECTED,
ReviewsState.PENDING_WITHDRAWAL,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, I didn't know withdrawal can have pending and rejected states. I need to check BE to see if we are handling this properly.

Copy link
Collaborator

@cslzchen cslzchen Dec 6, 2024

Choose a reason for hiding this comment

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

@futa-ikeda for pre-moderation, "accepted" is correct but for post moderation, it should be "pending" or " accepted". I am not 100% sure how frontend maps backend wording.

See: https://openscience.atlassian.net/browse/ENG-6467. I think FE can probably just use the is_lateset_version without caring about the review state?

Copy link
Contributor Author

@futa-ikeda futa-ikeda Dec 6, 2024

Choose a reason for hiding this comment

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

Hmmm, interesting... I see what you are saying about some of the reviews_states for pre-mod vs. post-mod lining up to be the same state (ie: for pre-mod, "reviews_state": "pending" => "is_published": false, but for post-moderation, either "reviews_state": "pending" or "accepted" => "is_published": true). I'm not sure if we can fully ignore the reviews_state flag here though, as we shouldn't be allowing a new version for "pre-moderation and rejected" and "pre-moderation and pending moderator approval", right?

Copy link
Collaborator

@cslzchen cslzchen Dec 6, 2024

Choose a reason for hiding this comment

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

Yep, as discussed, let's rely on date_published instead of is_published. There will be a BE fix to make sure is_latest_version checks date_published instead of is_published.

@futa-ikeda
Copy link
Contributor Author

Well those aren't helpful test failure messages

153) [Chrome 131.0] Exam Partition 3 - Acceptance | preprints | detail: Accepted preprint detail page
     global failure: Error

     http://localhost:7357/assets/vendor-bd608453ad69303c53031e33554ea087.js:263465

155) [Chrome 131.0] Exam Partition 3 - Acceptance | preprints | detail: Pre-mod: Rejected preprint detail page
     global failure: Error

     http://localhost:7357/assets/vendor-bd608453ad69303c53031e33554ea087.js:263465

Turns out it was the citations mirage endpoint failing!

@futa-ikeda futa-ikeda merged commit 5515ddc into CenterForOpenScience:feature/preprints-doi-versioning Dec 9, 2024
9 checks passed
@futa-ikeda futa-ikeda deleted the new-version-button branch December 9, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants