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

refacto timetable filters #10958

Merged
merged 1 commit into from
Feb 27, 2025
Merged

Conversation

SharglutDev
Copy link
Contributor

@SharglutDev SharglutDev commented Feb 25, 2025

See individual commits (will all be squashed before merging)

No behavior change expected, it's just refacto

close #10956

@SharglutDev SharglutDev requested a review from a team as a code owner February 25, 2025 18:14
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Feb 25, 2025
@SharglutDev SharglutDev requested a review from clarani February 25, 2025 18:15
@codecov-commenter
Copy link

codecov-commenter commented Feb 25, 2025

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

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.60%. Comparing base (05dae8a) to head (64bcc82).
Report is 4 commits behind head on dev.

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

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #10958      +/-   ##
==========================================
- Coverage   81.60%   81.60%   -0.01%     
==========================================
  Files        1095     1095              
  Lines      110438   110409      -29     
  Branches      742      742              
==========================================
- Hits        90128    90098      -30     
- Misses      20268    20269       +1     
  Partials       42       42              
Flag Coverage Δ
editoast 72.19% <ø> (-0.01%) ⬇️
front 90.22% <100.00%> (-0.01%) ⬇️
gateway 2.18% <ø> (ø)
osrdyne 2.98% <ø> (ø)
railjson_generator 87.58% <ø> (ø)
tests 87.90% <ø> (ø)

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.

Copy link
Contributor

@RomainValls RomainValls 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, works as before, thanks !

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.

Great job on the refactoring ! Everything is very clean and well-organized! I especially appreciate how you divided the commits; it really made the review process much easier.

Just one small note: it looks like you forgot to rename the file useFilterTimetableItems to match the new logic.

Thanks again for your work!

@SharglutDev SharglutDev force-pushed the pfn/front/refacto-timetable-filters branch from c964055 to f24ec4c Compare February 27, 2025 08:19
@SharglutDev
Copy link
Contributor Author

Great job on the refactoring ! Everything is very clean and well-organized! I especially appreciate how you divided the commits; it really made the review process much easier.

Just one small note: it looks like you forgot to rename the file useFilterTimetableItems to match the new logic.

Thanks again for your work!

Good catch, fixed.

@SharglutDev SharglutDev force-pushed the pfn/front/refacto-timetable-filters branch from f24ec4c to f50ff1a Compare February 27, 2025 08: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, not tested ✅

No change of filters behavior.

- move all filter states in useFilterTrainSchedules
- move useFilterTrainSchedules in Timetable component
- remove useEffects in the custom hook in favor of useMemos
- remove displayedTimetableItems state and reuse the filtered array from the custom hook
- group the filters to a single object to facilitate the props drilling
- rename some ref to train schedule in timetable item

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev force-pushed the pfn/front/refacto-timetable-filters branch from f50ff1a to 64bcc82 Compare February 27, 2025 10:31
@SharglutDev SharglutDev added this pull request to the merge queue Feb 27, 2025
Merged via the queue into dev with commit 3176332 Feb 27, 2025
27 checks passed
@SharglutDev SharglutDev deleted the pfn/front/refacto-timetable-filters branch February 27, 2025 11:00
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.

refacto timetable filters
5 participants