@propmix/profet-common-header 3.1.0 → 4.0.3-unstable

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -376,7 +376,7 @@ class HeaderComponent {
376
376
  this._snackbar = inject(MatSnackBar);
377
377
  this._headerSer = inject(CommonHeaderService);
378
378
  this._domSanitizer = inject(DomSanitizer);
379
- this.INACTIVITY_LIMIT = 30 * 60 * 1000; // 30 minutes
379
+ this.INACTIVITY_LIMIT = 10000; // 30 minutes
380
380
  this.isDialogOpen = false;
381
381
  this.companyControl = new FormControl();
382
382
  this.appConfig = AppConfig.appConfig;
@@ -386,6 +386,7 @@ class HeaderComponent {
386
386
  async ngOnInit() {
387
387
  this.updateLastAccessedAppInfo();
388
388
  this.getCompanyList();
389
+ this.getMenuList();
389
390
  let userInfo = await getCurrentUser();
390
391
  if (userInfo?.username) {
391
392
  let userDetails = this._headerSer.getUserDetailsByEmail({
@@ -396,7 +397,6 @@ class HeaderComponent {
396
397
  if (res && res[0]) {
397
398
  this.userAuthData = res[0];
398
399
  this.username = this.userAuthData.firstName;
399
- this.getMenuList();
400
400
  if (this.userAuthData?._links?.profileImage?.href) {
401
401
  this.getUserProfile();
402
402
  }
@@ -431,15 +431,6 @@ class HeaderComponent {
431
431
  groupByAppType(menuList) {
432
432
  let grouped = menuList.reduce((r, a) => {
433
433
  r[a.appType] = r[a.appType] || [];
434
- // TODO: Path references are to be replaced with values from backend API response. Remove this block when backend is ready
435
- if (a.appType == PROFET_APPS.profet_portal) {
436
- let isCompanyMenu = a.path === 'app/companies';
437
- let isCompanyAdmin = this.userAuthData?.rolesForCurrentCompany.includes("COMPANY_ADMIN");
438
- if (isCompanyMenu && isCompanyAdmin) {
439
- a = { ...a, path: 'app/addCompany/companyDetails' };
440
- }
441
- }
442
- // END of TODO block
443
434
  r[a.appType].push(a);
444
435
  return r;
445
436
  }, Object.create(null));
@@ -447,30 +438,15 @@ class HeaderComponent {
447
438
  }
448
439
  menuSelection(menu) {
449
440
  this.sideMenuToggle();
450
- let activeCom = this.companyList.find(x => x.isActive);
451
- let isCompanyMenu = menu.path === 'app/addCompany/companyDetails';
452
- let isCompanyAdmin = this.userAuthData?.rolesForCurrentCompany.includes("COMPANY_ADMIN");
453
441
  if (menu.appType == this._headerSer.headerConfig.appType) {
454
- // TODO: Path references are to be replaced with values from backend API response
455
- if (isCompanyMenu && isCompanyAdmin) {
456
- this._router.navigate([menu.path, activeCom?.id]);
457
- }
458
- else {
459
- this._router.navigate([menu.path]);
460
- }
442
+ this._router.navigate([menu.path]);
461
443
  }
462
444
  else {
445
+ let activeCom = this.companyList.find(x => x.isActive);
463
446
  if (activeCom) {
464
447
  if (activeCom.baseUrls[menu.appType]) {
465
- // TODO: Path references are to be replaced with values from backend API response
466
- if (isCompanyMenu && isCompanyAdmin) {
467
- let url = `${activeCom.baseUrls[menu.appType]}/${menu.path}/${activeCom.id}`;
468
- window.location.replace(url);
469
- }
470
- else {
471
- let url = `${activeCom.baseUrls[menu.appType]}/${menu.path}`;
472
- window.location.replace(url);
473
- }
448
+ let url = `${activeCom.baseUrls[menu.appType]}/${menu.path}`;
449
+ window.location.replace(url);
474
450
  }
475
451
  }
476
452
  }