Skip to content

Commit

Permalink
fix comments 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Akctarus committed May 15, 2024
1 parent e54cc9a commit 94d60a9
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -133,7 +133,7 @@ const SimulationReportSheet = ({
</View>
<Text style={styles.convoyAndRoute.fromNumber}>{fakeInformation.path_number1}</Text>
<Text style={styles.convoyAndRoute.fromScheduled}>
{t('scheduledArrival')} {arrivalTime}
{`${t('scheduledArrival')} ${arrivalTime}`}
</Text>
</View>
<View style={styles.convoyAndRoute.stopTableContainer}>
Expand Down Expand Up @@ -203,7 +203,7 @@ const SimulationReportSheet = ({
</View>
<View style={styles.convoyAndRoute.forBanner}>
<Text style={styles.convoyAndRoute.forScheduled}>
{t('scheduledDeparture')} {departureTime}
{`${t('scheduledDeparture')} ${departureTime}`}
</Text>
<Text style={styles.convoyAndRoute.forNumber}>{fakeInformation.path_number2}</Text>
<View style={styles.convoyAndRoute.forBox}>
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
3 changes: 1 addition & 2 deletions front/src/applications/stdcm/utils.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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();
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed front/src/assets/simulationSheet/icon_alert_fill.png
Binary file not shown.
Binary file not shown.

0 comments on commit 94d60a9

Please sign in to comment.