Skip to content

String property label from uischema.json is not used #2

Description

@mg-cd-26

String property label from uischema.json is not used

On the right the jsforms example and on the left a example from go-jsonforms
Image

Given a testcase with this data.json, schema.json and uischema.json

// data.json
{
    "FirstName": true,
    "Lastname": false
}
// schema.json
{
  "type": "object",
  "properties": {
    "FirstName": {
      "type": "string",
      "description": "FirstName description"
    },
    "Lastname": {
      "type": "string",
      "description": "Lastname description"
    }
  }
}
// uischema.json
{
  "type": "VerticalLayout",
  "elements": [
    {
      "type": "Control",
      "scope": "#/properties/FirstName"
    },
    {
      "type": "Control",
      "scope": "#/properties/Lastname",
      "label": "Last Name"
    }
  ]
}

Then this html is created

<fieldset>
  <div>
    <div class="form-group column col-12">
      <input class="form-input" id="#/properties/FirstName" 
                  name="#/properties/FirstName" type="text" 
                  aria-describedby="#/properties/FirstName-helper" value="John">
      <small id="-helper">FirstName description</small>
    </div>
    <div class="form-group column col-12">
      <input class="form-input" id="#/properties/Lastname" 
                  name="#/properties/Lastname" 
                  type="text" aria-describedby="#/properties/Lastname-helper" value="Doe">
      <small id="-helper">Lastname description</small>
    </div>
  </div>
</fieldset>

GOT

  • The property FirstName with type string is rendered as a input type text. It has no <label>-tag but helper text in a <small>-tag. The schema.description is displayed as helper text below the node.
  • The property Lastname with type string is rendered as a input type text. It has no <label>-tag but helper text in a <small>-tag. The schema.description is displayed as helper text below the node.

WANT

  • Both should use a <label> tag
    • The label text for FirstName should be 'FirstName' since this is the schema.property-name
    • The label text for Lastname should be Last Name from elements[1].label in uischema.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions