Bug 1518073 - add IFV proptypes per new eslint errors

This commit is contained in:
Sarah Clements 2019-01-07 16:33:57 -08:00 коммит произвёл Ed Morley
Родитель 34066e579e
Коммит 5723387091
3 изменённых файлов: 59 добавлений и 6 удалений

Просмотреть файл

@ -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,

Просмотреть файл

@ -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 = {

Просмотреть файл

@ -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 <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;