From 9089ed69c09d8437f37befb29a972066d247de41 Mon Sep 17 00:00:00 2001 From: Jonas Winkler Date: Tue, 27 Oct 2020 17:33:57 +0100 Subject: [PATCH] fix delete dialogs --- .../correspondent-list/correspondent-list.component.ts | 3 +++ .../document-type-list/document-type-list.component.ts | 3 +++ .../manage/generic-list/generic-list.component.ts | 6 +++++- .../app/components/manage/tag-list/tag-list.component.ts | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts index c33089443..f867a10e3 100644 --- a/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts +++ b/src-ui/src/app/components/manage/correspondent-list/correspondent-list.component.ts @@ -17,4 +17,7 @@ export class CorrespondentListComponent extends GenericListComponent implements On }) } + getObjectName(object: T) { + return object.toString() + } + openDeleteDialog(object: T) { var activeModal = this.modalService.open(DeleteDialogComponent, {backdrop: 'static'}) - activeModal.componentInstance.message = `Do you really want to delete ${object}?` + activeModal.componentInstance.message = `Do you really want to delete ${this.getObjectName(object)}?` activeModal.componentInstance.message2 = "Associated documents will not be deleted." activeModal.componentInstance.deleteClicked.subscribe(() => { this.service.delete(object).subscribe(_ => { diff --git a/src-ui/src/app/components/manage/tag-list/tag-list.component.ts b/src-ui/src/app/components/manage/tag-list/tag-list.component.ts index f92bb0382..2b8f916b9 100644 --- a/src-ui/src/app/components/manage/tag-list/tag-list.component.ts +++ b/src-ui/src/app/components/manage/tag-list/tag-list.component.ts @@ -20,4 +20,8 @@ export class TagListComponent extends GenericListComponent { getColor(id) { return PaperlessTag.COLOURS.find(c => c.id == id) } + + getObjectName(object: PaperlessTag) { + return `tag '${object.name}'` + } }