Commit 2374f975 by Tuukka Kivilahti

lintter

1 parent dceaf3c3
Pipeline #57 failed
in 0 seconds
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule, PreloadAllModules } from '@angular/router'; import { Routes, RouterModule, PreloadAllModules } from '@angular/router';
import { LoginComponent } from './modules/login/login.component'; import { LoginComponent } from './modules/login/login.component';
import {FrontpageComponent} from "./components/frontpage/frontpage.component"; import {FrontpageComponent} from './components/frontpage/frontpage.component';
import {ViplistModule} from "./modules/viplist/viplist.module"; import {ViplistModule} from './modules/viplist/viplist.module';
import {InfoViplistPageComponent} from "./modules/viplist/info/info-viplist-page.component"; import {InfoViplistPageComponent} from './modules/viplist/info/info-viplist-page.component';
const APP_ROUTES: Routes = [ const APP_ROUTES: Routes = [
{ path: 'login', component: LoginComponent }, { path: 'login', component: LoginComponent },
......
...@@ -13,9 +13,9 @@ import { MoyaLocaleComponent } from './components/moya-locale/moya-locale.compon ...@@ -13,9 +13,9 @@ import { MoyaLocaleComponent } from './components/moya-locale/moya-locale.compon
import { TopMenuComponent } from './menu/top-menu/top-menu.component'; import { TopMenuComponent } from './menu/top-menu/top-menu.component';
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import {ViplistModule} from "./modules/viplist/viplist.module"; import {ViplistModule} from './modules/viplist/viplist.module';
import {LoginModule} from "./modules/login/login.module"; import {LoginModule} from './modules/login/login.module';
import {LeftMenuModule} from "./menu/left-menu/left-menu.module"; import {LeftMenuModule} from './menu/left-menu/left-menu.module';
import { FrontpageComponent } from './components/frontpage/frontpage.component'; import { FrontpageComponent } from './components/frontpage/frontpage.component';
@NgModule({ @NgModule({
......
...@@ -4,7 +4,7 @@ import {MoyaLocale} from './moya-locale.model'; ...@@ -4,7 +4,7 @@ import {MoyaLocale} from './moya-locale.model';
import {MOYA_BASE_URL} from '../../shared/tools/moya-rest.tool'; import {MOYA_BASE_URL} from '../../shared/tools/moya-rest.tool';
import {HttpClient} from '@angular/common/http'; import {HttpClient} from '@angular/common/http';
import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/catch';
import {TranslateService} from "@ngx-translate/core"; import {TranslateService} from '@ngx-translate/core';
export const ENGLISH = 'en'; export const ENGLISH = 'en';
...@@ -21,7 +21,7 @@ const LOCALSTORAGE_NAME = 'currently used locale code'; ...@@ -21,7 +21,7 @@ const LOCALSTORAGE_NAME = 'currently used locale code';
@Injectable() @Injectable()
export class MoyaLocaleService { export class MoyaLocaleService {
selectedLocale : string; selectedLocale: string;
constructor(private http: HttpClient, private translate: TranslateService) { constructor(private http: HttpClient, private translate: TranslateService) {
...@@ -67,7 +67,7 @@ export class MoyaLocaleService { ...@@ -67,7 +67,7 @@ export class MoyaLocaleService {
public getUserLocale(): Observable<string> { public getUserLocale(): Observable<string> {
// If there is already locale, don't bother of running this rest stuff again // If there is already locale, don't bother of running this rest stuff again
if(this.selectedLocale) { if (this.selectedLocale) {
return new Observable<string>(x => x.next(this.selectedLocale)); return new Observable<string>(x => x.next(this.selectedLocale));
} }
......
import {MenuGroup} from '../models/menu-group.model'; import {MenuGroup} from '../models/menu-group.model';
import {OldMoyaComponent} from "../../modules/old-moya/old-moya.component"; import {OldMoyaComponent} from '../../modules/old-moya/old-moya.component';
/** /**
* Created by tuukka on 13/05/17. * Created by tuukka on 13/05/17.
*/ */
......
import {Component, OnInit} from '@angular/core'; import {Component, OnInit} from '@angular/core';
import {MenuGroup} from '../models/menu-group.model'; import {MenuGroup} from '../models/menu-group.model';
import {MENU} from "../defines/menu"; import {MENU} from '../defines/menu';
import {ActivatedRoute, Router, RouterEvent, UrlSegment} from "@angular/router"; import {ActivatedRoute, Router, RouterEvent, UrlSegment} from '@angular/router';
@Component({ @Component({
selector: 'left-menu', selector: 'left-menu',
...@@ -14,12 +14,12 @@ export class LeftMenuComponent implements OnInit { ...@@ -14,12 +14,12 @@ export class LeftMenuComponent implements OnInit {
styleClass: string; styleClass: string;
searchPath(path : string, menu : MenuGroup[]): boolean { searchPath(path: string, menu: MenuGroup[]): boolean {
for(let i in menu) { for (const i in menu) {
for(let n in menu[i].items) { for (const n in menu[i].items) {
let item = menu[i].items[n]; const item = menu[i].items[n];
if(path.startsWith(item.path)) { if (path.startsWith(item.path)) {
return true; return true;
} }
} }
...@@ -37,17 +37,17 @@ export class LeftMenuComponent implements OnInit { ...@@ -37,17 +37,17 @@ export class LeftMenuComponent implements OnInit {
const revent = event as RouterEvent; const revent = event as RouterEvent;
if(this.searchPath(revent.url, MENU.USER)) { if (this.searchPath(revent.url, MENU.USER)) {
this.activateUser(); this.activateUser();
return; return;
} }
if(this.searchPath(revent.url, MENU.INFO)) { if (this.searchPath(revent.url, MENU.INFO)) {
this.activateInfo(); this.activateInfo();
return; return;
} }
if(this.searchPath(revent.url, MENU.ADMIN)) { if (this.searchPath(revent.url, MENU.ADMIN)) {
this.activateAdmin(); this.activateAdmin();
return; return;
} }
...@@ -65,18 +65,18 @@ export class LeftMenuComponent implements OnInit { ...@@ -65,18 +65,18 @@ export class LeftMenuComponent implements OnInit {
activateInfo() { activateInfo() {
this.menu = MENU.INFO; this.menu = MENU.INFO;
this.styleClass = "infoMenu"; this.styleClass = 'infoMenu';
} }
activateUser() { activateUser() {
this.menu = MENU.USER; this.menu = MENU.USER;
this.styleClass = "userMenu"; this.styleClass = 'userMenu';
} }
activateAdmin() { activateAdmin() {
this.menu = MENU.ADMIN; this.menu = MENU.ADMIN;
this.styleClass = "adminMenu"; this.styleClass = 'adminMenu';
} }
} }
import { LoginRoutingModule } from './login-routing.module'; import { LoginRoutingModule } from './login-routing.module';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import {LoginComponent} from "./login.component"; import {LoginComponent} from './login.component';
@NgModule({ @NgModule({
imports: [ imports: [
......
...@@ -2,7 +2,7 @@ import { PipesModule } from '../../shared/pipes/pipes.module'; ...@@ -2,7 +2,7 @@ import { PipesModule } from '../../shared/pipes/pipes.module';
import { OldMoyaComponent } from './old-moya.component'; import { OldMoyaComponent } from './old-moya.component';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import {OldMoyaRoutingModule} from "./old-moya-routing.module"; import {OldMoyaRoutingModule} from './old-moya-routing.module';
@NgModule({ @NgModule({
imports: [ imports: [
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router'; import { Routes, RouterModule } from '@angular/router';
import {InfoViplistPageComponent} from "./info/info-viplist-page.component"; import {InfoViplistPageComponent} from './info/info-viplist-page.component';
const routes: Routes = [ const routes: Routes = [
{ path: '', component: InfoViplistPageComponent } { path: '', component: InfoViplistPageComponent }
......
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common'; import { CommonModule } from '@angular/common';
import {MatTableModule} from "@angular/material"; import {MatTableModule} from '@angular/material';
import {InfoViplistPageComponent} from "./info/info-viplist-page.component"; import {InfoViplistPageComponent} from './info/info-viplist-page.component';
import {ViplistRoutingModule} from "./viplist-routing.module"; import {ViplistRoutingModule} from './viplist-routing.module';
import {TranslateModule} from "@ngx-translate/core"; import {TranslateModule} from '@ngx-translate/core';
@NgModule({ @NgModule({
imports: [ imports: [
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!