canceled');
+ NotificationHandler.rise(StringUtils.capitalize(this.stakeholderUtils.roles[this.role]) + ' invitation to ' + this.selectedUser + ' has been canceled');
this.loadPending = false;
}, error => {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
@@ -309,7 +312,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
this.updateLists();
}, error => {
if(error.status === 409) {
- NotificationHandler.rise('Group already exists. You can try to invite a ' + this.role + ' instead.', 'warning');
+ NotificationHandler.rise('Group already exists. You can try to invite a ' + this.stakeholderUtils.roles[this.role] + ' instead.', 'warning');
this.updateLists();
} else {
NotificationHandler.rise('An error has occurred. Please try again later', 'danger');
@@ -322,6 +325,10 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
public get canDelete() {
return (this.deleteAuthorizationLevel === 'curator'?this.isCurator:this.isManager);
}
+
+ public get canInvite() {
+ return this.exists && (this.inviteAuthorizationLevel === 'curator'?this.isCurator:this.isManager);
+ }
public isMe(userId: string) {
return userId && userId.includes(this.user.id) && !this.isCurator;
diff --git a/monitor-admin/utils/indicator-utils.ts b/monitor-admin/utils/indicator-utils.ts
index 832b4894..3e8cf554 100644
--- a/monitor-admin/utils/indicator-utils.ts
+++ b/monitor-admin/utils/indicator-utils.ts
@@ -17,6 +17,11 @@ import {Session} from "../../login/utils/helper.class";
import {HelperFunctions} from "../../utils/HelperFunctions.class";
import {properties} from "src/environments/environment";
+class Roles {
+ manager = 'manager';
+ member = 'member';
+}
+
class Entities {
stakeholder = 'Dashboard';
funder = 'Funder';
@@ -37,6 +42,7 @@ class Entities {
}
export class StakeholderConfiguration {
+ public static ROLES: Roles = new Roles();
public static ENTITIES: Entities = new Entities();
public static TYPES: Option[] = [
{value: 'funder', label: StakeholderConfiguration.ENTITIES.funder},
@@ -60,6 +66,10 @@ export class StakeholderConfiguration {
}
export class StakeholderUtils {
+ get roles() {
+ return StakeholderConfiguration.ROLES;
+ }
+
get entities() {
return StakeholderConfiguration.ENTITIES;
}
diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts
index 1b54fe75..46dd7899 100644
--- a/role-verification/role-verification.component.ts
+++ b/role-verification/role-verification.component.ts
@@ -12,6 +12,7 @@ import {EmailService} from "../utils/email/email.service";
import {Composer} from "../utils/email/composer";
import {ClearCacheService} from "../services/clear-cache.service";
import {BaseComponent} from "../sharedComponents/base/base.component";
+import {StakeholderUtils} from "../monitor-admin/utils/indicator-utils";
@Component({
selector: 'role-verification',
@@ -106,6 +107,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
public error: string = null;
public loading: boolean = false;
public isMember: boolean = false;
+ public stakeholderUtils: StakeholderUtils = new StakeholderUtils();
constructor(protected _route: ActivatedRoute,
protected _router: Router,
@@ -179,7 +181,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.managerModal.okButtonText = 'Accept';
this.managerModal.stayOpen = true;
this.managerModal.cancelButtonText = 'Cancel';
- this.managerModal.alertTitle = 'Manager Invitation';
+ this.managerModal.alertTitle = this.stakeholderUtils.roles.manager + ' Invitation';
this.managerModal.open();
}
@@ -195,7 +197,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.memberModal.okButtonLeft = false;
this.memberModal.stayOpen = true;
this.memberModal.cancelButtonText = 'Cancel';
- this.memberModal.alertTitle = 'Member Invitation';
+ this.memberModal.alertTitle = this.stakeholderUtils.roles.member + ' Invitation';
this.cdr.detectChanges();
this.memberModal.open();
}
diff --git a/utils/email/composer.ts b/utils/email/composer.ts
index 676dc4c2..ab3c69f0 100644
--- a/utils/email/composer.ts
+++ b/utils/email/composer.ts
@@ -2,6 +2,7 @@ import {Email} from "./email";
import {Body} from "./body";
import {properties} from "../../../../environments/environment";
import {User} from "../../login/utils/helper.class";
+import {StakeholderConfiguration} from "../../monitor-admin/utils/indicator-utils";
export class Composer {
private static noteBodySize = "14px";
@@ -335,13 +336,13 @@ export class Composer {
email.subject = 'National Open Access Monitor Ireland | ' + name;
email.recipient = recipient;
email.body = 'Dear user,
' +
- 'You have been invited to be a ' + role +' of the for the National Open Access Monitor, Ireland dashboard for the ' + name + '.
' +
+ 'You have been invited to be a ' + StakeholderConfiguration.ROLES[role] +' of the for the National Open Access Monitor, Ireland dashboard for the ' + name + '.
' +
'Click this URL and use the verification code below to accept the invitation.
' +
'The verification code is ((__code__)).
' +
'At your first sign in you will be asked to accept and consent to the "OpenAIRE Personal Data Protection Policy and Consent Form" to be able to use the service.
' +
(role === "manager"?
- 'As a manager of the National Open Access Monitor, Ireland, you will have access to the administration part of the dashboard, where you will be able to also invite other users to become managers.
':
- 'As a member of the OpenAIRE Monitor Dashboard, you will have access to the restricted access areas of the profile for the ' + name + '.') +
+ '
As a ' + StakeholderConfiguration.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the administration part of the dashboard, where you will be able to also invite other users to become ' + StakeholderConfiguration.ROLES['member'] + 's.
':
+ 'As a ' + StakeholderConfiguration.ROLES[role] + ' of the National Open Access Monitor, Ireland, you will have access to the sandbox of the profile for the ' + name + '.') +
'
Please contact us at ' + properties.helpdeskEmail +
' if you have any questions or concerns.
' +
'Kind Regards
The OpenAIRE Team
' +