eclipsesource / eclipsesource/jsonforms

Support 'oneOf' enum titles in array element headers

Open
#1,621 3 comments 0 reactions 0 assignees View on GitHub
material react
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

**Describe the bug**
I am trying to add label to enum fields as described in this commit https://github.com/eclipsesource/jsonforms/commit/432af77ab5db94b24051055f3ceca16a4d5beab9. Its resulting in weird recursive form.

**To Reproduce**
Jsonschema:
```
"loadBalancer": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"threshold",
"duration",
"severity"
],
"properties": {
// 3 other elements as in screenshot
"severity": {
"type": "string",
"oneOf": [
{"const": "foo", "title": "Foo"},
{"const": "bar", "title": "Bar"}
],
"default": "foo"
}
}
}
},

```

UISchema:
```
{
"type": "Control",
"scope": "#/properties/deployment/properties/alerts/properties/loadBalancer",
"label": "LoadBalancer alerts",
"options": {
"detail": {
"type": "VerticalLayout",
"elements": [
// 3 other elements as in screenshot
{
"type": "Control",
"scope": "#/properties/severity"
}
]
}
}

```

**Expected behavior**
Expected to show usual dropdown with different title and value

**Screenshots**
Foo, Bar instead of coming as drop down are coming as category fields. And in these categories, my whole form is again inside.

![Screenshot 2020-08-10 at 1 36 16 PM](https://user-images.githubusercontent.com/8509512/89763304-ddc6b100-db0f-11ea-8df3-b7c5053747e6.png)

**Browser (please complete the following information):**
- Browser [Firefox]
- Version [79.0]

**Used Setup (please complete the following information):**
- Framework: [react]
- RendererSet: [material]

**Additional context**
The said enum field is a field contained in array of objects, thats why I am using `options->detail`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.