Skip to content

Commit c5cb7ba

Browse files
committed
fix: add missing proptypes
1 parent e7b1aec commit c5cb7ba

File tree

35 files changed

+223
-23
lines changed

35 files changed

+223
-23
lines changed

client/src/components/AuthorsSearch/AuthorsSearch.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React, { Component } from 'react'
2+
import PropTypes from 'prop-types'
23
import { Section, Container, Row, TextInput } from 'react-materialize'
34
import SearchButton from 'components/SearchButton'
45

56
class SearchAuthor extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
}
10+
611
state = {}
712

813
render() {

client/src/components/AuthorsTable/AuthorsTable.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import { Link } from 'react-router-dom'
34
import ReactTable from 'react-table'
45
import Spinner from 'components/Spinner'
@@ -11,7 +12,10 @@ const AuthorsTable = ({ data, className }) => {
1112
Header: 'Author',
1213
accessor: d => `${d.name} ${d.surname}`,
1314
// eslint-disable-next-line react/display-name
14-
Cell: props => <Link to={`/authors/${props.original.ORCID}`}>{props.value}</Link>,
15+
Cell: props => (
16+
// eslint-disable-next-line react/prop-types
17+
<Link to={`/authors/${props.original.ORCID}`}>{props.value}</Link>
18+
),
1519
},
1620
{
1721
Header: 'Documents',
@@ -21,7 +25,9 @@ const AuthorsTable = ({ data, className }) => {
2125
id: 'organization',
2226
Header: 'Organization',
2327
accessor: d => d.Organization.name,
28+
// eslint-disable-next-line react/display-name
2429
Cell: props => (
30+
// eslint-disable-next-line react/prop-types
2531
<Link to={`/organizations/${props.original.Organization.id}`}>{props.value}</Link>
2632
),
2733
},
@@ -41,4 +47,9 @@ const AuthorsTable = ({ data, className }) => {
4147
}
4248
}
4349

50+
AuthorsTable.propTypes = {
51+
data: PropTypes.array,
52+
className: PropTypes.string,
53+
}
54+
4455
export default AuthorsTable

client/src/components/Banner/Banner.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ const Banner = ({ match: { path }, className, icon, iconColor, iconSize, text, t
5959
}
6060

6161
Banner.propTypes = {
62+
match: PropTypes.object,
6263
className: PropTypes.string,
6364
icon: PropTypes.string,
6465
iconColor: PropTypes.string.isRequired,

client/src/components/ConferencesTable/ConferencesTable.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import { Link } from 'react-router-dom'
34
import ReactTable from 'react-table'
45
import Spinner from 'components/Spinner'
@@ -10,7 +11,10 @@ const ConferencesTable = ({ data, className }) => {
1011
Header: 'Conference',
1112
accessor: 'name',
1213
// eslint-disable-next-line react/display-name
13-
Cell: props => <Link to={`/conferences/${props.original.id}`}>{props.value}</Link>,
14+
Cell: props => (
15+
// eslint-disable-next-line react/prop-types
16+
<Link to={`/conferences/${props.original.id}`}>{props.value}</Link>
17+
),
1418
},
1519
{
1620
Header: 'Location',
@@ -37,4 +41,9 @@ const ConferencesTable = ({ data, className }) => {
3741
}
3842
}
3943

44+
ConferencesTable.propTypes = {
45+
data: PropTypes.array,
46+
className: PropTypes.string,
47+
}
48+
4049
export default ConferencesTable

client/src/components/DocumentsSearch/DocumentsSearch.js

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React, { Component } from 'react'
2+
import PropTypes from 'prop-types'
23
import { Section, Container, Row, TextInput } from 'react-materialize'
34
import SearchButton from 'components/SearchButton'
45

56
class SearchDocument extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
}
10+
611
state = {}
712

813
render() {
@@ -75,17 +80,17 @@ class SearchDocument extends Component {
7580
search={
7681
Object.keys(this.state).length
7782
? `?filter=${Object.entries(this.state)
78-
.filter(([, value]) => value.length)
79-
.map(([field, value]) => {
80-
switch (field) {
81-
case 'number_of_pages':
82-
return encodeURIComponent(`${field} eq ${value}`)
83+
.filter(([, value]) => value.length)
84+
.map(([field, value]) => {
85+
switch (field) {
86+
case 'number_of_pages':
87+
return encodeURIComponent(`${field} eq ${value}`)
8388
84-
default:
85-
return encodeURIComponent(`${field} iLike %${value}%`)
86-
}
87-
})
88-
.join(',')}`
89+
default:
90+
return encodeURIComponent(`${field} iLike %${value}%`)
91+
}
92+
})
93+
.join(',')}`
8994
: ''
9095
}
9196
/>

client/src/components/DocumentsTable/DocumentsTable.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import { Link } from 'react-router-dom'
34
import ReactTable from 'react-table'
45
import Spinner from 'components/Spinner'
@@ -9,7 +10,11 @@ const DocumentsTable = ({ data, className }) => {
910
{
1011
Header: 'Document title',
1112
accessor: 'title',
12-
Cell: props => <Link to={`/documents/${props.original.id}`}>{props.value}</Link>,
13+
// eslint-disable-next-line react/display-name
14+
Cell: props => (
15+
// eslint-disable-next-line react/prop-types
16+
<Link to={`/documents/${props.original.id}`}>{props.value}</Link>
17+
),
1318
},
1419
{
1520
Header: 'Pages',
@@ -21,8 +26,12 @@ const DocumentsTable = ({ data, className }) => {
2126
accessor: d => d.Number.Periodical.PublishingCompany.name,
2227
// eslint-disable-next-line react/display-name
2328
Cell: props => (
29+
// eslint-disable-next-line react/prop-types
2430
<Link to={`/publishing-companies/${props.original.Number.Periodical.PublishingCompany.id}`}>
25-
{props.value}
31+
{
32+
// eslint-disable-next-line react/prop-types
33+
props.value
34+
}
2635
</Link>
2736
),
2837
},
@@ -43,4 +52,9 @@ const DocumentsTable = ({ data, className }) => {
4352
}
4453
}
4554

55+
DocumentsTable.propTypes = {
56+
data: PropTypes.array,
57+
className: PropTypes.string,
58+
}
59+
4660
export default DocumentsTable

client/src/components/Navbar/Navbar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Navbar.propTypes = {
101101
children: PropTypes.node,
102102
className: PropTypes.string,
103103
extendWith: PropTypes.node,
104+
mobileLinks: PropTypes.any,
104105
/**
105106
* left makes the navbar links left aligned, right makes them right aligned
106107
*/

client/src/components/NumbersTable/NumbersTable.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import ReactTable from 'react-table'
34
import Spinner from 'components/Spinner'
45
import cx from 'class-names'
@@ -29,4 +30,9 @@ const NumbersTable = ({ data, className }) => {
2930
}
3031
}
3132

33+
NumbersTable.propTypes = {
34+
data: PropTypes.array,
35+
className: PropTypes.string,
36+
}
37+
3238
export default NumbersTable

client/src/components/OrganizationsSearch/OrganizationsSearch.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
import React, { Component } from 'react'
2+
import PropTypes from 'prop-types'
23
import { Section, Container, Row, TextInput } from 'react-materialize'
34
import SearchButton from 'components/SearchButton'
45

56
class SearchAuthor extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
}
10+
611
state = {}
712

813
render() {

client/src/components/OrganizationsTable/OrganizationsTable.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react'
2+
import PropTypes from 'prop-types'
23
import { Link } from 'react-router-dom'
34
import ReactTable from 'react-table'
45
import Spinner from 'components/Spinner'
@@ -10,7 +11,10 @@ const OrganizationsTable = ({ data, className }) => {
1011
Header: 'Name',
1112
accessor: 'name',
1213
// eslint-disable-next-line react/display-name
13-
Cell: props => <Link to={`/organizations/${props.original.id}`}>{props.value}</Link>,
14+
Cell: props => (
15+
// eslint-disable-next-line react/prop-types
16+
<Link to={`/organizations/${props.original.id}`}>{props.value}</Link>
17+
),
1418
},
1519
{
1620
Header: 'Location',
@@ -32,4 +36,9 @@ const OrganizationsTable = ({ data, className }) => {
3236
}
3337
}
3438

39+
OrganizationsTable.propTypes = {
40+
data: PropTypes.array,
41+
className: PropTypes.string,
42+
}
43+
3544
export default OrganizationsTable

0 commit comments

Comments
 (0)