Merge branch 'master' into Fit-in-view-option

This commit is contained in:
Piotr Pekala
2019-10-23 01:28:52 -07:00
4 changed files with 55 additions and 0 deletions

View File

@ -82,6 +82,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
public isConsoleVisible: boolean = false;
public isTopologySummaryVisible: boolean = false;
public isInterfaceLabelVisible: boolean = false;
public notificationsVisibility: boolean = false;
tools = {
selection: true,
@ -222,6 +223,21 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
})
);
this.subscriptions.push(this.projectWebServiceHandler.errorNotificationEmitter.subscribe((message) => {
this.showMessage({
type: 'error',
message: message
});
}));
this.subscriptions.push(this.projectWebServiceHandler.warningNotificationEmitter.subscribe((message) => {
this.showMessage({
type: 'warning',
message: message
});
}));
this.notificationsVisibility = localStorage.getItem('notificationsVisibility') === 'true' ? true : false;
this.addKeyboardListeners();
}
@ -593,6 +609,22 @@ export class ProjectMapComponent implements OnInit, OnDestroy {
this.mapSettingsService.toggleTopologySummary(this.isTopologySummaryVisible);
}
public toggleNotifications(visible: boolean) {
this.notificationsVisibility = visible;
if (this.notificationsVisibility) {
localStorage.setItem('notificationsVisibility', 'true');
} else {
localStorage.removeItem('notificationsVisibility');
}
}
private showMessage(msg) {
if (this.notificationsVisibility) {
if (msg.type === 'error') this.toasterService.error(msg.message);
if (msg.type === 'warning') this.toasterService.warning(msg.message);
}
}
public hideMenu() {
this.projectMapMenuComponent.resetDrawToolChoice()
this.isProjectMapMenuVisible = false;