feat(model view): hide applicable readOnly and writeOnly properties (#5832)

This commit is contained in:
blacktemplar
2020-06-15 22:47:26 +02:00
committed by GitHub
parent 59bbe4ff2f
commit f8dd4e68ec
10 changed files with 44 additions and 14 deletions

View File

@@ -16,6 +16,8 @@ export default class Model extends ImmutablePureComponent {
expandDepth: PropTypes.number,
depth: PropTypes.number,
specPath: ImPropTypes.list.isRequired,
includeReadOnly: PropTypes.bool,
includeWriteOnly: PropTypes.bool,
}
getModelName =( ref )=> {
@@ -34,7 +36,8 @@ export default class Model extends ImmutablePureComponent {
}
render () {
let { getComponent, getConfigs, specSelectors, schema, required, name, isRef, specPath, displayName } = this.props
let { getComponent, getConfigs, specSelectors, schema, required, name, isRef, specPath, displayName,
includeReadOnly, includeWriteOnly} = this.props
const ObjectModel = getComponent("ObjectModel")
const ArrayModel = getComponent("ArrayModel")
const PrimitiveModel = getComponent("PrimitiveModel")
@@ -70,7 +73,9 @@ export default class Model extends ImmutablePureComponent {
schema={ schema }
name={ name }
deprecated={deprecated}
isRef={ isRef } />
isRef={ isRef }
includeReadOnly = {includeReadOnly}
includeWriteOnly = {includeWriteOnly}/>
case "array":
return <ArrayModel
className="array" { ...this.props }
@@ -78,7 +83,9 @@ export default class Model extends ImmutablePureComponent {
schema={ schema }
name={ name }
deprecated={deprecated}
required={ required } />
required={ required }
includeReadOnly = {includeReadOnly}
includeWriteOnly = {includeWriteOnly}/>
case "string":
case "number":
case "integer":