Skip to content

Commit 8b5b459

Browse files
committed
front+editoast: remove route starting direction parameter
1 parent ce3730b commit 8b5b459

File tree

5 files changed

+6
-37
lines changed

5 files changed

+6
-37
lines changed

editoast/openapi.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -4144,12 +4144,7 @@ paths:
41444144
ending:
41454145
$ref: '#/components/schemas/TrackLocation'
41464146
starting:
4147-
allOf:
4148-
- $ref: '#/components/schemas/TrackLocation'
4149-
- properties:
4150-
direction:
4151-
$ref: '#/components/schemas/Direction'
4152-
type: object
4147+
$ref: '#/components/schemas/TrackLocation'
41534148
type: object
41544149
description: Starting and ending track location
41554150
responses:

editoast/openapi_legacy.yaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -642,12 +642,7 @@ paths:
642642
type: object
643643
properties:
644644
starting:
645-
allOf:
646-
- $ref: "#/components/schemas/TrackLocation"
647-
- type: object
648-
properties:
649-
direction:
650-
$ref: "#/components/schemas/Direction"
645+
$ref: "#/components/schemas/TrackLocation"
651646
ending:
652647
$ref: "#/components/schemas/TrackLocation"
653648
responses:

editoast/src/views/infra/pathfinding.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ enum PathfindingViewErrors {
4545
struct PathfindingTrackLocationDirInput {
4646
track: Identifier,
4747
position: f64,
48-
direction: Direction,
4948
}
5049

5150
#[derive(Debug, Clone, Deserialize)]
@@ -128,11 +127,11 @@ struct PathfindingStep {
128127
}
129128

130129
impl PathfindingStep {
131-
fn new_init(track: String, position: f64, direction: Direction) -> Self {
130+
fn new_init(track: String, position: f64) -> Self {
132131
Self {
133132
track,
134133
position,
135-
direction,
134+
direction: Direction::StartToStop, // Ignored for initial node
136135
switch_direction: None,
137136
found: false,
138137
starting_step: true,
@@ -185,7 +184,7 @@ fn compute_path(
185184
k: u8,
186185
) -> Vec<PathfindingOutput> {
187186
let start = &input.starting;
188-
let start = PathfindingStep::new_init(start.track.0.clone(), start.position, start.direction);
187+
let start = PathfindingStep::new_init(start.track.0.clone(), start.position);
189188

190189
let track_sections = infra_cache.track_sections();
191190
// Transform a length (in m) into a cost (in mm). This provide the Ord implementation for our cost using u64.
@@ -403,7 +402,6 @@ mod tests {
403402
starting: PathfindingTrackLocationDirInput {
404403
track: "A".into(),
405404
position: 30.0,
406-
direction: Direction::StartToStop,
407405
},
408406
ending: PathfindingTrackLocationInput {
409407
track: "C".into(),
@@ -427,7 +425,6 @@ mod tests {
427425
starting: PathfindingTrackLocationDirInput {
428426
track: "A".into(),
429427
position: 30.0,
430-
direction: Direction::StopToStart,
431428
},
432429
ending: PathfindingTrackLocationInput {
433430
track: "C".into(),

front/src/applications/editor/tools/routeEdition/components/Endpoints.tsx

-16
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,6 @@ export const EditEndpoints: FC<{ state: RouteState; onChange: (newState: RouteSt
4545
wayPoint={entryPoint}
4646
onChange={(wayPoint) => onChange({ ...state, entryPoint: wayPoint })}
4747
/>
48-
{entryPoint && (
49-
<div className="d-flex flex-row align-items-baseline justify-content-center mb-2">
50-
<span className="mr-2">{t('Editor.tools.routes-edition.start_direction')}</span>
51-
<Select
52-
value={option}
53-
options={options}
54-
onChange={(o) => {
55-
if (o)
56-
onChange({
57-
...state,
58-
entryPointDirection: o.value,
59-
});
60-
}}
61-
/>
62-
</div>
63-
)}
6448
<div className="text-center">
6549
<button
6650
type="button"

front/src/common/api/osrdEditoastApi.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -905,9 +905,7 @@ export type PostInfraByIdPathfindingApiArg = {
905905
/** Starting and ending track location */
906906
body: {
907907
ending?: TrackLocation;
908-
starting?: TrackLocation & {
909-
direction?: Direction;
910-
};
908+
starting?: TrackLocation;
911909
};
912910
};
913911
export type GetInfraByIdRailjsonApiResponse =

0 commit comments

Comments
 (0)