summaryrefslogtreecommitdiff
path: root/scraper/client/paper/paper.citations.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-03-22 13:03:42 +0100
committerJules Laplace <julescarbon@gmail.com>2019-03-22 13:03:42 +0100
commit190c2cfee56345598feb6af3100e571ce4688925 (patch)
tree9e6e2cec8fc301656131d321804e237c48fd8071 /scraper/client/paper/paper.citations.js
parent73ac1f45da311681769feeb49be4e892576b9d19 (diff)
uses or not
Diffstat (limited to 'scraper/client/paper/paper.citations.js')
-rw-r--r--scraper/client/paper/paper.citations.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/scraper/client/paper/paper.citations.js b/scraper/client/paper/paper.citations.js
index 41ddd55e..53923c6e 100644
--- a/scraper/client/paper/paper.citations.js
+++ b/scraper/client/paper/paper.citations.js
@@ -8,11 +8,17 @@ import * as actions from '../actions'
import { TableObject } from '../common'
class PaperCitations extends Component {
+ componentDidMount() {
+ this.props.actions.getVerifications()
+ }
+
render() {
const { dataset, citations } = this.props.api.paperInfo
+ let { verifications } = this.props.api.verifications
+ verifications = verifications || {}
if (!dataset || !citations) return null
console.log('rendering citations...')
- console.log(citations)
+ // console.log(citations)
return (
<div className='citations'>
<h2>{dataset.name_full}: Citations</h2>
@@ -27,19 +33,40 @@ class PaperCitations extends Component {
_raw: true,
value: (cite.pdf && cite.pdf.length) ? <a href={cite.pdf[0]} rel='noopener noreferrer' target="_blank">[pdf]</a> : "no pdf"
}
+ cite.s2 = {
+ _raw: true,
+ value: <a
+ href={'https://www.semanticscholar.org/paper/' + citation.id}
+ target="_blank"
+ className={'pdfLink'}
+ >{'[semantic scholar]'}</a>
+ }
cite.addresses = {
_raw: true,
value: cite.addresses.map((address, j) => (
<div key={j}>{address.name}{', '}<span className='type'>{address.type}</span></div>
))
}
+ if (citation.id in verifications) {
+ const verification = verifications[citation.id]
+ cite.verified = {
+ _raw: true,
+ value: verification['uses_dataset'] === 'TRUE' ? <span className='verified'>uses dataset</span> : <span className='unverified'>doesn't use dataset</span>
+ }
+ }
+ else {
+ cite.verified = {
+ _raw: true,
+ value: <span className='unknown'>unknown</span>
+ }
+ }
return (
<li key={i}>
<TableObject
summary
object={cite}
tag={cite.title}
- order={['id', 'pdf', 'year', 'addresses']}
+ order={['id', 'pdf', 's2', 'year', 'addresses', 'verified']}
/>
</li>
)