Add shouldUpdate in getStakeholder method. Role-verification: Add userInfoLink if user-info is on other portal

This commit is contained in:
Konstantinos Triantafyllou 2023-01-20 17:31:36 +02:00
parent da144c1c77
commit 53400f7745
2 changed files with 9 additions and 8 deletions

View File

@ -26,12 +26,8 @@ export class StakeholderService {
private promise: Promise<void>;
private sub;
constructor(private http: HttpClient, private route: ActivatedRoute) {
constructor(private http: HttpClient) {
this.stakeholderSubject = new BehaviorSubject<Stakeholder>(null);
/* let source = new EventSource(properties.monitorServiceAPIURL + "/stakeholder/events", {withCredentials: true});
source.addEventListener('message', message => {
console.log(message.data);
});*/
}
ngOnDestroy() {
@ -44,8 +40,8 @@ export class StakeholderService {
}
}
getStakeholder(alias: string): Observable<Stakeholder> {
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias) {
getStakeholder(alias: string, shouldUpdate: boolean = false): Observable<Stakeholder> {
if (!this.stakeholderSubject.value || this.stakeholderSubject.value.alias !== alias || shouldUpdate) {
this.promise = new Promise<void>((resolve, reject) => {
this.sub = this.http.get<Stakeholder>(properties.monitorServiceAPIURL + '/stakeholder/' + encodeURIComponent(alias), CustomOptions.registryOptions()).pipe(map(stakeholder => {
return this.formalize(this.checkIsUpload(stakeholder));

View File

@ -65,7 +65,10 @@ import {Composer} from "../utils/email/composer";
We are unable to process the request. What happened?
<ul class="uk-margin-top uk-list uk-list-circle uk-list-primary">
<li>You are logged in with a different email, than the one you have received the invitation.
Check <a [routerLink]="[userInfoLinkPrefix + '/user-info']" (click)="errorModal.cancel()">here</a> the email of your account.</li>
Check
<a *ngIf="!userInfoLink" [routerLink]="[userInfoLinkPrefix + '/user-info']" (click)="errorModal.cancel()">here</a>
<a *ngIf="userInfoLink" [href]="userInfoLink" (click)="errorModal.cancel()">here</a>
the email of your account.</li>
<li>The invitation has been canceled.</li>
<li>The URL is invalid.</li>
</ul>
@ -84,6 +87,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
public service: "connect" | "monitor" = "monitor";
@Input()
public userInfoLinkPrefix = '';
@Input()
public userInfoLink = null;
public user: User;
public verification: any;
public code: UntypedFormControl;