diff --git a/src/core/components/layout-utils.jsx b/src/core/components/layout-utils.jsx index 00a4a09d..f80e0c90 100644 --- a/src/core/components/layout-utils.jsx +++ b/src/core/components/layout-utils.jsx @@ -129,7 +129,8 @@ export class Select extends React.Component { value: PropTypes.any, onChange: PropTypes.func, multiple: PropTypes.bool, - allowEmptyValue: PropTypes.bool + allowEmptyValue: PropTypes.bool, + className: PropTypes.string } static defaultProps = { @@ -142,7 +143,7 @@ export class Select extends React.Component { let value - if (props.value !== undefined) { + if (props.value) { value = props.value } else { value = props.multiple ? [""] : "" @@ -178,7 +179,7 @@ export class Select extends React.Component { let value = this.state.value.toJS ? this.state.value.toJS() : this.state.value return ( - { allowEmptyValue ? : null } { allowedValues.map(function (item, key) { diff --git a/src/core/components/models.jsx b/src/core/components/models.jsx index c61ae0c9..86c3256d 100644 --- a/src/core/components/models.jsx +++ b/src/core/components/models.jsx @@ -24,8 +24,8 @@ export default class Models extends Component { return

layoutActions.show("models", !showModels)}> Models - - + +

diff --git a/src/core/json-schema-components.js b/src/core/json-schema-components.js index bf4ae514..338bd6e3 100644 --- a/src/core/json-schema-components.js +++ b/src/core/json-schema-components.js @@ -57,7 +57,8 @@ export class JsonSchema_string extends Component { if ( enumValue ) { const Select = getComponent("Select") - return () } - let errors = schema.errors || [] - return (
- { !value || value.count() < 1 ? - (errors.length ? { errors[0] } : null) : + { !value || value.count() < 1 ? null : value.map( (item,i) => { let schema = Object.assign({}, itemSchema) if ( errors.length ) { @@ -153,12 +153,12 @@ export class JsonSchema_array extends PureComponent { return (
this.onItemChange(val, i)} schema={schema} /> - +
) }).toArray() } - +
) } @@ -170,12 +170,14 @@ export class JsonSchema_boolean extends Component { onEnumChange = (val) => this.props.onChange(val) render() { - let { getComponent, required, value } = this.props + let { getComponent, value, schema } = this.props + let errors = schema.errors || [] const Select = getComponent("Select") - return (