fix: json schema array items (#7007)

* feat(ux): json schema array now states type to add

this is to enhance nested array usability wise
This commit is contained in:
Mahtis Michel
2021-03-03 22:44:57 +01:00
committed by GitHub
parent 68bd61a682
commit 2016c184b6

View File

@@ -181,7 +181,7 @@ export class JsonSchema_array extends PureComponent {
const schemaItemsEnum = schema.getIn(["items", "enum"])
const schemaItemsType = schema.getIn(["items", "type"])
const schemaItemsFormat = schema.getIn(["items", "format"])
const schemaItemsSchema = schema.getIn(["items", "schema"])
const schemaItemsSchema = schema.get("items")
let ArrayItemsComponent
let isArrayItemText = false
let isArrayItemFile = (schemaItemsType === "file" || (schemaItemsType === "string" && schemaItemsFormat === "binary")) ? true : false
@@ -264,7 +264,7 @@ export class JsonSchema_array extends PureComponent {
title={arrayErrors.length ? arrayErrors : ""}
onClick={this.addItem}
>
Add item
Add {schemaItemsType ? `${schemaItemsType} ` : ""}item
</Button>
) : null}
</div>