Use role utils for Roles's naming

This commit is contained in:
Konstantinos Triantafyllou 2024-05-28 12:22:44 +03:00
parent 6822f20d57
commit be7322f833
4 changed files with 12 additions and 11 deletions

View File

@ -6,8 +6,8 @@
<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]="stakeholder.type" [name]="stakeholder.name" [link]="link" [role]="tab" [message]="messages.get(tab)"
[emailComposer]="emailComposer" [inviteAuthorizationLevel]="tab === 'manager'?'curator':'manager'"> [emailComposer]="emailComposer" [inviteAuthorizationLevel]="tab === 'manager'?'curator':'manager'">
<ul class="uk-tab uk-margin-remove-bottom uk-margin-medium-top"> <ul class="uk-tab uk-margin-remove-bottom uk-margin-medium-top">
<li [class.uk-active]="tab === 'manager'"><a routerLink="../manager" class="uk-text-capitalize">{{stakeholderUtils.roles.manager}}s</a></li> <li [class.uk-active]="tab === 'manager'"><a routerLink="../manager" class="uk-text-capitalize">{{roleUtils.roles.manager}}s</a></li>
<li [class.uk-active]="tab === 'member'"><a routerLink="../member" class="uk-text-capitalize">{{stakeholderUtils.roles.member}}s</a></li> <li [class.uk-active]="tab === 'member'"><a routerLink="../member" class="uk-text-capitalize">{{roleUtils.roles.member}}s</a></li>
</ul> </ul>
</role-users> </role-users>

View File

@ -1,7 +1,7 @@
import {Component} from "@angular/core"; import {Component} from "@angular/core";
import {StakeholderBaseComponent} from "../../openaireLibrary/monitor-admin/utils/stakeholder-base.component"; import {StakeholderBaseComponent} from "../../openaireLibrary/monitor-admin/utils/stakeholder-base.component";
import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder"; import {Stakeholder} from "../../openaireLibrary/monitor/entities/stakeholder";
import {Role, User} from "../../openaireLibrary/login/utils/helper.class"; import {Role, RoleUtils, User} from "../../openaireLibrary/login/utils/helper.class";
import {Email} from "../../openaireLibrary/utils/email/email"; import {Email} from "../../openaireLibrary/utils/email/email";
import {Composer} from "../../openaireLibrary/utils/email/composer"; import {Composer} from "../../openaireLibrary/utils/email/composer";
import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service"; import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service";
@ -20,6 +20,7 @@ type Tab = 'member' | 'manager';
}) })
export class UsersComponent extends StakeholderBaseComponent { export class UsersComponent extends StakeholderBaseComponent {
public stakeholder: Stakeholder; public stakeholder: Stakeholder;
public roleUtils: RoleUtils = new RoleUtils();
public link: string; public link: string;
public loading: boolean; public loading: boolean;
public messages: Map<Tab, string> = new Map<Tab, string>(); public messages: Map<Tab, string> = new Map<Tab, string>();
@ -57,10 +58,10 @@ export class UsersComponent extends StakeholderBaseComponent {
this.title = this.stakeholder.name + " | " + this.users; this.title = this.stakeholder.name + " | " + this.users;
this.setMetadata(); this.setMetadata();
this.link = this.getURL(this.stakeholder.alias); this.link = this.getURL(this.stakeholder.alias);
this.messages.set("member", 'A ' + this.stakeholderUtils.roles.member + ' has the right to access the <b>sandbox</b> of this indicator\'s profile. ' + this.messages.set("member", 'A ' + this.roleUtils.roles.member + ' has the right to access the <b>sandbox</b> of this indicator\'s profile. ' +
'A ' + this.stakeholderUtils.roles.member + ' has <b>no access</b> to the administration part of the profile.'); 'A ' + this.roleUtils.roles.member + ' has <b>no access</b> to the administration part of the profile.');
this.messages.set("manager", 'A ' + this.stakeholderUtils.roles.manager + ' has the right to access the <b>administration part</b> of this indicator\'s profile, ' + this.messages.set("manager", 'A ' + this.roleUtils.roles.manager + ' has the right to access the <b>administration part</b> of this indicator\'s profile, ' +
'where he is able to invite other users as ' + this.stakeholderUtils.roles.member + 's and access the <b>sandbox.</b>'); 'where he is able to invite other users as ' + this.roleUtils.roles.member + 's and access the <b>sandbox.</b>');
this.loading = false; this.loading = false;
} }
})); }));

@ -1 +1 @@
Subproject commit 5a912f02b7b8c5ce1805d451f67cd3db728ca985 Subproject commit 1ac4365e054f97190a851d2a5e4b64d66198f3e3

View File

@ -2,7 +2,7 @@ import {Portal} from "../openaireLibrary/utils/entities/adminTool/portal";
import {StakeholderConfiguration} from "../openaireLibrary/monitor-admin/utils/indicator-utils"; import {StakeholderConfiguration} from "../openaireLibrary/monitor-admin/utils/indicator-utils";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service"; import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {Role} from "../openaireLibrary/login/utils/helper.class"; import {Role} from "../openaireLibrary/login/utils/helper.class";
import {IndicatorPath, Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder"; import {Stakeholder} from "../openaireLibrary/monitor/entities/stakeholder";
import {LinksResolver} from "../search/links-resolver"; import {LinksResolver} from "../search/links-resolver";
export class Irish { export class Irish {
@ -15,8 +15,8 @@ export class Irish {
constructor() { constructor() {
LinksResolver.resetProperties(); LinksResolver.resetProperties();
StakeholderConfiguration.ROLES.manager = 'primary dashboard manager'; Role.ROLES.manager = 'primary dashboard manager';
StakeholderConfiguration.ROLES.member = 'manager'; Role.ROLES.member = 'manager';
StakeholderConfiguration.ENTITIES.stakeholder = 'Monitor'; StakeholderConfiguration.ENTITIES.stakeholder = 'Monitor';
StakeholderConfiguration.ENTITIES.stakeholders = 'Monitors'; StakeholderConfiguration.ENTITIES.stakeholders = 'Monitors';