warnings/widgets: forID is not required + typo

This commit is contained in:
abumalick 2017-06-04 17:20:40 +02:00 committed by David Calavera
parent e23f7e69dd
commit 38cb065570
6 changed files with 8 additions and 8 deletions

View File

@ -4,10 +4,10 @@ import Switch from 'react-toolbox/lib/switch';
export default class BooleanControl extends React.Component {
render() {
const { value, field, forId, onChange } = this.props;
const { value, field, forID, onChange } = this.props;
return (
<Switch
id={forId}
id={forID}
checked={value === undefined ? field.get('defaultValue', false) : value}
onChange={onChange}
/>
@ -18,6 +18,6 @@ export default class BooleanControl extends React.Component {
BooleanControl.propTypes = {
field: ImmutablePropTypes.map.isRequired,
onChange: PropTypes.func.isRequired,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
value: PropTypes.bool,
};

View File

@ -30,7 +30,7 @@ export default class ListControl extends Component {
onChange: PropTypes.func.isRequired,
value: PropTypes.node,
field: PropTypes.node,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
getAsset: PropTypes.func.isRequired,
onAddAsset: PropTypes.func.isRequired,
onRemoveAsset: PropTypes.func.isRequired,

View File

@ -13,5 +13,5 @@ export default class StringControl extends React.Component {
StringControl.propTypes = {
onChange: PropTypes.func.isRequired,
value: PropTypes.node,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
};

View File

@ -12,7 +12,7 @@ export default class ObjectControl extends Component {
getAsset: PropTypes.func.isRequired,
value: PropTypes.node,
field: PropTypes.object,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
className: PropTypes.string,
};

View File

@ -12,6 +12,6 @@ export default class StringControl extends React.Component {
StringControl.propTypes = {
onChange: PropTypes.func.isRequired,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
value: PropTypes.node,
};

View File

@ -27,6 +27,6 @@ export default class StringControl extends React.Component {
StringControl.propTypes = {
onChange: PropTypes.func.isRequired,
forID: PropTypes.string.isRequired,
forID: PropTypes.string,
value: PropTypes.node,
};