@@ -6,6 +6,7 @@ import { MatButtonModule } from '@angular/material/button';
66import { MatIconModule } from '@angular/material/icon' ;
77import { CommonModule } from '@angular/common' ;
88import { TokenService } from 'src/app/services/token.service' ;
9+ import { AppConfigService } from 'src/app/services/app-config.service' ;
910
1011@Component ( {
1112 selector : 'wfprev-app-header' ,
@@ -19,17 +20,17 @@ import { TokenService } from 'src/app/services/token.service';
1920 templateUrl : './app-header.component.html' ,
2021 styleUrls : [ './app-header.component.scss' ]
2122} )
22- export class AppHeaderComponent implements OnInit {
23+ export class AppHeaderComponent implements OnInit {
2324
2425 constructor (
2526 protected router : Router ,
26- private readonly tokenService : TokenService
27+ private readonly tokenService : TokenService ,
28+ private readonly appConfigService : AppConfigService
2729 ) {
2830 }
2931
30-
31- environment :string = 'DEV'
32- title :string = 'PREVENTION'
32+ environment : string = ''
33+ title : string = 'PREVENTION'
3334 currentUser : string = 'User_1'
3435
3536 ngOnInit ( ) : void {
@@ -39,11 +40,16 @@ export class AppHeaderComponent implements OnInit{
3940 this . currentUser = name ;
4041 }
4142 } ) ;
43+
44+ // Display no environment indicator in prod
45+ // Case sensitive checking, set the variable as upper case
46+ const env = ( this . appConfigService . getConfig ( ) ?. application ?. environment || '' ) . toUpperCase ( ) ;
47+ this . environment = env === 'PROD' ? '' : env ;
4248 }
4349
4450
45- onBCLogoClick ( ) {
46- this . router . navigate ( [ ResourcesRoutes . LANDING ] ) ; // Navigate back to the home page
51+ onBCLogoClick ( ) {
52+ this . router . navigate ( [ ResourcesRoutes . LANDING ] ) ; // Navigate back to the home page
4753 }
4854
4955 onSupportLinkClick ( ) {
0 commit comments