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-6460] [ENG-6640] Add new preprint version workflow #2427

Conversation

futa-ikeda
Copy link
Contributor

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

Todo

  • fix and add tests
  • helpful and translated toast messages on transitions and errors

Purpose

  • Add a new workflow to create a new preprint version

Summary of Changes

  • Add a new preprint.new-version route
  • Add a new newVersion argument to the submission-flow component
    • Invoke submission-flow component in the new-version route

Screenshot(s)

image

Side Effects

QA Notes

@futa-ikeda futa-ikeda marked this pull request as draft December 10, 2024 23:20
@futa-ikeda futa-ikeda changed the title [WIP] [ENG-6460] [ENG-6640] Add new preprint version workflow [ENG-6460] [ENG-6640] Add new preprint version workflow Dec 18, 2024
@futa-ikeda futa-ikeda marked this pull request as ready for review December 18, 2024 15:35
Comment on lines 76 to 77
// Create ephemeral preprint to prevent the original preprint from being overwritten
// Also stores primary file for new version
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting

Comment on lines 235 to 240
public async onSubmit(): Promise<void> {
this.args.resetPageDirty();

if (this.isNewVersionFlow) {
try {
const url = this.preprint.links.preprint_versions as string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see this is a POST to create a new version. Just want to double check that this onSubmit is for when user clicks the create-new-version button instead of when user clicks the submit button.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, maybe it's not ... here is my expected behavior:

  • Click the create button makes the POST request to create the new version. BE returns the newly created version and FE switch to the version creation flow.
  • Once we get into the flow, it works the same way as new submission. This means the Submit button should behave the same way as if we were creating a preprint object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed this workflow so that the new version is created before going in to this workflow, as you had previously said. I implemented this workflow incorrectly, so sorry for the confusion!

@@ -680,13 +771,14 @@ export default class PreprintStateMachine extends Component<StateMachineArgs>{
@task
@waitFor
public async addProjectFile(file: FileModel): Promise<void>{
await file.copy(this.preprint, '/', 'osfstorage', {
const target = (this.isNewVersionFlow ? this.tempVersion : this.preprint) as PreprintModel;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Related to my last comment, once your are in the flow, we should already have the new version and we should only have the new version.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have updated the workflow and I've made it so that the new version is created before moving into this page!

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.

Looks good and verified locally.

The only minor issue is the DOI dropdown is missing version number.

Screenshot 2024-12-26 at 10 14 33

But I see this has been fixed in your next PR: #2436, so all good.

And a heads-up in case you run into them too, Here are a few BE bugs I found:

  • My preprints page show all versions ... legacy page ... not using API v2 ...
  • Submission failed when trying to edit the new version (something related to review_state of the new version)
  • I feel the app is noticeable slower than usual when doing versions ... some performance issue we need to look into

@cslzchen
Copy link
Collaborator

Updated, tested the 409 feature too, looks good.

Also a heads-up, there is an issue for the BE where new version creation is allowed when there is an existing version in progress (not submitted yet). Out of the scope of this PR.

@futa-ikeda futa-ikeda merged commit 701f265 into CenterForOpenScience:feature/preprints-doi-versioning Dec 26, 2024
9 checks passed
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