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