Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a uiSchema property to the payload of a protocol adapter type #104

Closed
vanch3d opened this issue Sep 12, 2023 · 0 comments
Closed

Add a uiSchema property to the payload of a protocol adapter type #104

vanch3d opened this issue Sep 12, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@vanch3d
Copy link
Contributor

vanch3d commented Sep 12, 2023

The react-jsonschema-form library is used to create a form out of the JSON Schema specification of an adapter. It introduced a secondary schema to provide information on how the form should be rendered, uiSchema .

See https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema for a description of the schema.

At the moment, the uiSchema is hardcoded in the frontend and contains the combined information of most of the known adapters, by property name. This is not a sustainable situation, for two reasons:

  • The number of adapters is increasing fast and are not all incorporated
  • Different adapters might use the same property name for different attributes

The uiSchema should therefore be located within each adapters, along their configSchema.

The schema is a JSON object, whose attributes are described in the document above. If strongly typed, the description of the UiSchema type can be found here: https://github.com/rjsf-team/react-jsonschema-form/blob/6ffc2ceb1f24e2661d0acbc0c3e09e5e443e9f27/packages/utils/src/types.ts#L784

To the list of default options, we have added a new one to combine top-level properties into separate tabs:

{
  "ui:tabs": [
    {
      "id": "coreFields",
      "title": "title",
      "properties": ["id", "port", "host", "uri", "url", "pollingIntervalMillis"]
    },
    {
      "id": "subFields",
      "title": "Subscription",
      "properties": ["subscriptions"]
    }
  ]
}
@vanch3d vanch3d added the enhancement New feature or request label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants