Skip to content

Commit

Permalink
Should be retro-compatible now
Browse files Browse the repository at this point in the history
  • Loading branch information
mboudet committed Jul 12, 2021
1 parent 264103d commit 9a2650c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
12 changes: 6 additions & 6 deletions askomics/react/src/routes/form/attribute.jsx
Expand Up @@ -110,7 +110,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={eyeIcon} id={this.props.attribute.id} onClick={this.toggleVisibility}></i>
Expand Down Expand Up @@ -186,7 +186,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
{this.props.attribute.uri == "rdf:type" || this.props.attribute.uri == "rdfs:label" ? <nodiv></nodiv> : <i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i> }
Expand Down Expand Up @@ -256,7 +256,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -308,7 +308,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -354,7 +354,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -432,7 +432,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label">{this.props.attribute.displayLabel}</label>
<label className="attr-label">{this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label}</label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down
2 changes: 1 addition & 1 deletion askomics/react/src/routes/form/query.jsx
Expand Up @@ -440,7 +440,7 @@ export default class FormQuery extends Component {
this.state.graphState.attr.forEach(attribute => {
if (attribute.form) {
if (! entityMap.has(attribute.nodeId)){
entityMap.set(attribute.nodeId, {entity_label: attribute.entityDisplayLabel, attributes:[]})
entityMap.set(attribute.nodeId, {entity_label: attribute.entityDisplayLabel ? attribute.entityDisplayLabel : attribute.entityLabel, attributes:[]})
}
entityMap.get(attribute.nodeId).attributes.push(
<AttributeBox
Expand Down
12 changes: 6 additions & 6 deletions askomics/react/src/routes/form_edit/attribute.jsx
Expand Up @@ -110,7 +110,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={eyeIcon} id={this.props.attribute.id} onClick={this.toggleVisibility}></i>
Expand Down Expand Up @@ -188,7 +188,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
{this.props.attribute.uri == "rdf:type" || this.props.attribute.uri == "rdfs:label" ? <nodiv></nodiv> : <i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i> }
Expand Down Expand Up @@ -258,7 +258,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -310,7 +310,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -356,7 +356,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down Expand Up @@ -434,7 +434,7 @@ export default class AttributeBox extends Component {

return (
<div className="attribute-box">
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel} value={this.props.attribute.displayLabel} onChange={this.props.setAttributeName} /></label>
<label className="attr-label"><Input type="text" id={this.props.attribute.id} placeholder={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} value={this.props.attribute.displayLabel ? this.props.attribute.displayLabel : this.props.attribute.label} onChange={this.props.setAttributeName} /></label>
<div className="attr-icons">
<i className={linkIcon} id={this.props.attribute.id} onClick={this.toggleLinkAttribute}></i>
<i className={optionalIcon} id={this.props.attribute.id} onClick={this.toggleOptional}></i>
Expand Down
2 changes: 1 addition & 1 deletion askomics/react/src/routes/form_edit/query.jsx
Expand Up @@ -390,7 +390,7 @@ export default class FormEditQuery extends Component {
this.state.graphState.attr.forEach(attribute => {
if (attribute.form) {
if (! entityMap.has(attribute.nodeId)){
entityMap.set(attribute.nodeId, {entity_label: attribute.entityDisplayLabel, attributes:[]})
entityMap.set(attribute.nodeId, {entity_label: attribute.entityDisplayLabel ? attribute.entityDisplayLabel : attribute.entityLabel, attributes:[]})
}
entityMap.get(attribute.nodeId).attributes.push(
<AttributeBox
Expand Down

0 comments on commit 9a2650c

Please sign in to comment.