Skip to content
Snippets Groups Projects
Commit 29514c02 authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-7569 NEW openBIS UI - General Template/Infrastructure for Forms -...

SSDM-7569 NEW openBIS UI - General Template/Infrastructure for Forms - Visualisation/Creation/Edit - fix validation + properly handle propertyType == null case
parent 3ca1ac9a
No related branches found
No related tags found
No related merge requests found
...@@ -212,7 +212,7 @@ class ObjectType extends React.Component { ...@@ -212,7 +212,7 @@ class ObjectType extends React.Component {
let newProperties = this.state.objectType.properties.map(property => { let newProperties = this.state.objectType.properties.map(property => {
let errors = {} let errors = {}
if(!_.trim(property.type)){ if(!property.propertyType){
errors['propertyType'] = 'Cannot be empty' errors['propertyType'] = 'Cannot be empty'
} }
......
...@@ -132,13 +132,16 @@ class ObjectTypeTableRow extends React.Component { ...@@ -132,13 +132,16 @@ class ObjectTypeTableRow extends React.Component {
renderPreview(){ renderPreview(){
const {property, propertyTypes} = this.props const {property, propertyTypes} = this.props
const propertyType = _.find(propertyTypes, propertyType => { if(property.propertyType){
return propertyType.code === property.propertyType.code const propertyType = _.find(propertyTypes, propertyType => {
}) return propertyType.code === property.propertyType.code
})
return ( return (
<ObjectTypePropertyPreview property={property} propertyType={propertyType} /> <ObjectTypePropertyPreview property={property} propertyType={propertyType} />
) )
}else{
return (<div></div>)
}
} }
renderPropertyType(){ renderPropertyType(){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment