Skip to content

Commit

Permalink
Bug 1518073 - add IFV proptypes per new eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-clements authored and edmorley committed Jan 8, 2019
1 parent 34066e5 commit 5723387
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 6 deletions.
28 changes: 28 additions & 0 deletions ui/intermittent-failures/BugDetailsView.jsx
Expand Up @@ -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';

Expand Down Expand Up @@ -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,
Expand Down
14 changes: 14 additions & 0 deletions ui/intermittent-failures/MainView.jsx
Expand Up @@ -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 = {
Expand Down
23 changes: 17 additions & 6 deletions ui/intermittent-failures/View.jsx
Expand Up @@ -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);
Expand Down Expand Up @@ -214,13 +214,24 @@ const withView = defaultState => WrappedComponent =>
const newProps = { ...this.props, ...this.state, ...updateState };
return <WrappedComponent {...newProps} />;
}
}

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;

0 comments on commit 5723387

Please sign in to comment.