search for multiple tags
This commit is contained in:
Jonas Winkler
2020-11-04 00:01:08 +01:00
parent 883d5aa5b6
commit 965e874740
7 changed files with 66 additions and 25 deletions

View File

@@ -1,8 +1,9 @@
<div *ngFor="let rule of filterRules" class="form-row form-group">
<div class="col">
<select class="form-control form-control-sm" [(ngModel)]="rule.type" (change)="rule.value = null">
<div class="col-md-3 col-form-label">
<!-- <select class="form-control form-control-sm" [(ngModel)]="rule.type" (change)="rule.value = null">
<option *ngFor="let ruleType of getRuleTypes()" [ngValue]="ruleType">{{ruleType.name}}</option>
</select>
</select> -->
<span>{{rule.type.name}}</span>
</div>
<div class="col">
<input *ngIf="rule.type.datatype == 'string'" type="text" class="form-control form-control-sm" [(ngModel)]="rule.value">

View File

@@ -32,6 +32,7 @@ export class FilterEditorComponent implements OnInit {
newRuleClicked() {
this.filterRules.push({type: this.selectedRuleType, value: null})
this.selectedRuleType = this.getRuleTypes().length > 0 ? this.getRuleTypes()[0] : null
}
removeRuleClicked(rule) {
@@ -57,7 +58,7 @@ export class FilterEditorComponent implements OnInit {
}
getRuleTypes() {
return FILTER_RULE_TYPES
return FILTER_RULE_TYPES.filter(rt => rt.multi || !this.filterRules.find(r => r.type == rt))
}
}