ConditionalPropertyPropType
export const ConditionalPropertyPropType = (rawPropType) =>
PropTypes.oneOfType([
rawPropType,
PredicateShape(rawPropType),
ConditionalListPropertyPropType(rawPropType),
]);
Configuration example
Here is an example of configuring ConditionalPropertyPropType to the hidden property:
{
"hidden": {
"permissionPredicate": {
"hasAnyOf": [
"CYBER_SECURITY_APPLY"
]
},
"dataPredicate": {
"operator": "AND",
"conditions": [
{
"field": ":context.userProfile.roles",
"condition": "notEqual",
"value": "develop"
},
{
"dataField": "status",
"condition": "equals",
"value": "completed"
}
]
},
"valueIfPositive": true,
"valueIfNegative": false
}
}