mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-1368] Delete a document onto document list update even the file upload dialog (#2267)
* [ADF-1368] adding success action event even form file deleted on document actions * [ADF-1368] reflecting delete changes on documentlist * [ADF-1368] added event on upload service when a file is deleted from external source * [ADF-1368] pinned version beta8 for material * [ADF-1368] added test cases for success event on documentlist actions delete
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
|
||||
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { FileModel, FileUploadCompleteEvent, FileUploadDeleteEvent,
|
||||
FileUploadErrorEvent, UploadService } from 'ng2-alfresco-core';
|
||||
FileUploadErrorEvent, FileUploadStatus, UploadService } from 'ng2-alfresco-core';
|
||||
import { Observable, Subscription } from 'rxjs/Rx';
|
||||
import { FileUploadingListComponent } from './file-uploading-list.component';
|
||||
|
||||
@@ -78,6 +78,18 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
.fileUpload.subscribe(() => {
|
||||
this.changeDetecor.detectChanges();
|
||||
});
|
||||
|
||||
this.uploadService.fileDeleted.subscribe((objId) => {
|
||||
if (this.filesUploadingList) {
|
||||
let file = this.filesUploadingList.find((item) => {
|
||||
return item.data.entry.id === objId;
|
||||
});
|
||||
if (file) {
|
||||
file.status = FileUploadStatus.Cancelled;
|
||||
this.changeDetecor.detectChanges();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user