[master]: Fix organization role map in role-users and role-verification.

This commit is contained in:
Konstantinos Triantafyllou 2024-03-12 19:27:23 +02:00
parent d88349d62b
commit 20f91b0a7a
5 changed files with 10 additions and 5 deletions

View File

@ -3,7 +3,7 @@
<loading></loading>
</div>
</div>
<role-users *ngIf="!loading && stakeholder" [id]="stakeholder.alias" [type]="stakeholder.type" [name]="stakeholder.name" [link]="link" [role]="tab" [message]="messages.get(tab)"
<role-users *ngIf="!loading && stakeholder" [id]="stakeholder.alias" [type]="type" [name]="stakeholder.name" [link]="link" [role]="tab" [message]="messages.get(tab)"
[emailComposer]="emailComposer">
</role-users>

View File

@ -1,7 +1,7 @@
import {Component} from "@angular/core";
import {StakeholderBaseComponent} from "../../openaireLibrary/monitor-admin/utils/stakeholder-base.component";
import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
import {User} from "../../openaireLibrary/login/utils/helper.class";
import {Role, User} from "../../openaireLibrary/login/utils/helper.class";
import {Email} from "../../openaireLibrary/utils/email/email";
import {Composer} from "../../openaireLibrary/utils/email/composer";
import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service";
@ -25,6 +25,7 @@ export class UsersComponent extends StakeholderBaseComponent {
public messages: Map<Tab, string> = new Map<Tab, string>();
public tab: Tab = 'manager';
public user: User;
public type: string;
public emailComposer: Function = (name, recipient, role): Email => {
return Composer.composeMessageForIrishDashboard(name, recipient, role);
}
@ -53,6 +54,7 @@ export class UsersComponent extends StakeholderBaseComponent {
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => {
if (stakeholder) {
this.stakeholder = stakeholder;
this.type = Role.mapType(stakeholder.type);
this.setProperties(this.stakeholder.alias, this.stakeholder.type, this.configurationService);
this.title = this.stakeholder.name + " | " + this.users;
this.setMetadata();

View File

@ -31,6 +31,7 @@ import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
<main>
<router-outlet></router-outlet>
</main>
<help-pop-up *ngIf="hasHelpPopUp"></help-pop-up>
</div>
</div>
<cookie-law *ngIf="isClient" position="bottom" cookieName="cookieLawSeen-NOAMIreland">
@ -83,7 +84,6 @@ import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
</div>
</div>
</footer>
<help-pop-up *ngIf="hasHelpPopUp"></help-pop-up>
`
})
export class AppComponent extends ResearcherBaseComponent implements OnInit, AfterViewInit {

@ -1 +1 @@
Subproject commit b0c69be6ef3e55089d7032f0d1457c874652974f
Subproject commit 622459c26c5db0c832e9b159d0558b15b86800c8

View File

@ -13,6 +13,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
import {ConfigurationService} from "../openaireLibrary/utils/configuration/configuration.service";
import {Irish} from "../shared/irish";
import {Role} from "../openaireLibrary/login/utils/helper.class";
@Component({
selector: 'rpo',
@ -63,7 +64,7 @@ import {Irish} from "../shared/irish";
<router-outlet></router-outlet>
</div>
</div>
<role-verification *ngIf="stakeholder" [id]="stakeholder.alias" [name]="stakeholder.name" [type]="stakeholder.type" [service]="'irish'" [relativeTo]="null"></role-verification>
<role-verification *ngIf="stakeholder" [id]="stakeholder.alias" [name]="stakeholder.name" [type]="type" [service]="'irish'" [relativeTo]="null"></role-verification>
`
})
export class RpoComponent extends StakeholderBaseComponent implements OnInit {
@ -72,6 +73,7 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
isSearch: boolean = false;
loading: boolean = false;
openaireEntities = OpenaireEntities;
type: string;
constructor(private stakeholderService: StakeholderService,
private _customFilterService: CustomFilterService,
@ -104,6 +106,7 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
this.subscriptions.push(this.stakeholderService.getStakeholder(this.alias, true).subscribe(stakeholder => {
this.stakeholder = stakeholder;
if (this.stakeholder && this.stakeholder.type === 'organization') {
this.type = Role.mapType(this.stakeholder.type);
this.setProperties(this.stakeholder.alias, this.stakeholder.type, this.configurationService);
LinksResolver.resetProperties();
LinksResolver.setSearchAndResultLanding("rpo/" + this.stakeholder.alias);