aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+about
diff options
context:
space:
mode:
authorNassim Bounouas <NassimBounouas@users.noreply.github.com>2019-06-21 08:49:35 +0200
committerChocobozzz <me@florianbigard.com>2019-06-21 08:49:35 +0200
commit4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877 (patch)
treef7fb09aa655f954b8d9833cd2215f6fada5721a6 /client/src/app/+about
parentd1ea2a988d05e1eca4066efb99c5f943f5267a78 (diff)
downloadPeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.tar.gz
PeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.tar.zst
PeerTube-4e9fa5b7e9ca6030a5fe2e9b0520bf8fa18e5877.zip
Feature/subject in contact form (#1926)
* #1915 Add a subject to contact form and add it to email sent * #1915 Add subject to contact form tests * #1915 Contact form test corrected && tslint correction
Diffstat (limited to 'client/src/app/+about')
-rw-r--r--client/src/app/+about/about-instance/contact-admin-modal.component.html9
-rw-r--r--client/src/app/+about/about-instance/contact-admin-modal.component.ts4
2 files changed, 12 insertions, 1 deletions
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.html b/client/src/app/+about/about-instance/contact-admin-modal.component.html
index b2cbd0873..c3c71bdee 100644
--- a/client/src/app/+about/about-instance/contact-admin-modal.component.html
+++ b/client/src/app/+about/about-instance/contact-admin-modal.component.html
@@ -26,6 +26,15 @@
26 </div> 26 </div>
27 27
28 <div class="form-group"> 28 <div class="form-group">
29 <label i18n for="subject">Subject</label>
30 <input
31 type="text" id="subject"
32 formControlName="subject" [ngClass]="{ 'input-error': formErrors['subject'] }"
33 >
34 <div *ngIf="formErrors.subject" class="form-error">{{ formErrors.subject }}</div>
35 </div>
36
37 <div class="form-group">
29 <label i18n for="body">Your message</label> 38 <label i18n for="body">Your message</label>
30 <textarea id="body" formControlName="body" [ngClass]="{ 'input-error': formErrors['body'] }"> 39 <textarea id="body" formControlName="body" [ngClass]="{ 'input-error': formErrors['body'] }">
31 </textarea> 40 </textarea>
diff --git a/client/src/app/+about/about-instance/contact-admin-modal.component.ts b/client/src/app/+about/about-instance/contact-admin-modal.component.ts
index 7d79c2215..c609c98c3 100644
--- a/client/src/app/+about/about-instance/contact-admin-modal.component.ts
+++ b/client/src/app/+about/about-instance/contact-admin-modal.component.ts
@@ -39,6 +39,7 @@ export class ContactAdminModalComponent extends FormReactive implements OnInit {
39 this.buildForm({ 39 this.buildForm({
40 fromName: this.instanceValidatorsService.FROM_NAME, 40 fromName: this.instanceValidatorsService.FROM_NAME,
41 fromEmail: this.instanceValidatorsService.FROM_EMAIL, 41 fromEmail: this.instanceValidatorsService.FROM_EMAIL,
42 subject: this.instanceValidatorsService.SUBJECT,
42 body: this.instanceValidatorsService.BODY 43 body: this.instanceValidatorsService.BODY
43 }) 44 })
44 } 45 }
@@ -58,9 +59,10 @@ export class ContactAdminModalComponent extends FormReactive implements OnInit {
58 sendForm () { 59 sendForm () {
59 const fromName = this.form.value['fromName'] 60 const fromName = this.form.value['fromName']
60 const fromEmail = this.form.value[ 'fromEmail' ] 61 const fromEmail = this.form.value[ 'fromEmail' ]
62 const subject = this.form.value[ 'subject' ]
61 const body = this.form.value[ 'body' ] 63 const body = this.form.value[ 'body' ]
62 64
63 this.instanceService.contactAdministrator(fromEmail, fromName, body) 65 this.instanceService.contactAdministrator(fromEmail, fromName, subject, body)
64 .subscribe( 66 .subscribe(
65 () => { 67 () => {
66 this.notifier.success(this.i18n('Your message has been sent.')) 68 this.notifier.success(this.i18n('Your message has been sent.'))