diff --git a/connect/community/communityInfo.ts b/connect/community/communityInfo.ts index 1185f8d1..67904a2d 100644 --- a/connect/community/communityInfo.ts +++ b/connect/community/communityInfo.ts @@ -1,6 +1,7 @@ import {StringUtils} from "../../utils/string-utils.class"; import {properties} from "../../../../environments/environment"; import {SelectionCriteria} from "../../utils/entities/contentProvider"; +import tryThese = CKEDITOR.tools.tryThese; export class CommunityInfo { title: string; @@ -36,6 +37,11 @@ export class CommunityInfo { } return response; } + + public isOpen() { + return !(this.membership && this.membership === 'byInvitation'); + } + public isPublic(){ return this.status == "all" || this.status == "PUBLIC"; } diff --git a/utils/email/composer.ts b/utils/email/composer.ts index 6fead2f0..d2df6d38 100644 --- a/utils/email/composer.ts +++ b/utils/email/composer.ts @@ -302,21 +302,23 @@ export class Composer { return message; } - public static composeEmailForCommunityDashboard(name: string, recipient: string) { + public static composeEmailForCommunityDashboard(name: string, role: "manager" | "member", recipient: string) { let email: Email = new Email(); email.subject = 'OpenAIRE Connect | ' + name; - email.body = this.composeMessageForCommunityDashboard(name); + email.body = this.composeMessageForCommunityDashboard(name, role); email.recipient = recipient; return email; } - public static composeMessageForCommunityDashboard(name: string, user: string = null, invitation: any = null) { + public static composeMessageForCommunityDashboard(name: string, role: "manager" | "member", user: string = null, invitation: any = null) { let message = '

Dear ((__user__)),

' + - '

You have been invited to be a manager of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + + '

You have been invited to be a ' + role + ' of the OpenAIRE Research Community Dashboard for the ' + name + '.

' + '

Click this URL and use the verification code below to accept the invitation.

' + '

The verification code is ((__code__)).

' + + (role === 'manager'? '

As a manager of the OpenAIRE Research Community 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 + '.

' + + 'where you will be able to customize and manage the content of the ' + name + '.

': + '

As a member of the OpenAIRE Research Community Dashboard, you will have access to the community dashboard and link research results with projects, communities and other research projects.

') + '

Please contact us at ' + properties.helpdeskEmail + ' if you have any questions or concerns.

' + '

Kind Regards
The OpenAIRE Team

' +