Conversation
Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
The previous computation wasn't working in the following cases: - the train has no stops (because of the `+1` at the end) - the train has several 0s stops (because it filters stops that last zero seconds) This commit copies the `stopsCount` computation for paced trains here: https://github.com/OpenRailAssociation/osrd/blob/c33666ef215468065858cf70036a01434cd52d9c/front/src/applications/operationalStudies/views/Scenario/components/Timetable/PacedTrain/hooks/useOccurrences.ts#L59-L61 This commit also adds `stopsCount_zero` translation entries, otherwise train schedules with zero stops shows up as having one stop. Solves a part of this issue: #12372 Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
SharglutDev
left a comment
There was a problem hiding this comment.
Thanks for the fix !
This subject led to a lot of discussions in the office !
The majority agrees that the destination (regardless if there is a stop 0 on it) should not be counted in the "stops" displayed in "more details".
Would you mind to make the correction ?
Synar
left a comment
There was a problem hiding this comment.
Sharglut's point notwithstanding, the code lgtm!
@SharglutDev How would you differentiate trains that don't stop at their destination? or is that something we don't care about? will push the change either way |
Basically the stops displayed in "more details" should concern only the intermediate stops (to be iso with the round trip modal). So the destination should never be taken into account regardless if the train stops on it or not :) |
SharglutDev
left a comment
There was a problem hiding this comment.
Lgtm and tested, thanks for the last fix !
Since we changed the stop count behavior, you'll have to adapt the e2e test as well.
Signed-off-by: Hubert Hirtz <hubert@hirtz.pm>
The previous computation wasn't working in the following cases:
+1at the end)This commit copies the
stopsCountcomputation for paced trains here:osrd/front/src/applications/operationalStudies/views/Scenario/components/Timetable/PacedTrain/hooks/useOccurrences.ts
Lines 59 to 61 in c33666e
This commit also adds
stopsCount_zerotranslation entries, otherwise train schedules with zero stops shows up as having one stop.Solves a part of this issue: #12372
The other part is solved by: #15290
How to test
Example timetable on small infra:
timetable(14).json
Without this change, train schedules that have no stops, train schedules that have several zero-second stops and train schedules that have one zero-second stop at the end all show up as having one stop if you click on the "show more details" button at the top of the TS list.
With this change, the correct stop count should be shown for all train schedules.