Skip to content
Snippets Groups Projects
Commit 20265243 authored by ahamelers's avatar ahamelers Committed by Nikos Marinos
Browse files

#98 show previously entered journal and title for editing

parent 5822b2ca
No related branches found
No related tags found
1 merge request!21Replace master with dev
......@@ -195,7 +195,7 @@ class EPMCCreated extends React.Component {
<Buttons>
<div>
{!this.state.showSearch && (
<Button onClick={this.goPrev}>Back</Button>
<Button onClick={this.goPrev}>Previous</Button>
)}
<Button
disabled={this.getDisableNext(currentStep)}
......
......@@ -46,7 +46,10 @@ class PubMedSearch extends React.Component {
hitcount: null,
inPMC: null,
pmcid: null,
unmatched: false,
unmatched:
this.props.metadata &&
(!this.props.metadata.articleId ||
this.props.metadata.articleId.length === 0),
// pubProvided: null,
}
this.onSearch = this.onSearch.bind(this)
......@@ -149,9 +152,13 @@ class PubMedSearch extends React.Component {
}
render() {
const { metadata } = this.props
const { title, journalMeta } = metadata || {}
const { title: journalTitle } = journalMeta || {}
const { title, journalMeta, customMeta } = metadata || {}
let journal = journalMeta
if (!journal && customMeta && customMeta.unmatchedJournal) {
journal = {
title: customMeta.unmatchedJournal,
}
}
if (this.state.unmatched) {
return ReactDOM.createPortal(
<Cover>
......@@ -160,8 +167,8 @@ class PubMedSearch extends React.Component {
<CloseIcon onClick={() => this.setState({ unmatched: false })} />
</Close>
<UnmatchedCitation
journal={title}
title={journalTitle}
journal={journal}
title={title}
unmatchedInfo={this.handleUnmatchedInfo}
/>
</Page>
......
......@@ -8,11 +8,11 @@ export default class UnmatchedCitation extends React.Component {
constructor(props) {
super(props)
this.state = {
title: '',
query: '',
journal: null,
title: this.props.title,
query: this.props.journal ? this.props.journal.title : '',
journal: this.props.journal,
note: this.props.note,
enabled: false,
enabled: this.props.title && this.props.journal,
journals: [],
titleMessage: '',
journalMessage: '',
......@@ -146,7 +146,6 @@ export default class UnmatchedCitation extends React.Component {
optionsOnChange={this.onJournalChange}
placeholder="Journal title abbreviation"
query={this.state.query}
selectedOptions={this.props.journal}
singleSelect
>
{this.state.journals.map(journal => (
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment