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

client/src/components/Parallax/Parallax.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Parallax extends Component {
3434
Parallax.propTypes = {
3535
children: PropTypes.node,
3636
className: PropTypes.string,
37+
image: PropTypes.node,
3738
/**
3839
* The image path which will be used for the background of the parallax
3940
*/

client/src/components/PeriodicalsSearch/PeriodicalsSearch.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 SearchPeriodical extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
}
10+
611
state = {}
712

813
render() {

client/src/components/PeriodicalsTable/PeriodicalsTable.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
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'
56
import cx from 'class-names'
67

7-
const AuthorsTable = ({ data, className }) => {
8+
const PeriodicalsTable = ({ data, className }) => {
89
const columns = [
910
{
1011
Header: 'Name',
1112
accessor: 'title',
12-
Cell: props => <Link to={`/periodicals/${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={`/periodicals/${props.original.id}`}>{props.value}</Link>
17+
),
1318
},
1419
{
1520
id: 'publishing-company',
1621
Header: 'Publishing Company',
1722
accessor: d => d.PublishingCompany.name,
1823
// eslint-disable-next-line react/display-name
1924
Cell: props => (
25+
// eslint-disable-next-line react/prop-types
2026
<Link to={`/publishing-companies/${props.original.PublishingCompany.id}`}>
21-
{props.value}
27+
{
28+
// eslint-disable-next-line react/prop-types
29+
props.value
30+
}
2231
</Link>
2332
),
2433
},
@@ -38,4 +47,9 @@ const AuthorsTable = ({ data, className }) => {
3847
}
3948
}
4049

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

client/src/components/PublishingCompaniesSearch/PublishingCompaniesSearch.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 SearchPublishingCompany extends Component {
7+
static propTypes = {
8+
className: PropTypes.string,
9+
}
10+
611
state = {}
712

813
render() {

client/src/components/PublishingCompaniesTable/PublishingCompaniesTable.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 PublishingCompaniesTable = ({ data, className }) => {
1011
Header: 'Name',
1112
accessor: 'name',
1213
// eslint-disable-next-line react/display-name
13-
Cell: props => <Link to={`/publishing-companies/${props.original.id}`}>{props.value}</Link>,
14+
Cell: props => (
15+
// eslint-disable-next-line react/prop-types
16+
<Link to={`/publishing-companies/${props.original.id}`}>{props.value}</Link>
17+
),
1418
},
1519
]
1620

@@ -28,4 +32,9 @@ const PublishingCompaniesTable = ({ data, className }) => {
2832
}
2933
}
3034

35+
PublishingCompaniesTable.propTypes = {
36+
data: PropTypes.array,
37+
className: PropTypes.string,
38+
}
39+
3140
export default PublishingCompaniesTable

client/src/components/SearchButton/SearchButton.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const SearchButton = ({ search, match: { path } }) => {
2323
)
2424
}
2525

26-
SearchButton.propTypes = {}
26+
SearchButton.propTypes = {
27+
search: PropTypes.string,
28+
match: PropTypes.object,
29+
}
2730

2831
export default withRouter(SearchButton)

client/src/components/Spinner/Spinner.js

Lines changed: 5 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 { Preloader } from 'react-materialize'
34
import cx from 'class-names'
45
import Style from './Spinner.module.css'
@@ -9,4 +10,8 @@ const Spinner = ({ className }) => (
910
</div>
1011
)
1112

13+
Spinner.propTypes = {
14+
className: PropTypes.string,
15+
}
16+
1217
export default Spinner

client/src/components/SponsorsTable/SponsorsTable.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'
@@ -25,4 +26,9 @@ const SponsorsTable = ({ data, className }) => {
2526
}
2627
}
2728

29+
SponsorsTable.propTypes = {
30+
data: PropTypes.array,
31+
className: PropTypes.string,
32+
}
33+
2834
export default SponsorsTable

0 commit comments

Comments
 (0)