X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp%2Flayouts%2Fheader%2FHeaderComponent.ts;h=f90b5b643198efd2ed66bd4bb64db076aedac6a1;hb=refs%2Fchanges%2F64%2F13364%2F1;hp=4d7f3b1d56c2407449799f84cef7c5ac5da04986;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/layouts/header/HeaderComponent.ts b/src/app/layouts/header/HeaderComponent.ts index 4d7f3b1..f90b5b6 100644 --- a/src/app/layouts/header/HeaderComponent.ts +++ b/src/app/layouts/header/HeaderComponent.ts @@ -26,7 +26,6 @@ import { environment } from 'environment'; import { ProjectService } from 'ProjectService'; import { Observable } from 'rxjs'; import { SharedService } from 'SharedService'; -import { ProjectRoleMappings, UserDetail } from 'UserModel'; import { UserSettingsComponent } from 'UserSettingsComponent'; /** @@ -64,6 +63,9 @@ export class HeaderComponent implements OnInit { /** Contains all methods related to shared @public */ public sharedService: SharedService; + /** Property contains to show new version tag shared @public */ + public toShowNewTag: Boolean = false; + /** Utilizes auth service for any auth operations @private */ private authService: AuthenticationService; @@ -83,15 +85,21 @@ export class HeaderComponent implements OnInit { /** Lifecyle Hooks the trigger before component is instantiate @public */ public ngOnInit(): void { - this.isAdmin = (localStorage.getItem('isAdmin') === 'true') ? true : false; + this.isAdmin = (sessionStorage.getItem('isAdmin') === 'true') ? true : false; this.selectedProject = this.authService.ProjectName; - this.authService.ProjectName.subscribe((projectNameFinal: string) => { + this.authService.ProjectName.subscribe((projectNameFinal: string): void => { this.getSelectedProject = projectNameFinal; }); this.username$ = this.authService.username; this.projectService.setHeaderProjects(); this.projectList$ = this.projectService.projectList; this.PACKAGEVERSION = environment.packageVersion; + const getLocalStorageVersion: string = sessionStorage.getItem('osmVersion'); + if (getLocalStorageVersion === null) { + this.showNewVersion(); + } else if (getLocalStorageVersion !== this.sharedService.osmVersion) { + this.showNewVersion(); + } } /** Logout function @public */ @@ -99,6 +107,17 @@ export class HeaderComponent implements OnInit { this.authService.logout(); } + /** Show Version function @public */ + public showNewVersion(): void { + this.toShowNewTag = true; + } + + /** Close Version and add in local storage @public */ + public closeVersion(): void { + this.toShowNewTag = false; + sessionStorage.setItem('osmVersion', this.sharedService.osmVersion); + } + /** Implementation of model for UserSettings options.@public */ public userSettings(): void { this.modalService.open(UserSettingsComponent, { backdrop: 'static' });