Skip to content

Commit

Permalink
front: remove uppercase translation
Browse files Browse the repository at this point in the history
Signed-off-by: Achraf Mohyeddine <[email protected]>
  • Loading branch information
achrafmohye committed Oct 31, 2024
1 parent 55daa1f commit f3d61a0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
8 changes: 4 additions & 4 deletions front/public/locales/en/stdcm.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
"gesicoRequest": "and attach this document to your GESICO DSDM request.",
"notFound": "No solution was found for this configuration",
"conflictsTitle": "Here are the problems encountered when calculating the shortest path:",
"trackConflict": "Conflict with a train path between <strong>{{waypointBefore}}</strong> and <strong>{{waypointAfter}}</strong> from {{startDate}} at {{startTime}} to {{endDate}} at {{endTime}}",
"trackConflictSameDay": "Conflict with a train path between <strong>{{waypointBefore}}</strong> and <strong>{{waypointAfter}}</strong> on {{startDate}} between {{startTime}} and {{endTime}}",
"trackConflict": "conflict with a train path between <strong>{{waypointBefore}}</strong> and <strong>{{waypointAfter}}</strong> from {{startDate}} at {{startTime}} to {{endDate}} at {{endTime}}",
"trackConflictSameDay": "conflict with a train path between <strong>{{waypointBefore}}</strong> and <strong>{{waypointAfter}}</strong> on {{startDate}} between {{startTime}} and {{endTime}}",
"remainingTrackConflicts": "{{count}} other conflicts with other train paths",
"remainingTrackConflicts_one": "one other conflict with another train path",
"remainingWorkConflicts": "{{count}} other works in conflict",
"remainingWorkConflicts_one": "one other work in conflict",
"workConflictSameDay": "Scheduled work from <strong>{{waypointBefore}}</strong> to <strong>{{waypointAfter}}</strong> on {{startDate}} between {{startTime}} and {{endTime}}",
"workConflict": "Scheduled work from <strong>{{waypointBefore}}</strong> to <strong>{{waypointAfter}}</strong> from {{startDate}} at {{startTime}} to {{endDate}} at {{endTime}}",
"workConflictSameDay": "scheduled work from <strong>{{waypointBefore}}</strong> to <strong>{{waypointAfter}}</strong> on {{startDate}} between {{startTime}} and {{endTime}}",
"workConflict": "scheduled work from <strong>{{waypointBefore}}</strong> to <strong>{{waypointAfter}}</strong> from {{startDate}} at {{startTime}} to {{endDate}} at {{endTime}}",
"changeSearchCriteria": "You can modify your search criteria to find a solution",
"retainThisSimulation": "Retain this simulation",
"simulationName": {
Expand Down
17 changes: 10 additions & 7 deletions front/src/applications/stdcm/hooks/useStdcmResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { useEffect, useMemo } from 'react';

import { useSelector } from 'react-redux';

import type { StdcmPathProperties } from 'applications/stdcm/types';
import type { StdcmResponse } from 'applications/stdcm/types';
import type { StdcmPathProperties, StdcmResponse } from 'applications/stdcm/types';
import {
osrdEditoastApi,
type PathfindingResultSuccess,
Expand Down Expand Up @@ -44,12 +43,17 @@ const useStdcmResults = (
);

const {
path,
path: pathFinding,
simulation,
departure_time: departureTime,
} = stdcmResponse?.status === 'success' ? stdcmResponse : {};

const speedSpaceChartData = useSpeedSpaceChart(stdcmTrainResult, path, simulation, departureTime);
const speedSpaceChartData = useSpeedSpaceChart(
stdcmTrainResult,
pathFinding,
simulation,
departureTime
);

useEffect(() => {
const getPathProperties = async (_infraId: number, path: PathfindingResultSuccess) => {
Expand Down Expand Up @@ -84,9 +88,8 @@ const useStdcmResults = (
}
};

if (infraId && stdcmResponse) {
const { path } = stdcmResponse;
getPathProperties(infraId, path);
if (infraId && stdcmResponse && pathFinding) {
getPathProperties(infraId, pathFinding);
}
}, [stdcmResponse]);

Expand Down
2 changes: 1 addition & 1 deletion front/src/applications/stdcm/utils/formatConflicts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type ConflictsData = {
workConflictsData: (ConflictWithInterval & { workScheduleIds: number[] })[];
};

/** Helper function to find the closest operational point before or after a given positiont */
/** Helper function to find the closest operational point before or after a given position */
export const findClosestOperationalPoint = (
operationalPoints: SuggestedOP[],
position: number,
Expand Down
7 changes: 5 additions & 2 deletions front/src/applications/stdcm/utils/simulationOutputUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { StdcmPathProperties } from 'applications/stdcm/types';
import type { StdcmSimulationOutputs, StdcmSuccessResponse } from 'applications/stdcm/types';
import type {
StdcmSimulationOutputs,
StdcmSuccessResponse,
StdcmPathProperties,
} from 'applications/stdcm/types';
import type { Conflict } from 'common/api/osrdEditoastApi';
import type { SpeedSpaceChartData } from 'modules/simulationResult/types';

Expand Down

0 comments on commit f3d61a0

Please sign in to comment.