diff --git a/front/.gitignore b/front/.gitignore index bbe8cfb8b6e..ae6ab20ed36 100644 --- a/front/.gitignore +++ b/front/.gitignore @@ -38,3 +38,6 @@ npm-debug.log* /.env # .env.local is up to the developer /.env.local + +# config overrides +/overrides diff --git a/front/src/applications/stdcm/components/StdcmHeader.tsx b/front/src/applications/stdcm/components/StdcmHeader.tsx index 986ee19e9d2..2256366c0ab 100644 --- a/front/src/applications/stdcm/components/StdcmHeader.tsx +++ b/front/src/applications/stdcm/components/StdcmHeader.tsx @@ -6,11 +6,22 @@ import { useSelector } from 'react-redux'; import { getIsSuperUser } from 'reducers/user/userSelectors'; import useDeploymentSettings from 'utils/hooks/useDeploymentSettings'; -const LogoSTDCM = ({ logo }: { logo: string | undefined }) => { - if (logo) { - return LMR Logo; +const LogoSTDCM = () => { + const deploymentSettings = useDeploymentSettings(); + + if (deploymentSettings) { + return deploymentSettings.stdcmLogo ? ( + LMR Logo + ) : ( + STDCM + ); } - return ST DCM; + return null; }; type StdcmHeaderProps = { @@ -28,11 +39,10 @@ const StdcmHeader = ({ }: StdcmHeaderProps) => { const { t } = useTranslation(['stdcm', 'translation']); const isSuperUser = useSelector(getIsSuperUser); - const { stdcmLogo } = useDeploymentSettings(); return (
- +
{t('stdcm:notificationTitle')} diff --git a/front/src/applications/stdcm/components/StdcmResults/SimulationReportSheet.tsx b/front/src/applications/stdcm/components/StdcmResults/SimulationReportSheet.tsx index 0f36bd41683..75fe19236cd 100644 --- a/front/src/applications/stdcm/components/StdcmResults/SimulationReportSheet.tsx +++ b/front/src/applications/stdcm/components/StdcmResults/SimulationReportSheet.tsx @@ -8,7 +8,6 @@ import logoSNCF from 'assets/simulationReportSheet/logo_sncf_reseau.png'; import i18n from 'i18n'; import type { StdcmPathStep } from 'reducers/osrdconf/types'; import { dateToHHMMSS, formatDateToString, formatDay } from 'utils/date'; -import useDeploymentSettings from 'utils/hooks/useDeploymentSettings'; import { msToKmh } from 'utils/physics'; import { capitalizeFirstLetter } from 'utils/strings'; import { secToMin } from 'utils/timeManipulation'; @@ -36,9 +35,10 @@ const getArrivalTimes = (step: StdcmPathStep, t: TFunction, shouldDisplay: boole return ''; }; -const LogoSTDCM = ({ logo, t }: { logo: string | undefined; t: TFunction }) => { - if (logo) { - return ; +const LogoSTDCM = ({ logoUrl }: { logoUrl?: string }) => { + const { t } = useTranslation(['stdcm-simulation-report-sheet']); + if (logoUrl) { + return ; } return ( <> @@ -54,8 +54,8 @@ const SimulationReportSheet = ({ consist, simulationReportSheetNumber, operationalPointsList, + deploymentSettings, }: SimulationReportSheetProps) => { - const { stdcmSimulationSheetLogo } = useDeploymentSettings(); const { t } = useTranslation(['stdcm-simulation-report-sheet', 'stdcm']); let renderedIndex = 0; @@ -77,7 +77,7 @@ const SimulationReportSheet = ({ - + diff --git a/front/src/applications/stdcm/components/StdcmResults/StdcmResults.tsx b/front/src/applications/stdcm/components/StdcmResults/StdcmResults.tsx index 9fb150f749e..362011ef244 100644 --- a/front/src/applications/stdcm/components/StdcmResults/StdcmResults.tsx +++ b/front/src/applications/stdcm/components/StdcmResults/StdcmResults.tsx @@ -46,7 +46,7 @@ const StcdmResults = ({ }: StcdmResultsProps) => { const infraId = useInfraID(); const { t } = useTranslation('stdcm', { keyPrefix: 'simulation.results' }); - const { stdcmName } = useDeploymentSettings(); + const deploymentSettings = useDeploymentSettings(); const selectedSimulation = useSelector(getSelectedSimulation); const retainedSimulationIndex = useSelector(getRetainedSimulationIndex); @@ -111,9 +111,10 @@ const StcdmResults = ({ consist={selectedSimulation.inputs.consist} simulationReportSheetNumber={simulationReportSheetNumber} operationalPointsList={operationalPointsList} + deploymentSettings={deploymentSettings} /> } - fileName={`${stdcmName}-${simulationReportSheetNumber}.pdf`} + fileName={`${deploymentSettings?.stdcmName || 'Stdcm'}-${simulationReportSheetNumber}.pdf`} >