This commit is contained in:
jonaswinkler
2021-01-01 23:08:49 +01:00
parent c4367818b7
commit 6d554bace1
4 changed files with 108 additions and 18 deletions

View File

@@ -25,13 +25,26 @@ export class FilterEditorComponent implements OnInit, OnDestroy {
switch(this.filterRules[0].rule_type) {
case FILTER_CORRESPONDENT:
return $localize`Correspondent: ${this.correspondents.find(c => c.id == +rule.value)?.name}`
if (rule.value) {
return $localize`Correspondent: ${this.correspondents.find(c => c.id == +rule.value)?.name}`
} else {
return $localize`Without correspondent`
}
case FILTER_DOCUMENT_TYPE:
return $localize`Type: ${this.documentTypes.find(dt => dt.id == +rule.value)?.name}`
if (rule.value) {
return $localize`Type: ${this.documentTypes.find(dt => dt.id == +rule.value)?.name}`
} else {
return $localize`Without document type`
}
case FILTER_HAS_TAG:
return $localize`Tag: ${this.tags.find(t => t.id == +rule.value)?.name}`
case FILTER_HAS_ANY_TAG:
if (rule.value == "false") {
return $localize`Without any tag`
}
}
}