diff --git a/ui/intermittent-failures/BugDetailsView.jsx b/ui/intermittent-failures/BugDetailsView.jsx index 14f087864..4e83a339a 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 eef7743ea..0287ef9c3 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 01c7c5c35..8fea368bc 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;