Skip to content

Commit 5a9af29

Browse files
committed
Merge tag '24.07.1' into develop
[ENG-5994] Fix Preprint Resubmission Workflow #2333 Closes #2333
2 parents 584b785 + b47a335 commit 5a9af29

File tree

1 file changed

+11
-12
lines changed
  • app/preprints/-components/submit/preprint-state-machine

1 file changed

+11
-12
lines changed

app/preprints/-components/submit/preprint-state-machine/component.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,21 @@ export default class PreprintStateMachine extends Component<StateMachineArgs>{
213213
@waitFor
214214
public async onSubmit(): Promise<void> {
215215
this.args.resetPageDirty();
216-
if (!this.isEditFlow) {
217-
if (this.provider.reviewsWorkflow) {
218-
const reviewAction = this.store.createRecord('review-action', {
219-
actionTrigger: 'submit',
220-
target: this.preprint,
221-
});
222-
await reviewAction.save();
223-
} else {
224-
this.preprint.isPublished = true;
225-
await this.preprint.save();
226-
}
227216

217+
if (this.preprint.reviewsState === ReviewsState.ACCEPTED) {
218+
await this.preprint.save();
219+
} else if (this.provider.reviewsWorkflow) {
220+
const reviewAction = this.store.createRecord('review-action', {
221+
actionTrigger: 'submit',
222+
target: this.preprint,
223+
});
224+
await reviewAction.save();
225+
} else {
226+
this.preprint.isPublished = true;
227+
await this.preprint.save();
228228
}
229229

230230
await this.preprint.reload();
231-
232231
await this.router.transitionTo('preprints.detail', this.provider.id, this.preprint.id);
233232
}
234233

0 commit comments

Comments
 (0)