mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-20 00:08:02 +01:00
Fix faulty proptypes declarations
Go from 188 lint errors to 64
This commit is contained in:
parent
e63e92028b
commit
3f8931ff8c
@ -22,12 +22,10 @@ function replace (input, params) {
|
||||
}
|
||||
|
||||
export default class App extends Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
location: PropTypes.object.isRequired,
|
||||
params: PropTypes.object.isRequired,
|
||||
routes: PropTypes.array.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
|
@ -2,11 +2,9 @@ import React, { Component, PropTypes } from 'react';
|
||||
import { DataTable, TableHeader } from 'react-mdl';
|
||||
|
||||
class ClientStrategies extends Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
fetchClientInstances: PropTypes.func.isRequired,
|
||||
clientInstances: PropTypes.array.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
|
@ -3,11 +3,9 @@ import React, { PropTypes } from 'react';
|
||||
import { Snackbar, Icon } from 'react-mdl';
|
||||
|
||||
class ErrorComponent extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
errors: PropTypes.array.isRequired,
|
||||
muteError: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
|
@ -2,12 +2,10 @@ import React, { PropTypes } from 'react';
|
||||
import { Menu, MenuItem, IconButton } from 'react-mdl';
|
||||
|
||||
class AddStrategy extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
strategies: PropTypes.array.isRequired,
|
||||
addStrategy: PropTypes.func.isRequired,
|
||||
fetchStrategies: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
addStrategy = (strategyName) => {
|
||||
|
@ -5,14 +5,12 @@ import HTML5Backend from 'react-dnd-html5-backend';
|
||||
|
||||
@DragDropContext(HTML5Backend) // eslint-disable-line new-cap
|
||||
class StrategiesList extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
strategies: PropTypes.array.isRequired,
|
||||
configuredStrategies: PropTypes.array.isRequired,
|
||||
updateStrategy: PropTypes.func.isRequired,
|
||||
removeStrategy: PropTypes.func.isRequired,
|
||||
moveStrategy: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
|
@ -5,14 +5,12 @@ import AddStrategy from './strategies-add';
|
||||
import { HeaderTitle } from '../../common';
|
||||
|
||||
class StrategiesSection extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
strategies: PropTypes.array.isRequired,
|
||||
addStrategy: PropTypes.func.isRequired,
|
||||
removeStrategy: PropTypes.func.isRequired,
|
||||
updateStrategy: PropTypes.func.isRequired,
|
||||
fetchStrategies: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
|
@ -45,8 +45,7 @@ const dragTarget = {
|
||||
isDragging: monitor.isDragging(),
|
||||
}))
|
||||
class StrategyConfigure extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
strategy: PropTypes.object.isRequired,
|
||||
strategyDefinition: PropTypes.object.isRequired,
|
||||
updateStrategy: PropTypes.func.isRequired,
|
||||
@ -56,7 +55,6 @@ class StrategyConfigure extends React.Component {
|
||||
connectDragPreview: PropTypes.func.isRequired,
|
||||
connectDragSource: PropTypes.func.isRequired,
|
||||
connectDropTarget: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
handleConfigChange = (key, e) => {
|
||||
|
@ -7,16 +7,13 @@ import { MenuItemWithIcon, DropdownButton, styles as commonStyles } from '../com
|
||||
import styles from './feature.scss';
|
||||
|
||||
export default class FeatureListComponent extends React.PureComponent {
|
||||
static propTypes () {
|
||||
return {
|
||||
toggleFeature: PropTypes.func.isRequired,
|
||||
static propTypes = {
|
||||
features: PropTypes.array.isRequired,
|
||||
featureMetrics: PropTypes.object.isRequired,
|
||||
fetchFeatureToggles: PropTypes.func.isRequired,
|
||||
fetchFeatureMetrics: PropTypes.func.isRequired,
|
||||
updateSetting: PropTypes.func.isRequired,
|
||||
settings: React.PropTypes.object,
|
||||
};
|
||||
}
|
||||
|
||||
static contextTypes = {
|
||||
|
@ -23,13 +23,11 @@ const StrategiesList = ({ strategies }) => (
|
||||
);
|
||||
|
||||
export default class MetricComponent extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
metrics: PropTypes.object.isRequired,
|
||||
featureToggle: PropTypes.object.isRequired,
|
||||
fetchSeenApps: PropTypes.func.isRequired,
|
||||
fetchFeatureMetrics: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
|
@ -18,8 +18,7 @@ export default class ViewFeatureToggleComponent extends React.Component {
|
||||
super(props);
|
||||
}
|
||||
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
activeTab: PropTypes.string.isRequired,
|
||||
featureToggleName: PropTypes.string.isRequired,
|
||||
features: PropTypes.array.isRequired,
|
||||
@ -27,7 +26,6 @@ export default class ViewFeatureToggleComponent extends React.Component {
|
||||
removeFeatureToggle: PropTypes.func.isRequired,
|
||||
fetchFeatureToggles: PropTypes.array.isRequired,
|
||||
featureToggle: PropTypes.object.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
|
@ -59,10 +59,8 @@ function buildDiff (diff, idx) {
|
||||
}
|
||||
|
||||
class HistoryItem extends PureComponent {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
entry: PropTypes.object,
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
|
@ -3,10 +3,8 @@ import React, { PropTypes, PureComponent } from 'react';
|
||||
import style from './history.scss';
|
||||
|
||||
class HistoryItem extends PureComponent {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
entry: PropTypes.object,
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
|
@ -2,10 +2,8 @@ import React, { Component, PropTypes } from 'react';
|
||||
import HistoryList from './history-list-container';
|
||||
|
||||
class HistoryListToggle extends Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
toggleName: PropTypes.string.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
|
@ -91,8 +91,7 @@ const Parameters = ({ input = [], count = 0, updateInList }) => (
|
||||
}</div>);
|
||||
|
||||
class AddStrategy extends Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
input: PropTypes.object,
|
||||
setValue: PropTypes.func,
|
||||
updateInList: PropTypes.func,
|
||||
@ -103,7 +102,6 @@ class AddStrategy extends Component {
|
||||
editmode: PropTypes.bool,
|
||||
initCallRequired: PropTypes.bool,
|
||||
init: PropTypes.func,
|
||||
};
|
||||
}
|
||||
|
||||
componentWillMount () {
|
||||
|
@ -3,12 +3,10 @@ import { Grid, Cell, List, ListItem, ListItemContent } from 'react-mdl';
|
||||
import { AppsLinkList, TogglesLinkList } from '../common';
|
||||
|
||||
class ShowStrategyComponent extends PureComponent {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
toggles: PropTypes.array,
|
||||
applications: PropTypes.array,
|
||||
strategy: PropTypes.object.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
renderParameters (params) {
|
||||
|
@ -11,8 +11,7 @@ const TABS = {
|
||||
};
|
||||
|
||||
export default class StrategyDetails extends Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
strategyName: PropTypes.string.isRequired,
|
||||
toggles: PropTypes.array,
|
||||
applications: PropTypes.array,
|
||||
@ -21,7 +20,6 @@ export default class StrategyDetails extends Component {
|
||||
fetchStrategies: PropTypes.func.isRequired,
|
||||
fetchApplications: PropTypes.func.isRequired,
|
||||
fetchFeatureToggles: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
|
@ -2,12 +2,10 @@ import React, { PropTypes } from 'react';
|
||||
import { Icon, Tooltip } from 'react-mdl';
|
||||
|
||||
export default class ShowUserComponent extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
user: PropTypes.object.isRequired,
|
||||
openEdit: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
openEdit = (evt) => {
|
||||
evt.preventDefault();
|
||||
|
@ -24,12 +24,10 @@ const customStyles = {
|
||||
};
|
||||
|
||||
class EditUserComponent extends React.Component {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
user: PropTypes.object.isRequired,
|
||||
updateUserName: PropTypes.func.isRequired,
|
||||
save: PropTypes.func.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
handleSubmit = (evt) => {
|
||||
|
@ -2,10 +2,8 @@ import React, { PureComponent, PropTypes } from 'react';
|
||||
import ViewFeatureToggle from '../../component/feature/view-container';
|
||||
|
||||
export default class Features extends PureComponent {
|
||||
static propTypes () {
|
||||
return {
|
||||
static propTypes = {
|
||||
params: PropTypes.object.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
render () {
|
||||
|
Loading…
Reference in New Issue
Block a user