-
Notifications
You must be signed in to change notification settings - Fork 56
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
[ENG-6460] [ENG-6640] Add new preprint version workflow #2427
Conversation
// Create ephemeral preprint to prevent the original preprint from being overwritten | ||
// Also stores primary file for new version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting
public async onSubmit(): Promise<void> { | ||
this.args.resetPageDirty(); | ||
|
||
if (this.isNewVersionFlow) { | ||
try { | ||
const url = this.preprint.links.preprint_versions as string; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
There was a problem hiding this 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.
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
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. |
701f265
into
CenterForOpenScience:feature/preprints-doi-versioning
Todo
Purpose
Summary of Changes
preprint.new-version
routenewVersion
argument to the submission-flow componentsubmission-flow
component in the new-version routeScreenshot(s)
Side Effects
QA Notes