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 train edition setup #9826

Merged
merged 1 commit into from
Nov 26, 2024
Merged

front: fix train edition setup #9826

merged 1 commit into from
Nov 26, 2024

Conversation

clarani
Copy link
Contributor

@clarani clarani commented Nov 22, 2024

closes #9805

Since recently, when opening the view to edit a train, a pathfinding request is automatically launched. But it is launched before the store update, which creates the bug: the pathfinding is launched with the pathsteps stored in the store (and not the ones of the train we want to edit) and once the pathfinding request is finished, we update the store with the result of the request (and erase the path steps of the currently selected train).

To fix this, we can directly update the store before opening the ManageTrainSchedule view.

@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Nov 22, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 82.22222% with 16 lines in your changes missing coverage. Please review.

Project coverage is 37.85%. Comparing base (e32c89b) to head (e18a810).
Report is 35 commits behind head on dev.

Files with missing lines Patch % Lines
...alStudies/hooks/useSetupItineraryForTrainUpdate.ts 14.28% 6 Missing ⚠️
...ules/trainschedule/helpers/computeBasePathSteps.ts 88.46% 6 Missing ⚠️
...hedule/components/Timetable/TimetableTrainCard.tsx 0.00% 3 Missing ⚠️
...nalStudies/helpers/formatTrainScheduleSummaries.ts 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9826      +/-   ##
==========================================
+ Coverage   37.82%   37.85%   +0.03%     
==========================================
  Files         994      994              
  Lines       91126    91167      +41     
  Branches     1176     1191      +15     
==========================================
+ Hits        34468    34514      +46     
+ Misses      56204    56199       -5     
  Partials      454      454              
Flag Coverage Δ
editoast 72.97% <ø> (-0.05%) ⬇️
front 20.20% <82.22%> (+0.09%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@clarani clarani force-pushed the cni/9805-fix-update-train branch 3 times, most recently from 66abf82 to 95f3780 Compare November 22, 2024 15:58
@clarani clarani marked this pull request as ready for review November 22, 2024 15:58
@clarani clarani requested a review from a team as a code owner November 22, 2024 15:58
@clarani clarani requested review from kmer2016 and Caracol3 November 22, 2024 15:59
Copy link
Contributor

@Caracol3 Caracol3 left a comment

Choose a reason for hiding this comment

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

lgtm (tested)

Since recently, when opening the view to edit a train, a pathfinding request is automatically launched. But it is launched
before the store update, which creates the bug: the pathfinding is launched with the pathsteps stored in the store (and not the ones
of the train we want to edit) and once the pathfinding request is finished, we update the store with the result of the request (and erase
the path steps of the currently selected train).

To fix this, we can directly update the store before opening the ManageTrainSchedule view.

Signed-off-by: Clara Ni <[email protected]>
@clarani clarani force-pushed the cni/9805-fix-update-train branch from 95f3780 to e18a810 Compare November 25, 2024 13:37
Copy link
Contributor

@kmer2016 kmer2016 left a comment

Choose a reason for hiding this comment

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

LGTM !

@clarani clarani added this pull request to the merge queue Nov 26, 2024
Merged via the queue into dev with commit d1ab92c Nov 26, 2024
27 checks passed
@clarani clarani deleted the cni/9805-fix-update-train branch November 26, 2024 09:58
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.

can't set or get the route of an invalid train schedule
4 participants