diff --git a/front/public/locales/en/stdcm-simulation-sheet.json b/front/public/locales/en/stdcm-simulation-report-sheet.json similarity index 100% rename from front/public/locales/en/stdcm-simulation-sheet.json rename to front/public/locales/en/stdcm-simulation-report-sheet.json diff --git a/front/public/locales/fr/stdcm-simulation-sheet.json b/front/public/locales/fr/stdcm-simulation-report-sheet.json similarity index 100% rename from front/public/locales/fr/stdcm-simulation-sheet.json rename to front/public/locales/fr/stdcm-simulation-report-sheet.json diff --git a/front/public/locales/fr/stdcm.json b/front/public/locales/fr/stdcm.json index 144bca327c9..5b84a35a5df 100644 --- a/front/public/locales/fr/stdcm.json +++ b/front/public/locales/fr/stdcm.json @@ -9,5 +9,5 @@ "stdcmErrorNoPaths": "Incompatibilité avec d'autres sillons.", "stdcmNoResults": "Aucun sillon trouvé", "stdcmResults": "Résultats", - "stdcmSimulationReport": "Fiche de simulation" + "stdcmSimulationReport": "Fiche simulation" } diff --git a/front/src/applications/stdcm/components/SimulationReportSheet.tsx b/front/src/applications/stdcm/components/SimulationReportSheet.tsx index 08cdd52d184..375a683ae9a 100644 --- a/front/src/applications/stdcm/components/SimulationReportSheet.tsx +++ b/front/src/applications/stdcm/components/SimulationReportSheet.tsx @@ -4,8 +4,8 @@ import { Table, TR, TH, TD } from '@ag-media/react-pdf-table'; import { Page, Text, Image, Document, View } from '@react-pdf/renderer'; import { useTranslation } from 'react-i18next'; -import iconAlert from 'assets/simulationSheet/icon_alert_fill.png'; -import logoSNCF from 'assets/simulationSheet/logo_sncf_reseau.png'; +import iconAlert from 'assets/simulationReportSheet/icon_alert_fill.png'; +import logoSNCF from 'assets/simulationReportSheet/logo_sncf_reseau.png'; import type { PostStdcmApiResponse, RollingStockWithLiveries } from 'common/api/osrdEditoastApi'; import { formatDay } from 'utils/date'; import { getStopDurationTime, getStopTime } from 'utils/timeManipulation'; @@ -26,7 +26,7 @@ const SimulationReportSheet = ({ number, mapCanvas, }: SimulationReportSheetProps) => { - const { t } = useTranslation('stdcm-simulation-sheet'); + const { t } = useTranslation('stdcm-simulation-report-sheet'); const creationDate = t('formattedDate', formatCreationDate(stdcmData.path.created)); let renderedIndex = 0; @@ -53,26 +53,26 @@ const SimulationReportSheet = ({ return ( - - - {t('simulation')} - {t('warningMessage')} + + + {t('simulation')} + {t('warningMessage')} - - - - {t('stdcm')} - {t('stdcmCreation')} + + + + {t('stdcm')} + {t('stdcmCreation')} - - + + n° {number} - {creationDate} + {creationDate} - + @@ -133,7 +133,7 @@ const SimulationReportSheet = ({ {fakeInformation.path_number1} - {t('scheduledArrival')} {arrivalTime} + {`${t('scheduledArrival')} ${arrivalTime}`} @@ -203,7 +203,7 @@ const SimulationReportSheet = ({ - {t('scheduledDeparture')} {departureTime} + {`${t('scheduledDeparture')} ${departureTime}`} {fakeInformation.path_number2} @@ -348,8 +348,8 @@ const SimulationReportSheet = ({ - - {t('withoutWarranty')} + + {t('withoutWarranty')} diff --git a/front/src/applications/stdcm/components/SimulationReportStyleSheet.ts b/front/src/applications/stdcm/components/SimulationReportStyleSheet.ts index 599be15ea7c..5a65cdb13f8 100644 --- a/front/src/applications/stdcm/components/SimulationReportStyleSheet.ts +++ b/front/src/applications/stdcm/components/SimulationReportStyleSheet.ts @@ -1,14 +1,14 @@ import { StyleSheet, Font } from '@react-pdf/renderer'; -import IBMPlexMonoBold from 'assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf'; -import IBMPlexMonoMedium from 'assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf'; -import IBMPlexMonoRegular from 'assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf'; -import IBMPlexMonoSemiBold from 'assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf'; -import IBMPlexSansBold from 'assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf'; -import IBMPlexSansItalic from 'assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf'; -import IBMPlexSansMedium from 'assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf'; -import IBMPlexSansRegular from 'assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf'; -import IBMPlexSansSemiBold from 'assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf'; +import IBMPlexMonoBold from 'assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf'; +import IBMPlexMonoMedium from 'assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf'; +import IBMPlexMonoRegular from 'assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf'; +import IBMPlexMonoSemiBold from 'assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf'; +import IBMPlexSansBold from 'assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf'; +import IBMPlexSansItalic from 'assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf'; +import IBMPlexSansMedium from 'assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf'; +import IBMPlexSansRegular from 'assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf'; +import IBMPlexSansSemiBold from 'assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf'; Font.register({ family: 'IBM Plex Sans', @@ -39,7 +39,7 @@ const styles = { fontFamily: 'IBM Plex Sans', }, }), - banner: StyleSheet.create({ + header: StyleSheet.create({ alertBanner: { height: '64', backgroundColor: '#000000', @@ -548,7 +548,7 @@ const styles = { backgroundColor: '#EBEBEA', }, }), - warranty: StyleSheet.create({ + footer: StyleSheet.create({ warrantyBox: { height: '64', marginTop: '16', diff --git a/front/src/applications/stdcm/utils.ts b/front/src/applications/stdcm/utils.ts index cbec220ec12..7bce203bb86 100644 --- a/front/src/applications/stdcm/utils.ts +++ b/front/src/applications/stdcm/utils.ts @@ -1,5 +1,5 @@ function generateRandomString(length: number): string { - return [...Array(length)].map(() => Math.floor(Math.random() * 10)).join(''); + return Array.from({ length }, () => Math.floor(Math.random() * 10)).join(''); } // TODO: The number must be calculated from a hash of stdcm inputs (to have a stable number). It is currently generated randomly, so there could be duplicates. @@ -12,7 +12,6 @@ export function generateCodeNumber(): string { return `${month}${year}-${randomPart1}-${randomPart2}`; } -// This function displays the date as : "DD/MM/YY à HH:MM" in french, and "YY/MM/DD at HH:MM" in english export function formatCreationDate(date: string) { const creationDate = new Date(date); const day = creationDate.getDate(); diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Bold.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Medium.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Mono/IBMPlexMono-SemiBold.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Bold.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Italic.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Medium.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-Regular.ttf diff --git a/front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf b/front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf similarity index 100% rename from front/src/assets/simulationSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf rename to front/src/assets/simulationReportSheet/fonts/IBM-Plex-Sans/IBMPlexSans-SemiBold.ttf diff --git a/front/src/assets/simulationReportSheet/icon_alert_fill.png b/front/src/assets/simulationReportSheet/icon_alert_fill.png new file mode 100644 index 00000000000..80363977d36 Binary files /dev/null and b/front/src/assets/simulationReportSheet/icon_alert_fill.png differ diff --git a/front/src/assets/simulationReportSheet/logo_sncf_reseau.png b/front/src/assets/simulationReportSheet/logo_sncf_reseau.png new file mode 100644 index 00000000000..c28b84e945d Binary files /dev/null and b/front/src/assets/simulationReportSheet/logo_sncf_reseau.png differ diff --git a/front/src/assets/simulationSheet/icon_alert_fill.png b/front/src/assets/simulationSheet/icon_alert_fill.png deleted file mode 100644 index 1ae933d0ed7..00000000000 Binary files a/front/src/assets/simulationSheet/icon_alert_fill.png and /dev/null differ diff --git a/front/src/assets/simulationSheet/logo_sncf_reseau.png b/front/src/assets/simulationSheet/logo_sncf_reseau.png deleted file mode 100644 index 2ca69f859a4..00000000000 Binary files a/front/src/assets/simulationSheet/logo_sncf_reseau.png and /dev/null differ