diff --git a/package.json b/package.json index c3a74ff6ea1..bc09843c8c1 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "eslint-plugin-jest": "22.1.2", "eslint-plugin-jsx-a11y": "6.1.2", "eslint-plugin-prettier": "3.0.1", - "eslint-plugin-react": "7.11.1", + "eslint-plugin-react": "7.12.3", "fetch-mock": "7.3.0", "jasmine-jquery": "2.1.1", "jest": "23.6.0", diff --git a/ui/intermittent-failures/BugDetailsView.jsx b/ui/intermittent-failures/BugDetailsView.jsx index 14f08786415..4e83a339a6d 100644 --- a/ui/intermittent-failures/BugDetailsView.jsx +++ b/ui/intermittent-failures/BugDetailsView.jsx @@ -3,6 +3,7 @@ import { Row, Col } from 'reactstrap'; import { Link } from 'react-router-dom'; import Icon from 'react-fontawesome'; import ReactTable from 'react-table'; +import PropTypes from 'prop-types'; import { bugDetailsEndpoint, getJobsUrl } from '../helpers/url'; @@ -157,6 +158,33 @@ const BugDetailsView = props => { ); }; +BugDetailsView.propTypes = { + location: PropTypes.shape({}).isRequired, + tree: PropTypes.string.isRequired, + updateAppState: PropTypes.func, + updateState: PropTypes.func.isRequired, + startday: PropTypes.string.isRequired, + endday: PropTypes.string.isRequired, + tableData: PropTypes.arrayOf(PropTypes.shape({})), + graphData: PropTypes.arrayOf(PropTypes.shape({})), + initialParamsSet: PropTypes.bool.isRequired, + bug: PropTypes.number.isRequired, + summary: PropTypes.string.isRequired, + errorMessages: PropTypes.arrayOf(PropTypes.string), + lastLocation: PropTypes.shape({}).isRequired, + tableFailureStatus: PropTypes.string, + graphFailureStatus: PropTypes.string, +}; + +BugDetailsView.defaultProps = { + graphData: [], + tableData: [], + errorMessages: [], + tableFailureStatus: null, + graphFailureStatus: null, + updateAppState: null, +}; + const defaultState = { route: '/bugdetails', endpoint: bugDetailsEndpoint, diff --git a/ui/intermittent-failures/MainView.jsx b/ui/intermittent-failures/MainView.jsx index eef7743ea5f..0287ef9c317 100644 --- a/ui/intermittent-failures/MainView.jsx +++ b/ui/intermittent-failures/MainView.jsx @@ -143,6 +143,20 @@ const MainView = props => { MainView.propTypes = { location: PropTypes.shape({}).isRequired, + tree: PropTypes.string.isRequired, + updateAppState: PropTypes.func, + updateState: PropTypes.func.isRequired, + startday: PropTypes.string.isRequired, + endday: PropTypes.string.isRequired, + tableData: PropTypes.arrayOf(PropTypes.shape({})), + graphData: PropTypes.arrayOf(PropTypes.shape({})), + initialParamsSet: PropTypes.bool.isRequired, +}; + +MainView.defaultProps = { + graphData: [], + tableData: [], + updateAppState: null, }; const defaultState = { diff --git a/ui/intermittent-failures/View.jsx b/ui/intermittent-failures/View.jsx index 01c7c5c350e..8fea368bcd2 100644 --- a/ui/intermittent-failures/View.jsx +++ b/ui/intermittent-failures/View.jsx @@ -17,7 +17,7 @@ import { formatBugs, } from './helpers'; -const withView = defaultState => WrappedComponent => +const withView = defaultState => WrappedComponent => { class View extends React.Component { constructor(props) { super(props); @@ -214,13 +214,24 @@ const withView = defaultState => WrappedComponent => const newProps = { ...this.props, ...this.state, ...updateState }; return ; } + } + + View.propTypes = { + history: PropTypes.shape({}).isRequired, + location: PropTypes.shape({ + search: PropTypes.string, + state: PropTypes.shape({}), + }).isRequired, + mainGraphData: PropTypes.arrayOf(PropTypes.shape({})), + mainTableData: PropTypes.arrayOf(PropTypes.shape({})), }; -withView.propTypes = { - history: PropTypes.shape({}).isRequired, - location: PropTypes.shape({ - search: PropTypes.string, - }).isRequired, + View.defaultProps = { + mainGraphData: null, + mainTableData: null, + }; + + return View; }; export default withView; diff --git a/yarn.lock b/yarn.lock index 7d8f98052bb..0214aa43901 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3579,18 +3579,7 @@ eslint-plugin-prettier@3.0.1: dependencies: prettier-linter-helpers "^1.0.0" -eslint-plugin-react@7.11.1: - version "7.11.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.11.1.tgz#c01a7af6f17519457d6116aa94fc6d2ccad5443c" - integrity sha512-cVVyMadRyW7qsIUh3FHp3u6QHNhOgVrLQYdQEB1bPWBsgbNCHdFAeNMquBMCcZJu59eNthX053L70l7gRt4SCw== - dependencies: - array-includes "^3.0.3" - doctrine "^2.1.0" - has "^1.0.3" - jsx-ast-utils "^2.0.1" - prop-types "^15.6.2" - -eslint-plugin-react@^7.11.1: +eslint-plugin-react@7.12.3, eslint-plugin-react@^7.11.1: version "7.12.3" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.3.tgz#b9ca4cd7cd3f5d927db418a1950366a12d4568fd" integrity sha512-WTIA3cS8OzkPeCi4KWuPmjR33lgG9r9Y/7RmnLTRw08MZKgAfnK/n3BO4X0S67MPkVLazdfCNT/XWqcDu4BLTA==