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: add, get and delete paced trains #10966

Merged
merged 4 commits into from
Mar 24, 2025

Conversation

SharglutDev
Copy link
Contributor

@SharglutDev SharglutDev commented Feb 26, 2025

See commits (will be merged all together)

part of #10615

Note

PR is now testable !

As some logic from train schedule has been reused for the pace train mode, be sure to check that all previous behavior when paced train mode is off are still working (add/edit/get/delete, duplicate, import/export, nge, drag, selecting/projecting a train, stdcm)

E2E Tests :

@SharglutDev SharglutDev requested a review from a team as a code owner February 26, 2025 15:13
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Feb 26, 2025
@SharglutDev SharglutDev marked this pull request as draft February 26, 2025 15:14
@codecov-commenter
Copy link

codecov-commenter commented Feb 26, 2025

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

Codecov Report

Attention: Patch coverage is 96.98905% with 33 lines in your changes missing coverage. Please review.

Project coverage is 81.41%. Comparing base (d6c5879) to head (8c4dd08).
Report is 4 commits behind head on dev.

Files with missing lines Patch % Lines
front/src/common/api/osrdEditoastApi.ts 31.03% 20 Missing ⚠️
front/src/reducers/index.ts 12.50% 7 Missing ⚠️
...ents/Timetable/PacedTrain/hooks/useOccurrences.tsx 0.00% 4 Missing ⚠️
front/src/utils/trainId.ts 33.33% 2 Missing ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10966      +/-   ##
==========================================
+ Coverage   81.37%   81.41%   +0.04%     
==========================================
  Files        1122     1123       +1     
  Lines      112696   113120     +424     
  Branches      758      758              
==========================================
+ Hits        91703    92098     +395     
- Misses      20938    20967      +29     
  Partials       55       55              
Flag Coverage Δ
editoast 72.47% <ø> (-0.01%) ⬇️
front 89.96% <96.98%> (+0.02%) ⬆️
gateway 2.46% <ø> (ø)
osrdyne 8.00% <ø> (ø)
railjson_generator 87.58% <ø> (ø)
tests 88.82% <ø> (ø)

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SharglutDev SharglutDev self-assigned this Feb 26, 2025
@SharglutDev SharglutDev changed the title front: handle add paced trains add, get and delete paced trains Feb 26, 2025
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch 10 times, most recently from 5cf88dd to 77ebbd0 Compare March 7, 2025 09:21
@emersion emersion self-requested a review March 7, 2025 10:25
@emersion emersion changed the title add, get and delete paced trains front: add, get and delete paced trains Mar 7, 2025
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch from 77ebbd0 to 9d5a8e6 Compare March 7, 2025 10:37
@SharglutDev SharglutDev requested a review from RomainValls March 7, 2025 10:38
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

I've looked at the first two commits! Will continue the review later.

@emersion emersion self-requested a review March 7, 2025 16:05
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch 2 times, most recently from d37c225 to 9f154eb Compare March 10, 2025 12:43
@SharglutDev SharglutDev requested a review from Maymanaf March 10, 2025 12:45
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch 3 times, most recently from 46934e7 to b6811f7 Compare March 10, 2025 17:01
Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Overall LGTM! Very nice work :)

@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch from 5154a40 to 1adeee8 Compare March 19, 2025 14:42
@SharglutDev SharglutDev marked this pull request as ready for review March 20, 2025 07:09
@SharglutDev SharglutDev requested a review from a team as a code owner March 20, 2025 07:09
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch from 5845574 to 178345d Compare March 20, 2025 10:03
@SharglutDev SharglutDev requested review from Maymanaf and clarani March 20, 2025 10:04
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch from 178345d to d5661d0 Compare March 20, 2025 10:28
Copy link
Contributor

@clarani clarani left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch 2 times, most recently from ac8df19 to b07aced Compare March 21, 2025 16:37
Copy link
Contributor

@Maymanaf Maymanaf left a comment

Choose a reason for hiding this comment

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

LGTM for e2e tests ✅

The buttons were displayed when hovering the paced train item and the occurrences item when it should be only on paced train hovering.

Signed-off-by: SharglutDev <[email protected]>
This extra useEffect introduced a bug in end to end tests. The only way to reproduce it was to set the train name and start time in less that 500ms (the debounce used for these fields) which the e2e tests do.
At this speed, after filling the name, a useEffect is fired after 500ms after to update the store, but since the test is also filling the start time a few ms later, the useEffect was called because nameFromStore had been updated resulting in setting the start time back at its original value.
A workaround had been done for tests 011 and 012 to insert the selection of the rolling stock between the name and start time filling.

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev force-pushed the pfn/front/add-get-delete-paced-trains branch from b07aced to 8c4dd08 Compare March 24, 2025 10:32
@SharglutDev SharglutDev added this pull request to the merge queue Mar 24, 2025
Merged via the queue into dev with commit b15e931 Mar 24, 2025
27 checks passed
@SharglutDev SharglutDev deleted the pfn/front/add-get-delete-paced-trains branch March 24, 2025 10:57
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.

6 participants