[Trunk|Connect]: 1. Move contact-form to library. 2. Change email validation on contact form

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@55300 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
k.triantafyllou 2019-04-12 10:17:07 +00:00
parent a8a00b386e
commit d696879ac3
3 changed files with 4 additions and 15 deletions

View File

@ -1,9 +0,0 @@
export class ContactForm {
name: string = '';
surname: string = '';
email: string = '';
affiliation: string = '';
community: string = '';
message: string = '';
recaptcha: string = null;
}

View File

@ -32,11 +32,9 @@
Affiliation <span class="uk-text-danger uk-text-bold">*</span>
</label>
<div class="uk-width-1-2 uk-margin-remove-top">
<div *ngIf="sender.invalid && isSubmitted" class=" uk-text-danger uk-text-small style=display:none">
<span *ngIf="sender.errors.required">Please add an email. </span>
<span *ngIf="!sender.errors.required && sender.errors.email">Please add a valid email. </span>
</div>
<input class="uk-input" type="email" placeholder="Your Email" [(ngModel)]="contactForm.email" required email #sender="ngModel">
<div *ngIf="sender.invalid && isSubmitted" class=" uk-text-danger uk-text-small style=display:none">Please add an email. </div>
<div *ngIf="!sender.invalid && isSubmitted && !contactForm.email.match('^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$')" class=" uk-text-danger uk-text-small style=display:none">Please add a valid email. </div>
<input class="uk-input" type="email" placeholder="Your Email" [(ngModel)]="contactForm.email" required #sender="ngModel">
</div>
<div class="uk-width-1-2 uk-margin-remove-top">
<div *ngIf="affiliation.invalid && isSubmitted" class=" uk-text-danger uk-text-small style=display:none"> Please add an affiliation. </div>

View File

@ -4,7 +4,7 @@ import {ActivatedRoute, Router} from '@angular/router';
import {EmailService} from "../openaireLibrary/utils/email/email.service";
import {Email} from "../openaireLibrary/utils/email/email";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {ContactForm} from "./contact-form";
import {ContactForm} from "../openaireLibrary/utils/email/contact-form";
import {Composer} from "../openaireLibrary/utils/email/composer";
@Component({