Skip to content

Commit 83b3235

Browse files
authored
Merge pull request #310 from ngageoint/menu-icon-tooltips
Added tooltips to nav bar icons
2 parents 0be7d30 + 597b726 commit 83b3235

File tree

3 files changed

+62
-34
lines changed

3 files changed

+62
-34
lines changed

web-app/src/app/navigation/navigation.component.html

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,24 @@
77
</div>
88

99
<div class="event-title">
10-
<span class="filter-event">{{filteredEvent.name}}</span>
11-
<span *ngIf="filteredTeams" class="filter-teams"><span>> {{filteredTeams}}</span></span>
12-
<span *ngIf="filteredInterval" class="filter-interval"> {{filteredInterval}}</span>
10+
<span class="filter-event">{{ filteredEvent.name }}</span>
11+
<span *ngIf="filteredTeams" class="filter-teams"
12+
><span>> {{ filteredTeams }}</span></span
13+
>
14+
<span *ngIf="filteredInterval" class="filter-interval">
15+
{{ filteredInterval }}</span
16+
>
1317
</div>
1418

1519
<div class="collapsed-menu">
16-
<button mat-button (click)="togglePreferences()">
20+
<button matTooltip="Preferences" mat-button (click)="togglePreferences()">
1721
<mat-icon>tune</mat-icon>
1822
</button>
19-
<button mat-icon-button class="navigation-options" [matMenuTriggerFor]="menu">
23+
<button
24+
mat-icon-button
25+
class="navigation-options"
26+
[matMenuTriggerFor]="menu"
27+
>
2028
<mat-icon>more_vert</mat-icon>
2129
</button>
2230
<mat-menu #menu>
@@ -39,22 +47,27 @@
3947
</mat-menu>
4048

4149
<div class="actions">
42-
<a [routerLink]="['/profile']" mat-button>
50+
<a matTooltip="Profile" [routerLink]="['/profile']" mat-button>
4351
<mat-icon>account_circle</mat-icon>
4452
</a>
4553

46-
<a [routerLink]="['/about']" mat-button>
54+
<a matTooltip="Info" [routerLink]="['/about']" mat-button>
4755
<mat-icon>info</mat-icon>
4856
</a>
4957

50-
<a *ngIf="isAdmin" mat-button href="admin/#/admin/">
58+
<a
59+
matTooltip="Admin Page"
60+
*ngIf="isAdmin"
61+
mat-button
62+
href="admin/#/admin/"
63+
>
5164
<mat-icon>admin_panel_settings</mat-icon>
5265
</a>
5366

54-
<a mat-button (click)="onLogout()">
67+
<a matTooltip="Logout" mat-button (click)="onLogout()">
5568
<mat-icon>logout</mat-icon>
5669
</a>
5770
</div>
5871
</div>
5972
</div>
60-
</mat-toolbar>
73+
</mat-toolbar>

web-app/src/app/navigation/navigation.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
justify-content: center;
3434
}
3535

36-
@media(min-width:900px) {
36+
@media (min-width: 900px) {
3737
.navigation-options {
3838
display: none;
3939
}
4040

4141
.actions {
4242
display: block;
4343
}
44-
}
44+
}

web-app/src/app/navigation/navigation.component.ts

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
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';
28
import { FilterService } from '../filter/filter.service';
39
import { MapService } from '../map/map.service';
410
import { 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

Comments
 (0)