mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#105 Refactoring file dialog component
This commit is contained in:
@@ -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}
|
||||
|
Reference in New Issue
Block a user