[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:
Vito
2017-08-31 10:16:09 -07:00
committed by Mario Romano
parent e0ffeb0ea5
commit 42ed604349
28 changed files with 93 additions and 35 deletions

View File

@@ -201,6 +201,7 @@ Provides access to various APIs related to file upload features.
| fileUploadError | FileUploadEvent | Raised when an error occurs to file upload. |
| fileUploadComplete | FileUploadCompleteEvent | Raised when file upload is complete. |
| fileUploadDelete | FileUploadDeleteEvent | Raised when uploaded file is removed from server. |
| fileDeleted | string | This can be invoked when a file is deleted from an external source to upload the file dialog status. |
### Details

View File

@@ -50,7 +50,7 @@
"@angular/core": "4.2.5",
"@angular/forms": "4.2.5",
"@angular/http": "4.2.5",
"@angular/material": "^2.0.0-beta.8",
"@angular/material": "2.0.0-beta.8",
"@angular/platform-browser": "4.2.5",
"@angular/platform-browser-dynamic": "4.2.5",
"@angular/router": "4.2.5",

View File

@@ -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();
}
}
});
}
/**