From d37a6f68c6de7dab379687e324b16e3245809976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Danyi?= Date: Fri, 8 Sep 2017 15:42:27 +0200 Subject: [PATCH] * route name change, there seems to be a bug involving dashes in the route name --- src/app/app-routing.module.ts | 2 +- src/app/app.component.ts | 27 ++++++++++++++------- src/app/app.module.ts | 2 +- src/app/tsp-info/tsp-info-routing.module.ts | 2 +- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 720f182..5f9176d 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -4,7 +4,7 @@ import {Routes, RouterModule} from '@angular/router'; const routes: Routes = [ { path: '', - redirectTo: '/kanban', + redirectTo: '/tspinfopage', pathMatch: 'full', } ]; diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 56be8ad..9701da0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -5,10 +5,12 @@ import {TimerObservable} from "rxjs/observable/TimerObservable"; import {KanbanService} from "./kanban/shared/kanban.service"; import {ActivatedRoute, Router} from "@angular/router"; import {SelfUpdaterService} from "./kanban/shared/self-updater.service"; +import {TspInfoService} from "./tsp-info/shared/tsp-info.service"; const TIMER_DEPLOY_REFRESH = 30000; const TIMER_JIRA_REFRESH = 60000; +const TIMER_TSPINFO_REFRESH = 60000; const TIMER_PAGE_SWITCH_TICK = 1000; /** @@ -16,10 +18,10 @@ const TIMER_PAGE_SWITCH_TICK = 1000; * @type {number} */ const TIMESPENT_KANBAN = 120000; -const TIMESPENT_TSPINFO = 60000; +const TIMESPENT_TSPINFO = 30000; const PAGE_KANBAN = '/kanban'; -const PAGE_TSPINFO = '/tsp-info-page'; +const PAGE_TSPINFO = '/tspinfopage'; @Component({ selector: 'app-root', @@ -32,11 +34,13 @@ export class AppComponent implements OnInit, OnDestroy { private autoSwitchEnabled: boolean = true; private selfUpdateCheckerTimer: Subscription; - private reloadJiraIssueTimer: Subscription; + private reloadKanbanTimer: Subscription; + private reloadTspInfoTimer: Subscription; private pageSwitchTimer: Subscription; constructor(private selfUpdaterService: SelfUpdaterService, private kanbanService: KanbanService, + private tspInfoService: TspInfoService, private router: Router, private activatedRoute: ActivatedRoute) { } @@ -44,7 +48,7 @@ export class AppComponent implements OnInit, OnDestroy { /** * Initialize application timers: * - selfUpdateCheckerTimer is used to see if there is a newer revision deployed on the server - * - reloadJiraIssueTimer is used to refresh the status of the jira board + * - reloadKanbanTimer is used to refresh the status of the jira board * - pageSwitchTimer handles switching back and forth between page views */ public ngOnInit() { @@ -53,22 +57,27 @@ export class AppComponent implements OnInit, OnDestroy { this.selfUpdaterService.checkAndReloadIfNecessary(); }); let timer1 = TimerObservable.create(TIMER_JIRA_REFRESH, TIMER_JIRA_REFRESH); - this.reloadJiraIssueTimer = timer1.subscribe(() => { + this.reloadKanbanTimer = timer1.subscribe(() => { this.kanbanService.reload(); }); + let timer2 = TimerObservable.create(TIMER_TSPINFO_REFRESH, TIMER_TSPINFO_REFRESH); + this.reloadTspInfoTimer = timer2.subscribe(() => { + this.tspInfoService.reload(); + }); this.activatedRoute.queryParamMap.subscribe(params => { if (!params.has("disableAutoSwitch")) { - let timer2 = TimerObservable.create(TIMER_PAGE_SWITCH_TICK, TIMER_PAGE_SWITCH_TICK); - // this.pageSwitchTimer = timer2.subscribe(this.switchSubscriber.bind(this)); + let timer4 = TimerObservable.create(TIMER_PAGE_SWITCH_TICK, TIMER_PAGE_SWITCH_TICK); + this.pageSwitchTimer = timer4.subscribe(this.switchSubscriber.bind(this)); } }); } public ngOnDestroy() { this.selfUpdateCheckerTimer.unsubscribe(); - this.reloadJiraIssueTimer.unsubscribe(); + this.reloadKanbanTimer.unsubscribe(); + this.reloadTspInfoTimer.unsubscribe(); if (this.pageSwitchTimer) { - // this.pageSwitchTimer.unsubscribe(); + this.pageSwitchTimer.unsubscribe(); } } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 5e4f571..658f838 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -14,7 +14,7 @@ import { TspInfoModule } from "./tsp-info/tsp-info.module"; BrowserModule, AppRoutingModule, KanbanModule, - TspInfoModule + TspInfoModule, ], providers: [], bootstrap: [AppComponent] diff --git a/src/app/tsp-info/tsp-info-routing.module.ts b/src/app/tsp-info/tsp-info-routing.module.ts index 9bf1a0b..5681a67 100644 --- a/src/app/tsp-info/tsp-info-routing.module.ts +++ b/src/app/tsp-info/tsp-info-routing.module.ts @@ -5,7 +5,7 @@ import {TspInfoService} from "./shared/tsp-info.service"; const routes: Routes = [ { - path: 'tsp-info-page', + path: 'tspinfopage', children: [], component: InfoPageComponent, resolve: {