From 0c01cd65f7d7dd3a140c5f7780554707fd8d2844 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Thu, 11 Apr 2019 11:26:02 +0000 Subject: [PATCH] [Trunk|Library]: 1. Add a new entity with fiels an email and recaptcha token. 2. Add a contact method on email service to send an email and recaptcha token to admin-tools git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@55274 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../searchUtils/communitySearchResults.component.html | 8 ++++---- utils/email/email.service.ts | 9 +++++++++ utils/entities/EmailRecaptcha.ts | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 utils/entities/EmailRecaptcha.ts diff --git a/searchPages/searchUtils/communitySearchResults.component.html b/searchPages/searchUtils/communitySearchResults.component.html index c78567bc..9f5a38b2 100644 --- a/searchPages/searchUtils/communitySearchResults.component.html +++ b/searchPages/searchUtils/communitySearchResults.component.html @@ -14,10 +14,10 @@ {{(result.community.title)?result.community.title:result.community.shortTitle}} - + -
-
+
+
{{_formatDescription(result.community.description)}}
@@ -26,7 +26,7 @@ Creation Date: {{result.community.date | date:'dd-MM-yyyy'}}
-
+
Type: {{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}
diff --git a/utils/email/email.service.ts b/utils/email/email.service.ts index 93f9ed99..873f8347 100644 --- a/utils/email/email.service.ts +++ b/utils/email/email.service.ts @@ -2,6 +2,7 @@ import {Injectable} from '@angular/core'; import {Http, Response, Headers, RequestOptions} from '@angular/http'; import {Email} from './email'; import {CustomOptions} from '../../services/servicesUtils/customOptions.class'; +import {EmailRecaptcha} from "../entities/EmailRecaptcha"; @Injectable() export class EmailService { @@ -16,4 +17,12 @@ export class EmailService { .map(request => request.json()); } + contact(url: string, email: Email, recaptcha: string) { + const data: EmailRecaptcha = new EmailRecaptcha(); + data.email = email; + data.recaptcha = recaptcha; + return this.http.post(url, data) + .map(request => request.json()); + } + } diff --git a/utils/entities/EmailRecaptcha.ts b/utils/entities/EmailRecaptcha.ts new file mode 100644 index 00000000..db342187 --- /dev/null +++ b/utils/entities/EmailRecaptcha.ts @@ -0,0 +1,6 @@ +import {Email} from "../email/email"; + +export class EmailRecaptcha { + email: Email = null; + recaptcha: string = null; +}