Visibility Rules fix

* Reduce sourceValue visibility value based on logic.
This commit is contained in:
Kristian Ntavidi 2021-10-06 16:32:06 +03:00
parent cb1d7b5340
commit 74ec2126f0
1 changed files with 4 additions and 3 deletions

View File

@ -69,12 +69,13 @@ export class VisibilityRulesService {
} else {
const visibilityDependencySource = visibilityRule.sourceVisibilityRules.filter(x => x.sourceControlId === sourceId);
visibilityDependencySource.forEach(x => {
const shouldBeVisible = visibilityDependencySource.reduce((isVisible, x) => {
const shouldBeHidden = value !== null && (this.parseValue(value) !== this.parseValue(x.sourceControlValue));
return this.VISIBILITY_RULE_LOGIC === 'OR'? (isVisible || !shouldBeHidden) : (isVisible && !shouldBeHidden);
// if(value !== null && )
visibilityMap.set(sourceId, !shouldBeHidden);
});
}, this.VISIBILITY_RULE_LOGIC === 'AND');
visibilityMap.set(sourceId, shouldBeVisible);
}