mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	Handler for bulk set tags (awaiting API endpoint)
This commit is contained in:
		
							parent
							
								
									400da7bbc5
								
							
						
					
					
						commit
						d91fa99e77
					
				@ -174,9 +174,21 @@ export class DocumentListComponent implements OnInit {
 | 
				
			|||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  bulkSetTags(tags) {
 | 
					  bulkSetTags(tags: PaperlessTag[]) {
 | 
				
			||||||
    console.log('bulkSetTags', tags);
 | 
					    let modal = this.modalService.open(ConfirmDialogComponent, {backdrop: 'static'})
 | 
				
			||||||
    // TODO:
 | 
					    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() {
 | 
					  bulkAddTag() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user