Skip to content

front: fix deletion of empty pathStepItem in ItineraryModal#16009

Open
RomainValls wants to merge 1 commit intodevfrom
rvs/front-fix-delete-empty-pathitem
Open

front: fix deletion of empty pathStepItem in ItineraryModal#16009
RomainValls wants to merge 1 commit intodevfrom
rvs/front-fix-delete-empty-pathitem

Conversation

@RomainValls
Copy link
Copy Markdown
Contributor

@RomainValls RomainValls commented Mar 30, 2026

closes #15949

reminder for the review: there should always be at least two lines of pathStepItem : the first and the trailing path step.

Signed-off-by: romainvalls <romain.valls95@gmail.com>
@RomainValls RomainValls requested a review from a team as a code owner March 30, 2026 14:47
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Mar 30, 2026
resetOpSuggestions();

if (activeStepId === stepId) setActiveStepId('');
if (pathSteps.length === 2) return;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (pathSteps.length === 2) return;

You don't need this early return. You only call this function when hasSingleStepWithTrailing is false, meaning you'll have at least 3 pathSteps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Work on Standard OSRD Interface modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Itinerary modal: empty lines or lines with only one filled OP cannot be deleted

2 participants