[ASD-2483] Validate folder name on change (#3088)

* notify service refactoring
get translate eliminitation in favor of instant
add error event where necessary
fix config problem during test

* fix delete notify test

* remove fdescribe

* fix core test

* errors

* fix types
This commit is contained in:
Eugenio Romano
2018-03-21 16:55:52 +00:00
committed by GitHub
parent de0fdd9ab4
commit 2951374cc0
25 changed files with 357 additions and 260 deletions

View File

@@ -15,14 +15,17 @@
* limitations under the License.
*/
import { FileModel, FileUploadCompleteEvent, FileUploadDeleteEvent,
FileUploadErrorEvent, FileUploadStatus, UploadService } from '@alfresco/adf-core';
import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
import {
FileModel, FileUploadCompleteEvent, FileUploadDeleteEvent,
FileUploadErrorEvent, FileUploadStatus, UploadService
} from '@alfresco/adf-core';
import { ChangeDetectorRef, Component, Input, Output, EventEmitter, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription';
import { FileUploadingListComponent } from './file-uploading-list.component';
import 'rxjs/add/observable/merge';
// @deprecated file-uploading-dialog TODO remove in 3.0.0
@Component({
selector: 'adf-file-uploading-dialog, file-uploading-dialog',
templateUrl: './file-uploading-dialog.component.html',
@@ -36,6 +39,10 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
@Input()
position: string = 'right';
/** Emitted when a file in the list has an error. */
@Output()
error: EventEmitter<any> = new EventEmitter();
filesUploadingList: FileModel[] = [];
isDialogActive: boolean = false;
totalCompleted: number = 0;
@@ -48,9 +55,9 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
private fileUploadSubscription: Subscription;
private errorSubscription: Subscription;
constructor(
private uploadService: UploadService,
private changeDetecor: ChangeDetectorRef) {}
constructor(private uploadService: UploadService,
private changeDetecor: ChangeDetectorRef) {
}
ngOnInit() {
this.listSubscription = this.uploadService
@@ -60,14 +67,14 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
if (this.filesUploadingList.length) {
this.isDialogActive = true;
}
});
});
this.counterSubscription = Observable
.merge(
this.uploadService.fileUploadComplete,
this.uploadService.fileUploadDeleted
)
.subscribe((event: (FileUploadDeleteEvent|FileUploadCompleteEvent)) => {
.subscribe((event: (FileUploadDeleteEvent | FileUploadCompleteEvent)) => {
this.totalCompleted = event.totalComplete;
this.changeDetecor.detectChanges();
});