Created
April 18, 2018 15:40
-
-
Save cjkoepke/c4388348f1ae4f63d424e737dcfbaeab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shouldShow = groups => { | |
const field = this.props.field | |
let show = true | |
if ( field.conditional_logic ) { | |
field.conditional_logic.forEach( conditions => { | |
conditions.forEach( condition => { | |
const { field } = fieldLookup( groups, condition.field ) | |
if ( field ) { | |
if ( eval( `"${field.value}" !${condition.operator} "${condition.value}"` ) ) { | |
show = false | |
} | |
} | |
} ) | |
} ) | |
} | |
return show | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment