Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

front: fix track selection after timestops changes #10624

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion front/src/reducers/osrdconf/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { v4 as uuidV4 } from 'uuid';

import { calculateDistanceAlongTrack } from 'applications/editor/tools/utils';
import type { ManageTrainSchedulePathProperties } from 'applications/operationalStudies/types';
import type { OperationalPointReference } from 'common/api/osrdEditoastApi';
import { pathStepMatchesOp } from 'modules/pathfinding/utils';
import type { SuggestedOP } from 'modules/trainschedule/components/ManageTrainSchedule/types';
import { addElementAtIndex } from 'utils/array';
Expand Down Expand Up @@ -90,7 +91,12 @@ export function upsertPathStep(statePathSteps: (PathStep | null)[], op: Suggeste
if (stepIndex >= 0) {
// Because of import issues, there can be multiple ops with same position on path
// To avoid updating the wrong one, we need to find the one that matches the payload
newVia = { ...newVia, id: cleanPathSteps[stepIndex].id }; // We don't need to change the id of the updated via
newVia = {
...newVia,
id: cleanPathSteps[stepIndex].id,
track_reference:
(cleanPathSteps[stepIndex] as OperationalPointReference).track_reference || undefined,
}; // We don't need to change the id of the updated via
statePathSteps[stepIndex] = newVia;
} else {
// Because of import issues, there can be multiple ops at position 0
Expand Down
Loading