Skip to content

Commit

Permalink
Add SE logo
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Jun 28, 2024
1 parent 41dacfd commit 9e9a24a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ describe('PriorNotificationCard/utils.getHtmlContent()', () => {
<img id="logo_cnsp" src="logo_cnsp.jpg" alt="Logo CNSP"/>
</td>
<td>
<img id="logo_se_mer", src="logo_se_mer.jpg" alt="Logo Secretariat d'Etat chargé de la Mer et de la Biodiversité"/>
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ export function DownloadButton({ isDisabled = false, pnoLogbookMessage }: Downlo
})
}, [getGearsApiQuery.data, pnoLogbookMessage?.tripGears])

const downloadPDF = () => {
const downloadPDF = async () => {
const htmlContent = await getHtmlContent(pnoLogbookMessage, gearsWithName)

printJS({
documentTitle: `preavis_entree_port_debarquement_${customDayjs().utc().format('DDMMYYYY')}.pdf`,
printable: getHtmlContent(pnoLogbookMessage, gearsWithName),
printable: htmlContent,
style: HTML_STYLE,
type: 'raw-html'
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export const HTML_TEMPLATE = `
<p>PREAVIS - {purpose}</p>
<p>
{vesselName}
<img id="state_flag_icon" src="flags/{flagState}.png" />
<img rel="preload" id="state_flag_icon" src="{flagStateFilePath}" />
{svg}
</p>
</h1>
<ul id="vessel_ids_list">
Expand Down Expand Up @@ -89,6 +90,7 @@ export const HTML_TEMPLATE = `
<img id="logo_cnsp" src="logo_cnsp.jpg" alt="Logo CNSP"/>
</td>
<td>
<img id="logo_se_mer" src="logo_se_mer.jpg" alt="Logo Secretariat d'Etat chargé de la Mer et de la Biodiversité"/>
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export function getHtmlContent(
const data = {
catchDetails,
externalReferenceNumber: pno.externalReferenceNumber ?? 'Aucun',
flagState: getAlpha2CodeFromAlpha2or3Code(pno.flagState)?.toLowerCase() ?? 'unknown',
flagStateFilePath: getAlpha2CodeFromAlpha2or3Code(pno.flagState)
? `flags/${getAlpha2CodeFromAlpha2or3Code(pno.flagState)?.toLowerCase()}.png`
: 'flags/unknown.png',
gearDetails,
imo: pno.imo ?? 'Aucun',
internalReferenceNumber: pno.internalReferenceNumber ?? 'Aucun',
Expand Down

0 comments on commit 9e9a24a

Please sign in to comment.