mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
@@ -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">
|
||||
|
@@ -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))
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user