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-6434] Show/hide file upload page on preprint submit workflow #2422

Conversation

futa-ikeda
Copy link
Contributor

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

Todo

  • Add some sort of acceptance test so you can keep these workflows correct

Purpose

  • Add logic to show/hide the file upload step on the preprint submission/edit workflow

Summary of Changes

  • Add a new flag displayFileUploadStep that controls whether or not the file upload step is shown
    • Should be shown for initial preprint submission
    • Should be shown for rejected preprint re-submission

Screenshot(s)

  • Create new preprint workflow showing the file upload step
    Screen Shot 2024-12-05 at 9 39 59 AM

  • Edit and resubmit workflow showing the file upload step
    Screen Shot 2024-12-05 at 9 26 05 AM

  • Editing an existing preprint no longer showing the file upload step
    Screen Shot 2024-12-05 at 9 42 56 AM

Side Effects

  • Editing an accepted preprint will now no longer show the option to upload a new file version

QA Notes

@futa-ikeda futa-ikeda marked this pull request as draft December 5, 2024 14:44
@futa-ikeda futa-ikeda marked this pull request as ready for review December 5, 2024 19:45
Comment on lines 71 to +76
this.isEditFlow = true;
if (this.args.preprint.reviewsState === ReviewsState.REJECTED) {
this.displayFileUploadStep = true;
} else {
this.displayFileUploadStep = false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When this component is invoked in the "Edit an existing preprint" workflow (this.args.preprint being truthy in line 68), this bit of logic will be triggered. If the preprint that is passed in has reviews_state: 'rejected', the File upload step will be shown, otherwise the File upload step will be skipped

Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

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

LGTM 🎆

In addition, appreciate the intuitive design of our preprint state machine.

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.

Hooray for tests!

@futa-ikeda futa-ikeda merged commit 47ea434 into CenterForOpenScience:feature/preprints-doi-versioning Dec 5, 2024
9 checks passed
@futa-ikeda futa-ikeda deleted the edit-preprint-workflow branch December 5, 2024 22:46
@futa-ikeda futa-ikeda added this to the 25.03.0 milestone Jan 22, 2025
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