mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Fix 'upload' code style issues (tslint)
This commit is contained in:
@@ -15,10 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { UploadService } from '../services/upload.service';
|
||||
import { AlfrescoSettingsService } from 'ng2-alfresco-core';
|
||||
import { Observable } from 'rxjs/Observable';
|
||||
import { Observer } from 'rxjs/Observer';
|
||||
import { FileModel } from '../models/file.model';
|
||||
|
||||
export class UploadServiceMock {
|
||||
@@ -52,7 +49,7 @@ export class UploadServiceMock {
|
||||
userId: 'fake-username',
|
||||
id: 'fake-post-token'
|
||||
}
|
||||
})
|
||||
});
|
||||
});
|
||||
} else {
|
||||
promise = new Promise(function (resolve, reject) {
|
||||
|
@@ -43,7 +43,7 @@ declare let __moduleName: string;
|
||||
host: {'[class.dialog-show]': 'toggleShowDialog'},
|
||||
pipes: [AlfrescoPipeTranslate]
|
||||
})
|
||||
export class FileUploadingDialogComponent implements OnInit{
|
||||
export class FileUploadingDialogComponent implements OnInit {
|
||||
|
||||
isDialogActive: boolean = false;
|
||||
|
||||
@@ -60,7 +60,7 @@ export class FileUploadingDialogComponent implements OnInit{
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
if(this._uploaderService.filesUpload$) {
|
||||
if (this._uploaderService.filesUpload$) {
|
||||
this._uploaderService.filesUpload$.subscribe((fileList: FileModel[]) => {
|
||||
this.filesUploadingList = fileList;
|
||||
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.totalCompleted = total;
|
||||
this.cd.detectChanges();
|
||||
|
@@ -64,7 +64,7 @@ export class FileUploadingListComponent {
|
||||
* Call the abort method for each file
|
||||
*/
|
||||
cancelAllFiles($event) {
|
||||
if($event) {
|
||||
if ($event) {
|
||||
$event.preventDefault();
|
||||
}
|
||||
this.filesUploadingList.forEach((uploadingFileModel: FileModel) => {
|
||||
|
@@ -224,7 +224,7 @@ export class UploadButtonComponent {
|
||||
messageTranslate = this.translate.get('FILE_UPLOAD.MESSAGES.PROGRESS');
|
||||
actionTranslate = this.translate.get('FILE_UPLOAD.ACTION.UNDO');
|
||||
|
||||
if(this.undoNotificationBar.nativeElement.MaterialSnackbar) {
|
||||
if (this.undoNotificationBar.nativeElement.MaterialSnackbar) {
|
||||
this.undoNotificationBar.nativeElement.MaterialSnackbar.showSnackbar({
|
||||
message: messageTranslate.value,
|
||||
timeout: 3000,
|
||||
@@ -244,7 +244,7 @@ export class UploadButtonComponent {
|
||||
* @returns {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;
|
||||
errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
|
||||
return errorMessage.value;
|
||||
|
@@ -226,7 +226,7 @@ export class UploadDragAreaComponent {
|
||||
* @returns {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;
|
||||
errorMessage = this.translate.get('FILE_UPLOAD.MESSAGES.FOLDER_ALREADY_EXIST');
|
||||
return errorMessage.value;
|
||||
|
Reference in New Issue
Block a user