RED-3978: Disable file upload by drag & drop in archived dossier

This commit is contained in:
Adina Țeudan 2022-05-11 18:56:23 +03:00
parent 3b8aaf3dab
commit 00f14b15b8

View File

@ -135,12 +135,8 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
async ngOnInit(): Promise<void> {
this._computeAllFilters();
this._setRemovableSubscriptions();
if (this.#currentDossier.isActive) {
this._fileDropOverlayService.initFileDropHandling(this.dossierId);
}
this.#initFileDropHandling();
this.addSubscription = this._dossierTemplatesService
.getEntityChanged$(this.dossierTemplateId)
@ -162,14 +158,16 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
}
ngOnAttach() {
this._fileDropOverlayService.initFileDropHandling(this.dossierId);
this.#initFileDropHandling();
this._setRemovableSubscriptions();
this._tableComponent?.scrollToLastIndex();
}
@HostListener('drop', ['$event'])
onDrop(event: DragEvent): void {
handleFileDrop(event, this.#currentDossier, this._uploadFiles.bind(this));
if (this.permissionsService.canUploadFiles(this.#currentDossier)) {
handleFileDrop(event, this.#currentDossier, this._uploadFiles.bind(this));
}
}
@HostListener('dragover', ['$event'])
@ -183,6 +181,12 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
(this._fileInput as any).nativeElement.value = null;
}
#initFileDropHandling(): void {
if (this.permissionsService.canUploadFiles(this.#currentDossier)) {
this._fileDropOverlayService.initFileDropHandling(this.dossierId);
}
}
private _setRemovableSubscriptions(): void {
this.addActiveScreenSubscription = this._dossiersService
.getEntityDeleted$(this.dossierId)