Fix 'upload' code style issues (tslint)

This commit is contained in:
Denys Vuika
2016-06-16 13:37:23 +01:00
parent 326e25d99e
commit 7f93baf59c
5 changed files with 8 additions and 11 deletions

View File

@@ -15,10 +15,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { UploadService } from '../services/upload.service';
import { AlfrescoSettingsService } from 'ng2-alfresco-core';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { FileModel } from '../models/file.model'; import { FileModel } from '../models/file.model';
export class UploadServiceMock { export class UploadServiceMock {
@@ -52,7 +49,7 @@ export class UploadServiceMock {
userId: 'fake-username', userId: 'fake-username',
id: 'fake-post-token' id: 'fake-post-token'
} }
}) });
}); });
} else { } else {
promise = new Promise(function (resolve, reject) { promise = new Promise(function (resolve, reject) {

View File

@@ -43,7 +43,7 @@ declare let __moduleName: string;
host: {'[class.dialog-show]': 'toggleShowDialog'}, host: {'[class.dialog-show]': 'toggleShowDialog'},
pipes: [AlfrescoPipeTranslate] pipes: [AlfrescoPipeTranslate]
}) })
export class FileUploadingDialogComponent implements OnInit{ export class FileUploadingDialogComponent implements OnInit {
isDialogActive: boolean = false; isDialogActive: boolean = false;
@@ -60,7 +60,7 @@ export class FileUploadingDialogComponent implements OnInit{
} }
ngOnInit() { ngOnInit() {
if(this._uploaderService.filesUpload$) { if (this._uploaderService.filesUpload$) {
this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => { this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => {
this.filesUploadingList = fileList; this.filesUploadingList = fileList;
if (this.filesUploadingList.length > 0) { if (this.filesUploadingList.length > 0) {
@@ -69,7 +69,7 @@ export class FileUploadingDialogComponent implements OnInit{
} }
}); });
} }
if(this._uploaderService.totalCompleted$) { if (this._uploaderService.totalCompleted$) {
this._uploaderService.totalCompleted$.subscribe((total: number) => { this._uploaderService.totalCompleted$.subscribe((total: number) => {
this.totalCompleted = total; this.totalCompleted = total;
this.cd.detectChanges(); this.cd.detectChanges();

View File

@@ -64,7 +64,7 @@ export class FileUploadingListComponent {
* Call the abort method for each file * Call the abort method for each file
*/ */
cancelAllFiles($event) { cancelAllFiles($event) {
if($event) { if ($event) {
$event.preventDefault(); $event.preventDefault();
} }
this.filesUploadingList.forEach((uploadingFileModel: FileModel) => { this.filesUploadingList.forEach((uploadingFileModel: FileModel) => {

View File

@@ -224,7 +224,7 @@ export class UploadButtonComponent {
messageTranslate = this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS'); messageTranslate = this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS');
actionTranslate = this.translate.get('FILE_UPLOAD.ACTION.UNDO'); actionTranslate = this.translate.get('FILE_UPLOAD.ACTION.UNDO');
if(this.undoNotificationBar.nativeElement.MaterialSnackbar) { if (this.undoNotificationBar.nativeElement.MaterialSnackbar) {
this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({ this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({
message: messageTranslate.value, message: messageTranslate.value,
timeout: 3000, timeout: 3000,
@@ -244,7 +244,7 @@ export class UploadButtonComponent {
* @returns {string} * @returns {string}
*/ */
private getErrorMessage(response: any): string { private getErrorMessage(response: any): string {
if(response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) { if (response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) {
let errorMessage: any; let errorMessage: any;
errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST'); errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
return errorMessage.value; return errorMessage.value;

View File

@@ -226,7 +226,7 @@ export class UploadDragAreaComponent {
* @returns {string} * @returns {string}
*/ */
private getErrorMessage(response: any): string { private getErrorMessage(response: any): string {
if(response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) { if (response.body.error.statusCode === ERROR_FOLDER_ALREADY_EXIST ) {
let errorMessage: any; let errorMessage: any;
errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST'); errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
return errorMessage.value; return errorMessage.value;