summaryrefslogtreecommitdiff
path: root/client/table/citations.table.js
diff options
context:
space:
mode:
authoradamhrv <adam@ahprojects.com>2019-07-03 13:47:23 +0200
committeradamhrv <adam@ahprojects.com>2019-07-03 13:47:23 +0200
commit2816f045090b99f48f0b26d305eee27e1ab94d85 (patch)
tree7b2179baa6ab6dcce970218ae9e4935b62b64561 /client/table/citations.table.js
parent36a226c3fb3379f4f332c1daad7fe85e2bbea954 (diff)
parent411aa602b9cf886758c4ff5ca5550c43ae7b7804 (diff)
fix merge
Diffstat (limited to 'client/table/citations.table.js')
-rw-r--r--client/table/citations.table.js22
1 files changed, 10 insertions, 12 deletions
diff --git a/client/table/citations.table.js b/client/table/citations.table.js
index 8fe46b69..c1c71906 100644
--- a/client/table/citations.table.js
+++ b/client/table/citations.table.js
@@ -1,11 +1,9 @@
import React, { Component } from 'react'
-import { bindActionCreators } from 'redux'
-import { connect } from 'react-redux'
import { ReactTabulator } from 'react-tabulator'
import { saveAs } from 'file-saver'
import { Loader } from '../common'
-import { toArray, toTuples, domainFromUrl } from '../util'
+import { domainFromUrl } from '../util'
export const citationsColumns = [
{ title: 'Title', field: 'title', sorter: 'string' },
@@ -64,12 +62,12 @@ class CitationsTable extends Component {
if (!q.length) {
this.setState({ q, filteredCitations: formattedCitations })
} else {
- let q_re = new RegExp('(' + q.replace(/\s+/g, ' ').trim().replace(' ', '|') + ')', 'gi')
+ let qRe = new RegExp('(' + q.replace(/\s+/g, ' ').trim().replace(' ', '|') + ')', 'gi')
let filteredCitations = formattedCitations.filter(citation => (
- citation.title.match(q_re) ||
- citation.institution.match(q_re) ||
- citation.country.match(q_re)
- ))
+ citation.title.match(qRe) ||
+ citation.institution.match(qRe) ||
+ citation.country.match(qRe)
+ ))
this.setState({ q, filteredCitations })
}
}
@@ -85,7 +83,7 @@ class CitationsTable extends Component {
case 'number':
return String(data)
default:
- return '\"' + String(data) + '\"'
+ return '"' + String(data) + '"'
}
})
return row.join(",")
@@ -96,8 +94,8 @@ class CitationsTable extends Component {
titles.join(','),
...rows,
].join('\n')
- ], {type: "text/csv;charset=utf-8"});
- saveAs(blob, fn);
+ ], { type: "text/csv;charset=utf-8" })
+ saveAs(blob, fn)
}
render() {
@@ -111,7 +109,7 @@ class CitationsTable extends Component {
value={this.state.q}
onChange={e => this.updateFilter(e.target.value)}
className='q'
- placeholder='Enter text to search citations...'
+ placeholder='Enter text to search citations'
/>
<span className='download' onClick={() => this.download()}>Download CSV</span>
</div>