diff --git a/front/src/applications/operationalStudies/components/MacroEditor/import.ts b/front/src/applications/operationalStudies/components/MacroEditor/import.ts index 18749e5d0de..d21a1cf1985 100644 --- a/front/src/applications/operationalStudies/components/MacroEditor/import.ts +++ b/front/src/applications/operationalStudies/components/MacroEditor/import.ts @@ -241,6 +241,18 @@ const importTimetable = async ( return port; }; + let transitionId = 0; + const createTransition = (port1Id: number, port2Id: number) => { + const transition = { + id: transitionId, + port1Id, + port2Id, + isNonStopTransit: false, + }; + transitionId += 1; + return transition; + }; + let trainrunSectionId = 0; const trainrunSections: TrainrunSection[] = trainSchedules .map((trainSchedule) => { diff --git a/front/src/applications/operationalStudies/components/MacroEditor/types.ts b/front/src/applications/operationalStudies/components/MacroEditor/types.ts index 31c494e1d66..a3b93e705f0 100644 --- a/front/src/applications/operationalStudies/components/MacroEditor/types.ts +++ b/front/src/applications/operationalStudies/components/MacroEditor/types.ts @@ -14,7 +14,7 @@ export type Node = { positionX: number; positionY: number; ports: Port[]; - transitions: unknown[]; + transitions: Transition[]; connections: unknown[]; resourceId: number; /** Number of tracks where train can stop */ @@ -34,6 +34,13 @@ export type Port = { trainrunSectionId: number; }; +export type Transition = { + id: number; + port1Id: number; + port2Id: number; + isNonStopTransit: boolean; +}; + export enum PortAlignment { Top, Bottom,