diff --git a/functions/src/emails/template/relancePaiement.ts b/functions/src/emails/template/relancePaiement.ts index 0434e38..3f8d59f 100644 --- a/functions/src/emails/template/relancePaiement.ts +++ b/functions/src/emails/template/relancePaiement.ts @@ -1,6 +1,6 @@ import { Configuration } from '../../model'; -export default (partner: Record, configuration: Configuration) => { +export default (partner: Record, configuration: Configuration) => { return { subject: `Partenariat ${configuration.gdg.event} ${configuration.convention.edition}: Relance Paiement`, body: ` diff --git a/functions/src/emails/template/step-3-payment-received.ts b/functions/src/emails/template/step-3-payment-received.ts index 2c7ab20..384ed2d 100644 --- a/functions/src/emails/template/step-3-payment-received.ts +++ b/functions/src/emails/template/step-3-payment-received.ts @@ -1,6 +1,6 @@ import { Configuration } from '../../model'; -export default (company: any, id: string, configuration: Configuration) => { +export default (company: unknown, id: string, configuration: Configuration) => { const adress_cms4devfest = `${configuration.hosting.baseurl}/partner/${id}`; return { diff --git a/functions/src/utils/files.ts b/functions/src/utils/files.ts index 85924f5..f207b86 100644 --- a/functions/src/utils/files.ts +++ b/functions/src/utils/files.ts @@ -46,7 +46,7 @@ export async function generateAndStoreInvoice(firestore: FirebaseFirestore.Fires }, configuration ); - const publicInvoiceUrl = await storeFile('facture/', invoice as any); + const publicInvoiceUrl = await storeFile('facture/', invoice); await firestore .doc('companies-2025/' + id) diff --git a/functions/src/utils/mail.ts b/functions/src/utils/mail.ts index a278e89..1f70acc 100644 --- a/functions/src/utils/mail.ts +++ b/functions/src/utils/mail.ts @@ -13,7 +13,7 @@ export function getFrom(mail: Email): { export function sendEmailToAllContacts(company: Company, emailFactory: { subject: string; body: string }, configuration: Configuration) { let emails = [configuration.mail.cc]; - if (configuration.mail.enabled === 'true') { + if (configuration.mail.enabled) { emails = [...emails, ...company.email]; } return Promise.all( diff --git a/public/src/app/model/company.ts b/public/src/app/model/company.ts index f3bdd5d..062df14 100644 --- a/public/src/app/model/company.ts +++ b/public/src/app/model/company.ts @@ -96,4 +96,4 @@ export interface Company { standPhoneNumber?: string; } -export type PartnerType = 'esn' | 'other'; +export type PartnerType = 'esn' | 'other' | null | undefined; diff --git a/public/src/app/ui/admin-filled/admin-filled.component.html b/public/src/app/ui/admin-filled/admin-filled.component.html index cb02c63..c6d0335 100644 --- a/public/src/app/ui/admin-filled/admin-filled.component.html +++ b/public/src/app/ui/admin-filled/admin-filled.component.html @@ -1,15 +1,15 @@ -
+
Type de société - -
-
- -
+
+ +
+ diff --git a/public/src/app/ui/admin-filled/admin-filled.component.ts b/public/src/app/ui/admin-filled/admin-filled.component.ts index f0ff0f9..f363deb 100644 --- a/public/src/app/ui/admin-filled/admin-filled.component.ts +++ b/public/src/app/ui/admin-filled/admin-filled.component.ts @@ -1,6 +1,6 @@ import { CommonModule } from '@angular/common'; -import { Component, inject, input } from '@angular/core'; -import { FormsModule } from '@angular/forms'; +import { Component, computed, inject, input } from '@angular/core'; +import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatIconModule } from '@angular/material/icon'; @@ -11,7 +11,7 @@ import { PartnerService } from '../../services/partner.service'; @Component({ selector: 'cms-admin-filled', - imports: [CommonModule, MatFormFieldModule, FormsModule, MatButtonModule, MatInputModule, MatIconModule], + imports: [CommonModule, MatFormFieldModule, ReactiveFormsModule, MatButtonModule, MatInputModule, MatIconModule], templateUrl: './admin-filled.component.html' }) export class AdminFilledComponent { @@ -20,10 +20,17 @@ export class AdminFilledComponent { readonly step = input(); private readonly partnerService = inject(PartnerService); + private readonly formBuilder = inject(FormBuilder); + + form = computed(() => { + return this.formBuilder.group({ + type: new FormControl((this.company as unknown as Company)?.type) + }); + }); update() { - this.partnerService.update(this.id()!, { - type: this.company()?.type + this.partnerService.update(this.id as unknown as string, { + ...this.form().value }); } }