[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
This commit is contained in:
k.triantafyllou 2019-04-11 11:26:02 +00:00
parent ed5556933f
commit 0c01cd65f7
3 changed files with 19 additions and 4 deletions

View File

@ -14,10 +14,10 @@
<a (click)="confirmModalOpen(result.community)" [class]="(result.isManager)?'uk-width-3-4':''">
{{(result.community.title)?result.community.title:result.community.shortTitle}}
</a>
<manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand"></manage>
<manage *ngIf="result.isManager" [communityId]="result.community.communityId" class="uk-width-expand uk-margin-auto-right"></manage>
</div>
<div *ngIf="result.community.description" class="uk-margin-auto">
<div class="text-justify descriptionText" [title]="result.community.description">
<div *ngIf="result.community.description">
<div class="text-justify descriptionText uk-margin-auto-right" [title]="result.community.description">
{{_formatDescription(result.community.description)}}
</div>
</div>
@ -26,7 +26,7 @@
<span *ngIf="result.community.date"><b> Creation Date: </b></span>
<span *ngIf="result.community.date">{{result.community.date | date:'dd-MM-yyyy'}}</span>
</div>
<div class="uk-width-expand uk-align-right">
<div class="uk-width-expand uk-align-right uk-margin-auto-right">
<span *ngIf="result.community.type && result.community.type != ''" ><b> Type: </b></span>
<span *ngIf="result.community.type && result.community.type != ''" >{{(result.community.type == 'ri')? 'Research Initiative': 'Research Community'}}</span>
</div>

View File

@ -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());
}
}

View File

@ -0,0 +1,6 @@
import {Email} from "../email/email";
export class EmailRecaptcha {
email: Email = null;
recaptcha: string = null;
}