Skip to content

A community-supported supercharged document management system: scan, index and archive all your documents

Handler for bulk set tags (awaiting API endpoint)

Michael Shamoond91fa99e7793
diff --git a/src-ui/src/app/components/document-list/document-list.component.ts b/src-ui/src/app/components/document-list/document-list.component.ts
index a08cb1fad..3bdbc3eb8 100644
--- a/src-ui/src/app/components/document-list/document-list.component.ts
+++ b/src-ui/src/app/components/document-list/document-list.component.ts
@@ -174,9 +174,21 @@ export class DocumentListComponent implements OnInit {
})
}
- bulkSetTags(tags) {
- console.log('bulkSetTags', tags);
- // TODO:
+ bulkSetTags(tags: PaperlessTag[]) {
+ let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'})
+ modal.componentInstance.title = "Confirm Tags assignment"
+ let messageFragment = tags ? `assign the tag(s) ${tags.map(t => t.name).join(', ')} to` : `remove all tags from`
+ modal.componentInstance.message = `This operation will ${messageFragment} all ${this.list.selected.size} selected document(s).`
+ modal.componentInstance.btnClass = "btn-warning"
+ modal.componentInstance.btnCaption = "Confirm"
+ modal.componentInstance.confirmClicked.subscribe(() => {
+ // TODO: API endpoint for set multiple tags
+ this.executeBulkOperation('set_tags', {"document_type": tags ? tags.map(t => t.id) : null}).subscribe(
+ response => {
+ modal.close()
+ }
+ )
+ })
}
bulkAddTag() {