From 55a791b6589d25fdc7a55942964ef79a66d9aba5 Mon Sep 17 00:00:00 2001 From: shinework Date: Tue, 14 Jan 2025 20:45:55 +0100 Subject: [PATCH] feat: improvements --- web/components/pdfs/ApplicationInfos.tsx | 2 +- web/pages/api/pdfs/selected/[id].tsx | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/components/pdfs/ApplicationInfos.tsx b/web/components/pdfs/ApplicationInfos.tsx index aa53240..32186dd 100644 --- a/web/components/pdfs/ApplicationInfos.tsx +++ b/web/components/pdfs/ApplicationInfos.tsx @@ -8,7 +8,7 @@ const ApplicationInfo = ({ application }: { application: Application }) => { {Boolean(application?.already_supported) ? 'Oui' : 'Non'} diff --git a/web/pages/api/pdfs/selected/[id].tsx b/web/pages/api/pdfs/selected/[id].tsx index e6bdb6f..2205f5a 100644 --- a/web/pages/api/pdfs/selected/[id].tsx +++ b/web/pages/api/pdfs/selected/[id].tsx @@ -90,11 +90,15 @@ const buildApplicationsSpreadsheet = async (applications: Application[]) => { }) const websiteCell = row.getCell(11) - websiteCell.value = { - text: application.company.website, - hyperlink: application.company.website, + + if (application.company.website) { + websiteCell.value = { + text: application.company.website, + hyperlink: application.company.website, + } + websiteCell.font = { color: { argb: 'FF0000FF' }, underline: true } } - websiteCell.font = { color: { argb: 'FF0000FF' }, underline: true } + websiteCell.alignment = { vertical: 'top', horizontal: 'left' } }) @@ -157,6 +161,7 @@ const buildSummarySpreadsheet = async (applications: Application[]) => { ).toLocaleString('fr-FR', { month: 'long' })}`, applications: [ { + id: application.id, title: application.creation_title, name: `${application.creation_title} - ${application.company.choreographer} (${application.company.structureName})`, email: application.company.email, @@ -168,6 +173,7 @@ const buildSummarySpreadsheet = async (applications: Application[]) => { placesMap[place.id].espaces[espace.id].disponibilities[ application.disponibility.id ].applications.push({ + id: application.id, title: application.creation_title, name: `${application.creation_title} - ${application.company.choreographer} (${application.company.structureName})`, email: application.company.email,