summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2019-03-30 15:14:44 +0100
committerJules Laplace <julescarbon@gmail.com>2019-03-30 15:14:44 +0100
commitb9944ee1a4b07edda741cdfc89abf0715f65a164 (patch)
tree1f23b209b0f821f14e959464aca3bacc551ff51d /client
parentcbc0c2ef0862ab45da7c9392d4101332b6dab8e3 (diff)
rebuild
Diffstat (limited to 'client')
-rw-r--r--client/map/index.js3
-rw-r--r--client/tables.js11
2 files changed, 11 insertions, 3 deletions
diff --git a/client/map/index.js b/client/map/index.js
index 7c205268..4e6db2de 100644
--- a/client/map/index.js
+++ b/client/map/index.js
@@ -102,7 +102,8 @@ export default function append(el, payload) {
const citationAddress = citation.addresses[0]
const latlng = [citationAddress.lat, citationAddress.lng].map(n => parseFloat(n))
if (Number.isNaN(latlng[0]) || Number.isNaN(latlng[1])) return
- addMarker(map, latlng, citation.title, citationAddress.name, citation.year, citation.pdf)
+ const addressString = citation.addresses.map(addr => addr.name).join('<br/>')
+ addMarker(map, latlng, citation.title, addressString, citation.year, citation.pdf)
addArc(map, source, latlng, arcStyles[citationAddress.type])
})
diff --git a/client/tables.js b/client/tables.js
index 1077289f..9eedbe18 100644
--- a/client/tables.js
+++ b/client/tables.js
@@ -15,7 +15,9 @@ const citationsColumns = [
{ title: 'Institution', field: 'institution', sorter: 'string' },
{ title: 'Country', field: 'country', sorter: 'string', width: 140 },
{ title: 'Year', field: 'year', sorter: 'number', width: 70 },
- { title: 'PDF', field: 'pdf', formatter: 'link', sorter: 'string', width: 100 },
+ { title: 'PDF', field: 'pdf', formatter: 'link',
+ formatterParams: { target: "_blank", urlField: 'pdf', },
+ sorter: 'string', width: 100 },
]
function getColumns(payload) {
@@ -36,12 +38,17 @@ function getColumns(payload) {
function getCitations(dataset) {
// console.log(dataset.citations)
+ console.log(dataset.citations.map(d => [d.pdf, d.doi]))
return dataset.citations.map(citation => ({
title: citation.title,
institution: citation.addresses[0].name,
country: citation.addresses[0].country,
year: citation.year,
- pdf: (citation.pdf && citation.pdf.length) ? citation.pdf[0] : "",
+ pdf: (citation.pdf && citation.pdf.length)
+ ? citation.pdf[0]
+ : (citation.doi && citation.doi.length)
+ ? citation.doi[0]
+ : "",
}))
}