Skip to content

Commit

Permalink
Make journal selection optional in basics step
Browse files Browse the repository at this point in the history
  • Loading branch information
markpatton committed Oct 16, 2023
1 parent 30947e7 commit f07f492
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
3 changes: 0 additions & 3 deletions app/components/workflow-basics/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@
<div>
<label>
Journal
<span class="text-muted">
(required)
</span>
</label>
{{#if this.contactUrl}}
<a class="btn btn-link pull-right pr-0" href="{{this.contactUrl}}">
Expand Down
12 changes: 9 additions & 3 deletions app/components/workflow-basics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/submissions/new/basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit f07f492

Please sign in to comment.