UI for matching api

This commit is contained in:
Jonas Winkler
2020-10-28 18:04:50 +01:00
parent e8ef54d00d
commit 330187b7ab
15 changed files with 111 additions and 59 deletions

View File

@@ -1,5 +1,6 @@
import { Directive, OnInit } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { MatchingModel } from 'src/app/data/matching-model';
import { ObjectWithId } from 'src/app/data/object-with-id';
import { AbstractPaperlessService } from 'src/app/services/rest/abstract-paperless-service';
import { DeleteDialogComponent } from '../../common/delete-dialog/delete-dialog.component';
@@ -19,6 +20,16 @@ export abstract class GenericListComponent<T extends ObjectWithId> implements On
public collectionSize = 0
getMatching(o: MatchingModel) {
if (o.matching_algorithm == MatchingModel.MATCH_AUTO) {
return "Automatic"
} else if (o.match && o.match.length > 0) {
return `${o.match} (${MatchingModel.MATCHING_ALGORITHMS.find(a => a.id == o.matching_algorithm).name})`
} else {
return "-"
}
}
ngOnInit(): void {
this.reloadData()
}