Summary Table
Categories |
Total Count |
PII |
0 |
URL |
0 |
DNS |
0 |
EKL |
0 |
IP |
0 |
PORT |
0 |
VsID |
0 |
CF |
0 |
AI |
0 |
VPD |
0 |
PL |
0 |
Other |
0 |
File Content
import { Component, OnInit, Input, Inject } from '@angular/core';
import { AuthenticationService } from '../../auth/auth.service';
import { AppSettingsService } from './../app-settings/app-settings.service';
import { DOCUMENT } from '@angular/platform-browser';
@Component({
selector: 'app-navigation',
templateUrl: './navigation.component.html',
styleUrls: ['./navigation.component.scss']
})
export class NavigationComponent implements OnInit {
navState: boolean;
userRoles;
userInfo;
permissions: any;
showArsBase = false;
showArsAdmin = false;
showEwvBase = false;
showEwvAdmin = false;
show275 = false;
showFpp = true;
fppFocus = false;
ewvFocus = false;
arFocus = false;
search275Focus = false;
userAdminFocus = false;
arsReportsFocus = false;
arsAdminFocus = false;
searchFocus = false;
submitFocus = false;
ucpAdminFocus = false;
ucpReportsFocus = false;
// accordionSetWorkQueueNavState = false;
// accordionActiveStationsNavState = false;
@Input()
tabIdx = '0';
// get tabbableIdx() {
// return this.tabbable ? '0' : '-1';
// }
constructor(
private authenticationService: AuthenticationService,
public appSettingsService: AppSettingsService,
@Inject(DOCUMENT) private document
) {}
ngOnInit() {
// testcode
this.authenticationService.isTokenExpired();
this.appSettingsService.navState$.subscribe(
navState => (this.navState = navState)
);
// end of test code
this.userInfo = this.authenticationService.getDecodedUserInfo();
this.userRoles = this.userInfo.userRoles;
this.permissions = this.userInfo.permissions;
this.showArsBase = this.userRoles.some(
data => data === 'ARS_BASE_ATTACHMENT_USER'
);
this.showArsAdmin = this.userRoles.some(data => data === 'ARS_ADMIN');
this.showEwvBase = this.userRoles.some(data => data === 'EWV_BASE_USER');
this.showEwvAdmin = this.userRoles.some(data => data === 'EWV_ADMIN');
if (this.permissions.search275) {
this.show275 = this.permissions.search275.pageViewAccess;
}
}
focus(focus: string) {
this.fppFocus = false;
this.ewvFocus = false;
this.arFocus = false;
this.search275Focus = false;
this.userAdminFocus = false;
this.arsReportsFocus = false;
this.arsAdminFocus = false;
this.searchFocus = false;
this.submitFocus = false;
this.ucpAdminFocus = false;
this.ucpReportsFocus = false;
this[focus] = true;
}
onClearMenu() {
this.focus(undefined);
}
setNavState() {
this.navState = !this.navState;
if (!this.navState) {
this.document.body.style.backgroundPosition = '-168px';
// this.accordionSetWorkQueueNavState = false;
// this.accordionActiveStationsNavState = false;
}
this.appSettingsService.setNavState(this.navState);
}
accordionSetNavState(state) {
if (state) {
this.setNavState();
}
}
// sessionWorkQueueSetNavState() {
// if (!this.navState) {
// this.accordionSetWorkQueueNavState = false;
// } else {
// this.accordionSetWorkQueueNavState = !this.accordionSetWorkQueueNavState;
// }
// }
// activeStationsSetNavState() {
// if (!this.navState) {
// this.accordionActiveStationsNavState = false;
// } else {
// this.accordionActiveStationsNavState = !this.accordionActiveStationsNavState;
// }
// }
}