File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/components/components Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,30 @@ export default class Component extends React.Component {
9494
9595 return Object . keys ( componentData . schema )
9696 . sort ( )
97+ . filter ( ( propertyName ) => {
98+ if ( ! componentData . schema [ propertyName ] . if ) {
99+ return true ;
100+ }
101+ let showProperty = true ;
102+ for ( const [ conditionKey , conditionValue ] of Object . entries (
103+ componentData . schema [ propertyName ] . if
104+ ) ) {
105+ if ( Array . isArray ( conditionValue ) ) {
106+ if (
107+ conditionValue . indexOf ( componentData . data [ conditionKey ] ) === - 1
108+ ) {
109+ showProperty = false ;
110+ break ;
111+ }
112+ } else {
113+ if ( conditionValue !== componentData . data [ conditionKey ] ) {
114+ showProperty = false ;
115+ break ;
116+ }
117+ }
118+ }
119+ return showProperty ;
120+ } )
97121 . map ( ( propertyName ) => (
98122 < PropertyRow
99123 key = { propertyName }
You can’t perform that action at this time.
0 commit comments