From f07f492e44a7dcbffb7deb208e822d23a98ddb1e Mon Sep 17 00:00:00 2001 From: Mark Patton Date: Mon, 16 Oct 2023 09:49:21 -0400 Subject: [PATCH] Make journal selection optional in basics step --- app/components/workflow-basics/index.hbs | 3 --- app/components/workflow-basics/index.js | 12 +++++++++--- app/controllers/submissions/new/basics.js | 6 +----- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/components/workflow-basics/index.hbs b/app/components/workflow-basics/index.hbs index 288a56cc..11c151f2 100644 --- a/app/components/workflow-basics/index.hbs +++ b/app/components/workflow-basics/index.hbs @@ -153,9 +153,6 @@
{{#if this.contactUrl}} diff --git a/app/components/workflow-basics/index.js b/app/components/workflow-basics/index.js index b53c5d6c..303e303a 100644 --- a/app/components/workflow-basics/index.js +++ b/app/components/workflow-basics/index.js @@ -46,12 +46,18 @@ export default class WorkflowBasics extends Component { /** * Publication should be set/overwritten if there is no current publication, if the current - * publication has no DOI or Title, or it the current publication has no journal with a - * journalName + * publication has no DOI or Title, or it the current publication has no journal or no journal + * with a journalName */ shouldSetPublication() { const publication = this.publication; - return !publication || !publication.doi || !publication.title || !get(publication, 'journal.journalName'); + return ( + !publication || + !publication.doi || + !publication.title || + !publication.journal || + !get(publication, 'journal.journalName') + ); } constructor() { diff --git a/app/controllers/submissions/new/basics.js b/app/controllers/submissions/new/basics.js index 311dacdf..23575a7e 100644 --- a/app/controllers/submissions/new/basics.js +++ b/app/controllers/submissions/new/basics.js @@ -81,12 +81,8 @@ export default class SubmissionsNewBasics extends Controller { set(this, 'titleError', true); this.flashMessages.warning('The title must not be left blank'); } - if (this.journalIsInvalid) { - set(this, 'journalError', true); - this.flashMessages.warning('The journal must not be left blank'); - } - if (this.titleIsInvalid || this.journalIsInvalid) return; // end here + if (this.titleIsInvalid) return; // end here // non proxy submission will always have current user as submitter, so only need to validate this for proxy submission if (get(this, 'submission.isProxySubmission')) {