diff --git a/.gitignore b/.gitignore index 54bfd20..8f746f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # See http://help.github.com/ignore-files/ for more about ignoring files. # compiled output +/semantic /dist /tmp /out-tsc diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 16d8349..3fa81f4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -3,29 +3,42 @@ import {Subscription} from "rxjs/Subscription"; import {TimerObservable} from "rxjs/observable/TimerObservable"; import {KanbanService} from "./kanban/shared/kanban.service"; +import {Router} from "@angular/router"; + +const TIMER_JIRA_REFRESH = 60000; +const TIMER_PAGE_SWITCH = 300000; -const RENEW_TIMER_INITIAL = 300000; -const RENEW_TIMER_PERIOD = 300000; @Component({ - selector: 'app-root', - templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] }) -export class AppComponent implements OnInit, OnDestroy{ - title = 'app'; - authRenewTimer: Subscription; +export class AppComponent implements OnInit, OnDestroy { - constructor( private kanbanService: KanbanService ) {} + reloadJiraIssueTimer: Subscription; + pageSwitchTimer: Subscription; - public ngOnInit() { - let timer = TimerObservable.create(RENEW_TIMER_INITIAL, RENEW_TIMER_PERIOD); - this.authRenewTimer = timer.subscribe(() => { - this.kanbanService.reload(); - }); - } + constructor( + private kanbanService: KanbanService, + private router: Router + ) {} - public ngOnDestroy() { - this.authRenewTimer.unsubscribe(); - } + public ngOnInit() { + let timer1 = TimerObservable.create(TIMER_JIRA_REFRESH, TIMER_JIRA_REFRESH); + this.reloadJiraIssueTimer = timer1.subscribe(() => { + this.kanbanService.reload(); + }); + let timer2 = TimerObservable.create(TIMER_PAGE_SWITCH, TIMER_PAGE_SWITCH); + this.pageSwitchTimer = timer2.subscribe(() => { + // navigate to next page + // this.router.navigate(); + console.log("pageSwitch"); + }); + } + + public ngOnDestroy() { + this.reloadJiraIssueTimer.unsubscribe(); + this.pageSwitchTimer.unsubscribe(); + } } diff --git a/src/app/kanban/kanban-board/kanban-board.component.html b/src/app/kanban/kanban-board/kanban-board.component.html index 8e4a084..d0d8679 100644 --- a/src/app/kanban/kanban-board/kanban-board.component.html +++ b/src/app/kanban/kanban-board/kanban-board.component.html @@ -1,12 +1,12 @@