feat(model view): hide applicable readOnly and writeOnly properties (#5832)
This commit is contained in:
@@ -19,12 +19,14 @@ export default class ObjectModel extends Component {
|
||||
isRef: PropTypes.bool,
|
||||
expandDepth: PropTypes.number,
|
||||
depth: PropTypes.number,
|
||||
specPath: ImPropTypes.list.isRequired
|
||||
specPath: ImPropTypes.list.isRequired,
|
||||
includeReadOnly: PropTypes.bool,
|
||||
includeWriteOnly: PropTypes.bool,
|
||||
}
|
||||
|
||||
render(){
|
||||
let { schema, name, displayName, isRef, getComponent, getConfigs, depth, onToggle, expanded, specPath, ...otherProps } = this.props
|
||||
let { specSelectors,expandDepth } = otherProps
|
||||
let { specSelectors,expandDepth, includeReadOnly, includeWriteOnly} = otherProps
|
||||
const { isOAS3 } = specSelectors
|
||||
|
||||
if(!schema) {
|
||||
@@ -87,7 +89,12 @@ export default class ObjectModel extends Component {
|
||||
</tr>
|
||||
}
|
||||
{
|
||||
!(properties && properties.size) ? null : properties.entrySeq().map(
|
||||
!(properties && properties.size) ? null : properties.entrySeq().filter(
|
||||
([, value]) => {
|
||||
return (!value.get("readOnly") || includeReadOnly) &&
|
||||
(!value.get("writeOnly") || includeWriteOnly)
|
||||
}
|
||||
).map(
|
||||
([key, value]) => {
|
||||
let isDeprecated = isOAS3() && value.get("deprecated")
|
||||
let isRequired = List.isList(requiredProperties) && requiredProperties.contains(key)
|
||||
|
||||
Reference in New Issue
Block a user