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

Filter TowedRollingStocks to include only allowed values #10227

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

achrafmohye
Copy link
Contributor

Closes #10120

@achrafmohye achrafmohye requested a review from a team as a code owner January 3, 2025 09:31
@github-actions github-actions bot added the area:front Work on Standard OSRD Interface modules label Jan 3, 2025
@achrafmohye achrafmohye changed the title filter TowedRollingStocks to include only allowed values Filter TowedRollingStocks to include only allowed values Jan 3, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 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.43%. Comparing base (2d1a142) to head (9777b4b).
Report is 9 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   #10227   +/-   ##
=======================================
  Coverage   81.42%   81.43%           
=======================================
  Files        1057     1058    +1     
  Lines      104204   104263   +59     
  Branches      720      723    +3     
=======================================
+ Hits        84849    84906   +57     
- Misses      19313    19315    +2     
  Partials       42       42           
Flag Coverage Δ
editoast 73.58% <ø> (+<0.01%) ⬆️
front 89.18% <100.00%> (+<0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.50% <ø> (ø)
tests 87.00% <ø> (ø)

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

Choose a reason for hiding this comment

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

For consistency, it would be nice to have this list at the same place as FREIGHT_ROLLING_STOCKS in assets/rollingStock

Comment on lines +52 to +58
const allTowedRollingStocks = useMemo(
() =>
fetchedTowedRollingStocks.filter((stock) =>
ALLOWED_TOWED_ROLLING_STOCKS.includes(stock.name)
),
[fetchedTowedRollingStocks]
);
Copy link
Contributor

Choose a reason for hiding this comment

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

It's only an optional AC but in StdcmConfig, we have access to isDebugMode.
We could pass it to StdcmConsist and then to this hook so we can still have access to the full list of towed rs when we are in debug mode.

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.

stdcm: front: filter towed rolling stocks to keep freight ones
3 participants