Skip to content
Snippets Groups Projects
Commit cd79016c authored by jojohoch's avatar jojohoch
Browse files

Use new operators for visibility in rule editor & visibility handling

parent d120a886
No related branches found
No related tags found
No related merge requests found
Pipeline #48570 failed
......@@ -16,7 +16,7 @@
(ngModelChange)="visibilityRuleChange.emit(visibilityRule)">
<mat-option *ngFor="let operator of VisibilityRuleOperators"
[value]="operator">
{{operator.length > 2 ? ('visibilityRule.' + operator | translate) : operator}}
{{operator.length > 1 ? ('visibilityRule.' + operator | translate) : operator}}
</mat-option>
</mat-select>
</mat-form-field>
......
......@@ -111,15 +111,15 @@ export class SectionVisibilityHandlingDirective implements OnInit, OnDestroy {
switch (rule.operator) {
case '=':
return this.unitStateService.getElementCodeById(rule.id)?.value?.toString() === rule.value;
case '!=':
case '':
return this.unitStateService.getElementCodeById(rule.id)?.value?.toString() !== rule.value;
case '>':
return Number(this.unitStateService.getElementCodeById(rule.id)?.value) > Number(rule.value);
case '<':
return Number(this.unitStateService.getElementCodeById(rule.id)?.value) < Number(rule.value);
case '>=':
case '':
return Number(this.unitStateService.getElementCodeById(rule.id)?.value) >= Number(rule.value);
case '<=':
case '':
return Number(this.unitStateService.getElementCodeById(rule.id)?.value) <= Number(rule.value);
case 'contains':
return this.unitStateService.getElementCodeById(rule.id)?.value?.toString().includes(rule.value);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment