When cancelling the edit of a dataset descriptor and start editing another with the same template reset the visibility rules on the template form

This commit is contained in:
George Kalampokis 2020-02-25 16:12:57 +02:00
parent 524b1d68be
commit c2de90183e
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,7 @@ export class VisibilityRulesService {
this.visibilityRuleContext = new VisibilityRulesContext();
this.visibilityRuleContext.buildVisibilityRuleContext(item || []);
this.form = form;
this.resetVisibilityRules();
}
public updateValueAndVisibility(id: string, value: any) {
@ -50,6 +51,11 @@ export class VisibilityRulesService {
//this.updateValueAndVisibility(visibilityRule.targetControlId, null);
}
private resetVisibilityRules() {
this.elementVisibilityMap.clear();
this.elementVisibilityMap = new Map<String, boolean>();
}
parseValue(value: any) {
if (typeof value === 'string') {
if (isNumeric(value)) { return value; }