@propmix/profet-common-header 3.1.1 → 3.1.2
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.
- package/esm2020/lib/api-endpoints.def.mjs +2 -2
- package/esm2020/lib/common-header.service.mjs +3 -3
- package/esm2020/lib/header/header.component.mjs +29 -32
- package/fesm2015/propmix-profet-common-header.mjs +32 -35
- package/fesm2015/propmix-profet-common-header.mjs.map +1 -1
- package/fesm2020/propmix-profet-common-header.mjs +32 -34
- package/fesm2020/propmix-profet-common-header.mjs.map +1 -1
- package/lib/api-endpoints.def.d.ts +1 -1
- package/lib/common-header.service.d.ts +1 -1
- package/lib/header/header.component.d.ts +0 -2
- package/package.json +1 -1
|
@@ -29,8 +29,8 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
|
|
29
29
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
30
30
|
import * as i1$1 from '@angular/router';
|
|
31
31
|
import { Router } from '@angular/router';
|
|
32
|
-
import {
|
|
33
|
-
import { Observable, ReplaySubject, reduce
|
|
32
|
+
import { signOut } from 'aws-amplify/auth';
|
|
33
|
+
import { Observable, ReplaySubject, reduce } from 'rxjs';
|
|
34
34
|
import * as i10 from '@angular/material/core';
|
|
35
35
|
|
|
36
36
|
class CompanySwitchWarningComponent {
|
|
@@ -56,7 +56,7 @@ EndPoints.API_URLS = {
|
|
|
56
56
|
getUserCompanies: '/api/profile/getUserCompanies',
|
|
57
57
|
updateUserCompany: '/api/company/updateUserCompany',
|
|
58
58
|
fetchCompanyProfile: '/fetchCompanyProfile',
|
|
59
|
-
|
|
59
|
+
getUserDetails: '/api/user/getUserInformation',
|
|
60
60
|
getCompanyList: '/api/user/getUserCompanies',
|
|
61
61
|
getAppMenu: '/api/user/getAppMenu',
|
|
62
62
|
updateLastAccessedApplication: '/api/user/updateLastAccessedApplication'
|
|
@@ -285,8 +285,8 @@ class CommonHeaderService {
|
|
|
285
285
|
return acc;
|
|
286
286
|
}, {}));
|
|
287
287
|
}
|
|
288
|
-
|
|
289
|
-
let url = `${this.baseUrl + EndPoints.API_URLS.
|
|
288
|
+
getUserDetails() {
|
|
289
|
+
let url = `${this.baseUrl + EndPoints.API_URLS.getUserDetails}`;
|
|
290
290
|
return this._apiGatewayService.doGet(url);
|
|
291
291
|
}
|
|
292
292
|
getCompanyList() {
|
|
@@ -397,7 +397,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
|
|
|
397
397
|
|
|
398
398
|
class HeaderComponent {
|
|
399
399
|
constructor() {
|
|
400
|
-
this.username = '';
|
|
401
400
|
this.portalUrl = '';
|
|
402
401
|
this.userImageLink = null;
|
|
403
402
|
this.userCompanyLogo = '';
|
|
@@ -415,24 +414,34 @@ class HeaderComponent {
|
|
|
415
414
|
async ngOnInit() {
|
|
416
415
|
this.updateLastAccessedAppInfo();
|
|
417
416
|
this.getCompanyList();
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
this.username = this.userAuthData.firstName;
|
|
428
|
-
this.getMenuList();
|
|
429
|
-
if (this.userAuthData?._links?.profileImage?.href) {
|
|
430
|
-
this.getUserProfile();
|
|
431
|
-
}
|
|
417
|
+
this._headerSer.getUserDetails().subscribe({
|
|
418
|
+
next: (res) => {
|
|
419
|
+
if (res) {
|
|
420
|
+
this.userAuthData = res;
|
|
421
|
+
this.getMenuList();
|
|
422
|
+
if (res.profileImage) {
|
|
423
|
+
this.userImageLink = res.profileImage.locationUrl
|
|
424
|
+
? this._domSanitizer.bypassSecurityTrustUrl(res.profileImage.locationUrl)
|
|
425
|
+
: null;
|
|
432
426
|
}
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
// if (userInfo?.username) {
|
|
431
|
+
// let userDetails = this._headerSer.getUserDetails();
|
|
432
|
+
// forkJoin([userDetails]).subscribe({
|
|
433
|
+
// next: (res) => {
|
|
434
|
+
// if (res && res[0]) {
|
|
435
|
+
// this.userAuthData = res[0];
|
|
436
|
+
// this.username = this.userAuthData.firstName;
|
|
437
|
+
// this.getMenuList();
|
|
438
|
+
// if (this.userAuthData?._links?.profileImage?.href) {
|
|
439
|
+
// this.getUserProfile();
|
|
440
|
+
// }
|
|
441
|
+
// }
|
|
442
|
+
// },
|
|
443
|
+
// });
|
|
444
|
+
// }
|
|
436
445
|
this.resetTimer();
|
|
437
446
|
}
|
|
438
447
|
resetTimer() {
|
|
@@ -521,17 +530,6 @@ class HeaderComponent {
|
|
|
521
530
|
}
|
|
522
531
|
});
|
|
523
532
|
}
|
|
524
|
-
getUserProfile() {
|
|
525
|
-
this._headerSer
|
|
526
|
-
.obtainDataByUrl(this.userAuthData._links.profileImage.href)
|
|
527
|
-
.subscribe((img) => {
|
|
528
|
-
if (img?.locationUrl) {
|
|
529
|
-
this.userImageLink = img.locationUrl
|
|
530
|
-
? this._domSanitizer.bypassSecurityTrustUrl(img.locationUrl)
|
|
531
|
-
: null;
|
|
532
|
-
}
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
533
|
profile() {
|
|
536
534
|
if (this._headerSer.headerConfig.appType == PROFET_APPS.profet_portal) {
|
|
537
535
|
this._router.navigateByUrl('/app/profile');
|