From 7c8f0ecb1694713f39a4ff66ba8d7914a14f82e4 Mon Sep 17 00:00:00 2001 From: vktrrdk Date: Tue, 29 Oct 2024 15:16:33 +0000 Subject: [PATCH 1/3] wip: project types, publication consents for images and contact mail --- src/app/api-connector/news.service.ts | 16 ++-- .../testimonial-form.component.html | 75 +++++++++++++++++-- .../testimonial-form.component.ts | 68 ++++++++++------- 3 files changed, 121 insertions(+), 38 deletions(-) diff --git a/src/app/api-connector/news.service.ts b/src/app/api-connector/news.service.ts index 00ca52782a..f3dce8b673 100644 --- a/src/app/api-connector/news.service.ts +++ b/src/app/api-connector/news.service.ts @@ -119,11 +119,14 @@ export class NewsService { image_url: string, project_application_id: string, soc_consents: SocialConsent[], - file: File + soc_photo_consents: SocialConsent[], + file: File, + contact_mail: string ): Observable { const consents_list = soc_consents.map(soc => soc.id) + const photo_consents_list = soc_photo_consents.map(soc => soc.id) const consents = JSON.stringify(consents_list) - + const photo_consents = JSON.stringify(photo_consents_list) const formData: FormData = new FormData() formData.append('file', file) formData.append('title', title) @@ -135,7 +138,8 @@ export class NewsService { formData.append('simple_vm', JSON.stringify(simple_vm)) formData.append('project_application_id', project_application_id) formData.append('consents', consents) - console.log(formData) + formData.append('photo_consents', photo_consents) + formData.append('contact_mail', contact_mail) return this.http.post(`${ApiSettings.getApiBaseURL()}wagtail-management/testimonial/`, formData, { withCredentials: true @@ -151,7 +155,8 @@ export class NewsService { workgroup: string, simple_vm: boolean, project_application_id: string, - soc_consents: SocialConsent[] + soc_consents: SocialConsent[], + photo_consents: SocialConsent[] ): Observable { const consents_list = soc_consents.map(soc => soc.id) const consents = JSON.stringify(consents_list) @@ -165,7 +170,8 @@ export class NewsService { workgroup, simple_vm, project_application_id, - consents + consents, + photo_consents } return this.http.post( diff --git a/src/app/shared/shared_modules/testimonial-forms/testimonial-form.component.html b/src/app/shared/shared_modules/testimonial-forms/testimonial-form.component.html index f6764f6c01..3d1d3311cd 100644 --- a/src/app/shared/shared_modules/testimonial-forms/testimonial-form.component.html +++ b/src/app/shared/shared_modules/testimonial-forms/testimonial-form.component.html @@ -57,7 +57,7 @@
Add testimonial draft
type="text" [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_title?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_title?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_title?.valid, }" /> @@ -81,7 +81,7 @@
Add testimonial draft
rows="20" [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_text?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_text?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_text?.valid, }" class="form-control" name="testimonial_text" @@ -119,7 +119,7 @@
Add testimonial draft
rows="4" [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_excerpt?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_excerpt?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_excerpt?.valid, }" > @@ -157,7 +157,7 @@
Add testimonial draft
required [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_contributor?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_contributor?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_contributor?.valid, }" /> @@ -195,7 +195,7 @@
Add testimonial draft
required [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_instituton?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_institution?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_institution?.valid, }" /> @@ -225,7 +225,7 @@
Add testimonial draft
required [ngClass]="{ 'is-invalid': testimonialFormGroup.controls.testimonial_workgroup?.invalid, - 'is-valid': testimonialFormGroup.controls.testimonial_workgroup?.valid + 'is-valid': testimonialFormGroup.controls.testimonial_workgroup?.valid, }" /> @@ -272,7 +272,7 @@
Add testimonial draft
Please indicate here on which channels/platforms we may publish your testimonial or information about your - testimonial. The website channels are selected by default and cannot be deselected as a channel. + testimonial. Please consider allowing the testimonial and testimonial information to be published on channels + where you do not authorize the use of the photo. The websites channel is selected by default and cannot be + deselected as a channel. +
+ + +
+
+ +
+
+
+
+ + +
+
+ + +
+
+
+ Please indicate here on which channels/platforms we may publish the photography uploaded for the testimonial. + The websites channel is selected by default and cannot be deselected as a channel.
@@ -359,6 +406,18 @@
Add testimonial draft