1- import { Component , EventEmitter , OnDestroy , OnInit , Output } from '@angular/core' ;
1+ import {
2+ Component ,
3+ EventEmitter ,
4+ OnDestroy ,
5+ OnInit ,
6+ Output
7+ } from '@angular/core' ;
28import { FilterService } from '../filter/filter.service' ;
39import { MapService } from '../map/map.service' ;
410import { UserService } from '../user/user.service' ;
@@ -16,12 +22,12 @@ export class NavigationComponent implements OnInit, OnDestroy {
1622 @Output ( ) onFeedToggle = new EventEmitter < void > ( ) ;
1723 @Output ( ) onPreferencesToggle = new EventEmitter < void > ( ) ;
1824
19- state = " map"
20- filteredEvent : any = { }
21- filteredTeams : any
22- filteredInterval : any
23- feedChangedUsers = { }
24- isAdmin : boolean = false
25+ state = ' map' ;
26+ filteredEvent : any = { } ;
27+ filteredTeams : any ;
28+ filteredInterval : any ;
29+ feedChangedUsers = { } ;
30+ isAdmin : boolean = false ;
2531
2632 constructor (
2733 private router : Router ,
@@ -30,52 +36,58 @@ export class NavigationComponent implements OnInit, OnDestroy {
3036 private eventService : EventService ,
3137 private filterService : FilterService ,
3238 private pollingService : PollingService
33- ) { }
39+ ) { }
3440
3541 ngOnInit ( ) : void {
3642 this . filterService . addListener ( this ) ;
3743
38- this . eventService . query ( ) . subscribe ( events => {
44+ this . eventService . query ( ) . subscribe ( ( events ) => {
3945 const recentEventId = this . userService . getRecentEventId ( ) ;
40- const recentEvent = _ . find ( events , event => { return event . id === recentEventId ; } ) ;
46+ const recentEvent = _ . find ( events , ( event ) => {
47+ return event . id === recentEventId ;
48+ } ) ;
4149 if ( recentEvent ) {
4250 this . filterService . setFilter ( { event : recentEvent } ) ;
43- this . pollingService . setPollingInterval ( this . pollingService . getPollingInterval ( ) ) ;
51+ this . pollingService . setPollingInterval (
52+ this . pollingService . getPollingInterval ( )
53+ ) ;
4454 } else if ( events . length > 0 ) {
4555 // TODO 'welcome to Mage dialog'
4656 this . filterService . setFilter ( { event : events [ 0 ] } ) ;
47- this . pollingService . setPollingInterval ( this . pollingService . getPollingInterval ( ) ) ;
57+ this . pollingService . setPollingInterval (
58+ this . pollingService . getPollingInterval ( )
59+ ) ;
4860 } else {
4961 // TODO welcome to mage, sorry you have no events
5062 }
5163 } ) ;
5264
53- this . mapService . init ( )
54- this . eventService . init ( )
65+ this . mapService . init ( ) ;
66+ this . eventService . init ( ) ;
5567 this . isAdmin = this . userService . amAdmin ;
5668 }
5769
5870 ngOnDestroy ( ) : void {
59- this . filterService . removeListener ( this )
60- this . filterService . removeFilters ( )
71+ this . filterService . removeListener ( this ) ;
72+ this . filterService . removeFilters ( ) ;
6173
62- this . mapService . destroy ( )
74+ this . mapService . destroy ( ) ;
6375
64- this . eventService . destroy ( )
76+ this . eventService . destroy ( ) ;
6577 }
6678
6779 toggleFeed ( ) : void {
68- this . onFeedToggle . emit ( )
80+ this . onFeedToggle . emit ( ) ;
6981 }
7082
7183 togglePreferences ( ) : void {
72- this . onPreferencesToggle . emit ( )
84+ this . onPreferencesToggle . emit ( ) ;
7385 }
7486
7587 onLogout ( ) {
7688 this . userService . logout ( ) . subscribe ( ( ) => {
7789 this . router . navigate ( [ 'landing' ] ) ;
78- } )
90+ } ) ;
7991 }
8092
8193 onFilterChanged ( filter ) {
@@ -88,7 +100,10 @@ export class NavigationComponent implements OnInit, OnDestroy {
88100 this . mapService . onLocationStop ( ) ;
89101 }
90102
91- if ( filter . teams ) this . filteredTeams = _ . map ( this . filterService . getTeams ( ) , t => { return t . name ; } ) . join ( ', ' ) ;
103+ if ( filter . teams )
104+ this . filteredTeams = _ . map ( this . filterService . getTeams ( ) , ( t ) => {
105+ return t . name ;
106+ } ) . join ( ', ' ) ;
92107 if ( filter . timeInterval ) {
93108 const intervalChoice = this . filterService . getIntervalChoice ( ) ;
94109 if ( intervalChoice . filter !== 'all' ) {
0 commit comments