#105 Refactoring file dialog component

This commit is contained in:
mauriziovitale84
2016-06-02 09:43:34 +01:00
parent 8f1659fca1
commit 58ceebe53a
9 changed files with 31 additions and 73 deletions

View File

@@ -19,7 +19,6 @@
import { Component, ViewChild, ElementRef, Input, Output, EventEmitter } from 'angular2/core';
import { UploadService } from '../services/upload.service';
import { FileModel } from '../models/file.model';
import { FileUploadingDialogComponent } from './file-uploading-dialog.component';
import { AlfrescoTranslationService, AlfrescoPipeTranslate } from 'ng2-alfresco-core/dist/ng2-alfresco-core';
import 'rxjs/Rx';
@@ -50,7 +49,6 @@ declare let __moduleName: string;
@Component({
selector: 'alfresco-upload-button',
moduleId: __moduleName,
directives: [FileUploadingDialogComponent],
templateUrl: './upload-button.component.html',
styleUrls: ['./upload-button.component.css'],
pipes: [AlfrescoPipeTranslate]
@@ -60,9 +58,6 @@ export class UploadButtonComponent {
@ViewChild('undoNotificationBar')
undoNotificationBar: any;
@ViewChild('fileUploadingDialog')
fileUploadingDialogComponent: FileUploadingDialogComponent;
@Input()
showUploadDialog: boolean = true;
@@ -87,8 +82,6 @@ export class UploadButtonComponent {
@Output()
onSuccess = new EventEmitter();
filesUploadingList: FileModel [] = [];
translate: AlfrescoTranslationService;
@@ -157,10 +150,6 @@ export class UploadButtonComponent {
if (files.length) {
let latestFilesAdded = this._uploaderService.addToQueue(files);
this._uploaderService.uploadFilesInTheQueue(path, this.onSuccess);
this.filesUploadingList = this._uploaderService.getQueue();
if (this.showUploadDialog) {
this._showDialog();
}
if (this.showUdoNotificationBar) {
this._showUndoNotificationBar(latestFilesAdded);
}
@@ -239,13 +228,6 @@ export class UploadButtonComponent {
});
}
/**
* Show the upload dialog.
*/
private _showDialog(): void {
this.fileUploadingDialogComponent.showDialog();
}
/**
* Return the site from the path
* @returns {any}