[Library | Trunk]: 1. Role users disable remove button for members when a user is a manager. 2. Change email message for community managers invitation
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@60545 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
03780a4112
commit
8acc64fc10
|
@ -53,10 +53,11 @@
|
||||||
<div *ngIf="isCurator || !showActive" class="uk-width-auto@m uk-width-1-1">
|
<div *ngIf="isCurator || !showActive" class="uk-width-auto@m uk-width-1-1">
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||||
<a (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle">
|
<button (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle" [disabled]="role === 'member' && item.isManager"
|
||||||
|
[attr.uk-tooltip]="(role === 'member' && item.isManager)?'This user is a manager and cannot be removed.':null">
|
||||||
<icon name="remove_circle_outline" ratio="0.7" [flex]="true"></icon>
|
<icon name="remove_circle_outline" ratio="0.7" [flex]="true"></icon>
|
||||||
<span class="uk-margin-small-left">{{showActive ? ('Remove ' + role) : 'Cancel invitation'}}</span>
|
<span class="uk-margin-small-left">{{showActive ? ('Remove ' + role) : 'Cancel invitation'}}</span>
|
||||||
</a>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -36,6 +36,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
public notificationFn: Function;
|
public notificationFn: Function;
|
||||||
public user: User = null;
|
public user: User = null;
|
||||||
public active: any[];
|
public active: any[];
|
||||||
|
public managers: any[];
|
||||||
public pending: any[];
|
public pending: any[];
|
||||||
public showActive: boolean = true;
|
public showActive: boolean = true;
|
||||||
public subs: any[] = [];
|
public subs: any[] = [];
|
||||||
|
@ -88,9 +89,21 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
this.loadActive = true;
|
this.loadActive = true;
|
||||||
this.loadPending = true;
|
this.loadPending = true;
|
||||||
this.subs.push(this.userRegistryService.getActiveEmail(this.type, this.id, this.role).subscribe(users => {
|
this.subs.push(this.userRegistryService.getActiveEmail(this.type, this.id, this.role).subscribe(users => {
|
||||||
|
if(this.role === 'member') {
|
||||||
|
this.subs.push(this.userRegistryService.getActiveEmail(this.type, this.id, 'manager').subscribe(managers => {
|
||||||
|
this.managers = managers;
|
||||||
|
this.active = users;
|
||||||
|
this.active.forEach(user => {
|
||||||
|
user['isManager'] = this.managers.find(manager => manager.email === user.email);
|
||||||
|
});
|
||||||
|
this.loadActive = false;
|
||||||
|
this.exists = true;
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
this.active = users;
|
this.active = users;
|
||||||
this.loadActive = false;
|
this.loadActive = false;
|
||||||
this.exists = true;
|
this.exists = true;
|
||||||
|
}
|
||||||
}, error => {
|
}, error => {
|
||||||
this.active = [];
|
this.active = [];
|
||||||
if(error.status === 404) {
|
if(error.status === 404) {
|
||||||
|
|
|
@ -51,10 +51,11 @@
|
||||||
<div class="uk-width-auto@m uk-width-1-1">
|
<div class="uk-width-auto@m uk-width-1-1">
|
||||||
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
<div class="uk-width-1-1 uk-flex uk-flex-center">
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||||
<a (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle" [class.uk-disabled]="!!item.isManager">
|
<button (click)="openDeleteModal(item)" class="uk-button action uk-flex uk-flex-middle" [disabled]="item.isManager"
|
||||||
|
[attr.uk-tooltip]="item.isManager?'This user is a manager and cannot be removed.':null">
|
||||||
<icon name="remove_circle_outline" ratio="0.7" [flex]="true"></icon>
|
<icon name="remove_circle_outline" ratio="0.7" [flex]="true"></icon>
|
||||||
<span class="uk-margin-small-left">Remove subscriber</span>
|
<span class="uk-margin-small-left">Remove subscriber</span>
|
||||||
</a>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -248,23 +248,21 @@ export class Composer {
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static composeEmailForCommunityDashboard(name: string, recipient: string, role: "manager" | "member") {
|
public static composeEmailForCommunityDashboard(name: string, recipient: string) {
|
||||||
let email: Email = new Email();
|
let email: Email = new Email();
|
||||||
email.subject = 'OpenAIRE Monitor Dashboard | ' + name;
|
email.subject = 'OpenAIRE Monitor Dashboard | ' + name;
|
||||||
email.body = this.composeMessageForCommunityDashboard(name, role);
|
email.body = this.composeMessageForCommunityDashboard(name);
|
||||||
email.recipient = recipient;
|
email.recipient = recipient;
|
||||||
return email;
|
return email;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static composeMessageForCommunityDashboard(name: string, role: "manager" | "member", user: string = null, invitation: any = null) {
|
public static composeMessageForCommunityDashboard(name: string, user: string = null, invitation: any = null) {
|
||||||
let message = '<p>Dear ((__user__)),</p>' +
|
let message = '<p>Dear ((__user__)),</p>' +
|
||||||
'<p>You have been invited to be a ' + role +' of the OpenAIRE Monitor Dashboard for the ' + name + '.</p>' +
|
'<p>You have been invited to be a manager of the OpenAIRE Research Community Dashboard for the ' + name + '.</p>' +
|
||||||
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
|
'<p>Click <a href="((__link__))" target="_blank">this URL</a> and use the verification code below to accept the invitation.</p>' +
|
||||||
'<p>The verification code is <b>((__code__))</b>.</p>' +
|
'<p>The verification code is <b>((__code__))</b>.</p>' +
|
||||||
(role === "manager"?
|
'<p>As a manager of the OpenAIRE Research Community Dashboard, you will have access to the administration part of the dashboard, ' +
|
||||||
'<p>As a manager of the OpenAIRE Monitor Dashboard, you will have access to the administration part of the dashboard, ' +
|
'where you will be able to customize and manage the content of the ' + name + '.</p>' +
|
||||||
'where you will be able to customize and manage the profile of the ' + name + '.</p>':
|
|
||||||
'<p>As a member of the OpenAIRE Monitor Dashboard, you will have access to the restricted access areas of the profile for the ' + name + '.') +
|
|
||||||
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
|
'<p>Please contact us at <a href="mailto:' + properties.helpdeskEmail+'">' + properties.helpdeskEmail +
|
||||||
'</a> if you have any questions or concerns.</p>' +
|
'</a> if you have any questions or concerns.</p>' +
|
||||||
'<p>Kind Regards<br>The OpenAIRE Team</p>' +
|
'<p>Kind Regards<br>The OpenAIRE Team</p>' +
|
||||||
|
|
Loading…
Reference in New Issue