mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-19 17:23:21 +00:00
36 lines
987 B
TypeScript
36 lines
987 B
TypeScript
import {
|
|
Component,
|
|
EventEmitter,
|
|
Input,
|
|
Output,
|
|
inject,
|
|
signal,
|
|
} from '@angular/core'
|
|
import { FormsModule } from '@angular/forms'
|
|
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
|
import { DocumentLinkComponent } from 'src/app/components/common/input/document-link/document-link.component'
|
|
|
|
@Component({
|
|
selector: 'pngx-add-existing-document-version-dialog',
|
|
templateUrl: './add-existing-document-version-dialog.component.html',
|
|
imports: [DocumentLinkComponent, FormsModule],
|
|
})
|
|
export class AddExistingDocumentVersionDialogComponent {
|
|
private readonly activeModal = inject(NgbActiveModal)
|
|
|
|
@Input() rootDocumentID: number
|
|
@Output() confirmClicked = new EventEmitter<number>()
|
|
|
|
selectedDocumentIDs: number[] = []
|
|
readonly buttonsEnabled = signal(true)
|
|
|
|
confirm(): void {
|
|
if (this.selectedDocumentIDs.length !== 1) return
|
|
this.confirmClicked.emit(this.selectedDocumentIDs[0])
|
|
}
|
|
|
|
cancel(): void {
|
|
this.activeModal.dismiss()
|
|
}
|
|
}
|