import { ProjectService } from 'ProjectService';
import { Observable } from 'rxjs';
import { SharedService } from 'SharedService';
-import { ProjectRoleMappings, UserDetail } from 'UserModel';
import { UserSettingsComponent } from 'UserSettingsComponent';
/**
/** 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;
public ngOnInit(): void {
this.isAdmin = (localStorage.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 = localStorage.getItem('osmVersion');
+ if (getLocalStorageVersion === null) {
+ this.showNewVersion();
+ } else if (getLocalStorageVersion !== this.sharedService.osmVersion) {
+ this.showNewVersion();
+ }
}
/** Logout function @public */
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;
+ localStorage.setItem('osmVersion', this.sharedService.osmVersion);
+ }
+
/** Implementation of model for UserSettings options.@public */
public userSettings(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(UserSettingsComponent, { backdrop: 'static' });
}
}