diff options
Diffstat (limited to 'client')
| -rw-r--r-- | client/map/index.js | 3 | ||||
| -rw-r--r-- | client/tables.js | 11 |
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] + : "", })) } |
