fix: always display locally-available title property as a model's name (#4542)

* fix: always display locally-available `title` property as a model's name
* fix failing unit test
* add e2e test case
This commit is contained in:
kyle
2018-05-10 22:15:36 -07:00
committed by GitHub
parent 66e9bd735a
commit 9155eb946e
9 changed files with 64 additions and 13 deletions

View File

@@ -10,11 +10,12 @@ export default class Primitive extends Component {
getComponent: PropTypes.func.isRequired,
getConfigs: PropTypes.func.isRequired,
name: PropTypes.string,
displayName: PropTypes.string,
depth: PropTypes.number
}
render(){
let { schema, getComponent, getConfigs, name, depth } = this.props
let { schema, getComponent, getConfigs, name, displayName, depth } = this.props
const { showExtensions } = getConfigs()
@@ -27,7 +28,7 @@ export default class Primitive extends Component {
let format = schema.get("format")
let xml = schema.get("xml")
let enumArray = schema.get("enum")
let title = schema.get("title") || name
let title = schema.get("title") || displayName || name
let description = schema.get("description")
let extensions = getExtensions(schema)
let properties = schema