mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	fix delete dialogs
This commit is contained in:
		| @@ -17,4 +17,7 @@ export class CorrespondentListComponent extends GenericListComponent<PaperlessCo | ||||
|       super(correspondentsService,modalService,CorrespondentEditDialogComponent) | ||||
|     } | ||||
|  | ||||
|     getObjectName(object: PaperlessCorrespondent) { | ||||
|       return `correspondent '${object.name}'` | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -16,4 +16,7 @@ export class DocumentTypeListComponent extends GenericListComponent<PaperlessDoc | ||||
|     super(service, modalService, DocumentTypeEditDialogComponent) | ||||
|    } | ||||
|  | ||||
|    getObjectName(object: PaperlessDocumentType) { | ||||
|     return `document type '${object.name}'` | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -47,9 +47,13 @@ export abstract class GenericListComponent<T extends ObjectWithId> 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(_ => { | ||||
|   | ||||
| @@ -20,4 +20,8 @@ export class TagListComponent extends GenericListComponent<PaperlessTag> { | ||||
|   getColor(id) { | ||||
|     return PaperlessTag.COLOURS.find(c => c.id == id) | ||||
|   } | ||||
|  | ||||
|   getObjectName(object: PaperlessTag) { | ||||
|     return `tag '${object.name}'` | ||||
|   } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonas Winkler
					Jonas Winkler