From 39a8029a384b173a3aa88ae42baa2d8252baa357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20K=C3=A4sler?= <tom.kaesler@mni.thm.de> Date: Wed, 6 Mar 2019 15:27:50 +0100 Subject: [PATCH] fix lint errors --- .../content-creator/content-creator.component.ts | 2 +- .../user-activation/user-activation.component.ts | 6 +++--- .../components/home/home-page/home-page.component.ts | 2 +- .../content-choice-participant.component.ts | 2 +- src/app/components/shared/header/header.component.ts | 2 +- .../shared/room-join/room-join.component.ts | 5 ++--- src/app/interceptors/authentication.interceptor.ts | 12 +++++++++--- src/app/services/http/authentication.service.ts | 7 +++---- src/app/services/http/room.service.ts | 2 +- 9 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/app/components/creator/content-creator/content-creator.component.ts b/src/app/components/creator/content-creator/content-creator.component.ts index c714e60b9..c3915f07b 100644 --- a/src/app/components/creator/content-creator/content-creator.component.ts +++ b/src/app/components/creator/content-creator/content-creator.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; import { ContentText } from '../../../models/content-text'; -import { FormControl } from '@angular/forms';; +import { FormControl } from '@angular/forms'; import { Room } from '../../../models/room'; import { TranslateService } from '@ngx-translate/core'; diff --git a/src/app/components/home/_dialogs/user-activation/user-activation.component.ts b/src/app/components/home/_dialogs/user-activation/user-activation.component.ts index f0f71df0d..74629868e 100644 --- a/src/app/components/home/_dialogs/user-activation/user-activation.component.ts +++ b/src/app/components/home/_dialogs/user-activation/user-activation.component.ts @@ -1,8 +1,8 @@ import { Component, Inject, OnInit } from '@angular/core'; import { NotificationService } from '../../../../services/util/notification.service'; import { UserService } from '../../../../services/http/user.service'; -import { FormControl, Validators} from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef} from '@angular/material'; +import { FormControl, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; import { TranslateService } from '@ngx-translate/core'; @Component({ @@ -31,7 +31,7 @@ export class UserActivationComponent implements OnInit { this.userService.activate(this.data.name.trim(), activationKey).subscribe( ret => { - this.dialogRef.close({success: true}); + this.dialogRef.close({ success: true }); }, err => { this.translationService.get('login.activation-key-incorrect').subscribe(message => { diff --git a/src/app/components/home/home-page/home-page.component.ts b/src/app/components/home/home-page/home-page.component.ts index b630f9533..eec655fa3 100644 --- a/src/app/components/home/home-page/home-page.component.ts +++ b/src/app/components/home/home-page/home-page.component.ts @@ -7,7 +7,7 @@ import { Component, OnInit } from '@angular/core'; }) export class HomePageComponent implements OnInit { - mobile: boolean = true; + mobile = true; constructor() { } diff --git a/src/app/components/participant/content-choice-participant/content-choice-participant.component.ts b/src/app/components/participant/content-choice-participant/content-choice-participant.component.ts index 8d9a8635d..e780f3015 100644 --- a/src/app/components/participant/content-choice-participant/content-choice-participant.component.ts +++ b/src/app/components/participant/content-choice-participant/content-choice-participant.component.ts @@ -52,7 +52,7 @@ export class ContentChoiceParticipantComponent implements OnInit { } submitAnswer(): void { - let selectedAnswers: number[] = []; + const selectedAnswers: number[] = []; if (this.content.multiple) { for (let i = 0; i < this.checkedAnswers.length; i++) { if (this.checkedAnswers[i].checked) { diff --git a/src/app/components/shared/header/header.component.ts b/src/app/components/shared/header/header.component.ts index c5d28a7f1..c57ae654c 100644 --- a/src/app/components/shared/header/header.component.ts +++ b/src/app/components/shared/header/header.component.ts @@ -78,7 +78,7 @@ export class HeaderComponent implements OnInit { const dialogRef = this.dialog.open(LoginComponent, { width: '350px' }); - let role = (isDozent === true) ? UserRole.CREATOR : UserRole.PARTICIPANT; + const role = (isDozent === true) ? UserRole.CREATOR : UserRole.PARTICIPANT; dialogRef.componentInstance.role = role; dialogRef.componentInstance.isStandard = true; } diff --git a/src/app/components/shared/room-join/room-join.component.ts b/src/app/components/shared/room-join/room-join.component.ts index 3e81020ea..07ca5cd82 100644 --- a/src/app/components/shared/room-join/room-join.component.ts +++ b/src/app/components/shared/room-join/room-join.component.ts @@ -46,7 +46,7 @@ export class RoomJoinComponent implements OnInit { } getRoom(id: string): void { - if (id.length - (id.split(' ').length -1) < 8) { + if (id.length - (id.split(' ').length - 1) < 8) { this.translateService.get('home-page.exactly-8').subscribe(message => { this.notificationService.show(message); }); @@ -55,7 +55,7 @@ export class RoomJoinComponent implements OnInit { this.notificationService.show(message); }); } else { - this.roomService.getRoomByShortId(id.replace(/\s/g, "")) + this.roomService.getRoomByShortId(id.replace(/\s/g, '')) .subscribe(room => { this.room = room; if (!room) { @@ -75,7 +75,6 @@ export class RoomJoinComponent implements OnInit { } }); } - } joinRoom(id: string): void { diff --git a/src/app/interceptors/authentication.interceptor.ts b/src/app/interceptors/authentication.interceptor.ts index 4939c7f4e..8fddfefae 100644 --- a/src/app/interceptors/authentication.interceptor.ts +++ b/src/app/interceptors/authentication.interceptor.ts @@ -1,7 +1,13 @@ - -import {tap} from 'rxjs/operators'; +import { tap } from 'rxjs/operators'; import { Injectable } from '@angular/core'; -import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse } from '@angular/common/http'; +import { + HttpErrorResponse, + HttpEvent, + HttpHandler, + HttpInterceptor, + HttpRequest, + HttpResponse +} from '@angular/common/http'; import { AuthenticationService } from '../services/http/authentication.service'; import { NotificationService } from '../services/util/notification.service'; diff --git a/src/app/services/http/authentication.service.ts b/src/app/services/http/authentication.service.ts index d1ab0b5dc..2ac6be1b6 100644 --- a/src/app/services/http/authentication.service.ts +++ b/src/app/services/http/authentication.service.ts @@ -1,5 +1,4 @@ - -import {catchError, map} from 'rxjs/operators'; +import { catchError, map } from 'rxjs/operators'; import { Injectable } from '@angular/core'; import { User } from '../../models/user'; import { Observable , of , BehaviorSubject } from 'rxjs'; @@ -119,13 +118,13 @@ export class AuthenticationService { } else { return 'false'; } - }),catchError((e) => { + }), catchError((e) => { // check if user needs activation if (e.error.errorType === 'DisabledException') { return of('activation'); } return of('false'); - }),); + }), ); } get watchUser() { diff --git a/src/app/services/http/room.service.ts b/src/app/services/http/room.service.ts index 4566c0590..3ab13d5ae 100644 --- a/src/app/services/http/room.service.ts +++ b/src/app/services/http/room.service.ts @@ -96,7 +96,7 @@ export class RoomService extends BaseHttpService { parseDefaultContentGroup(room: Room): Room { if (room.contentGroups) { - for (let cg of room.contentGroups) { + for (const cg of room.contentGroups) { if (!cg.name || cg.name === '') { cg.name = 'Default'; } -- GitLab