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: update btn map in scenario page and convert rem to px in css map file #9798

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

theocrsb
Copy link
Contributor

Waiting for @thibautsailly feedback before to merge this PR

closes https://github.com/osrd-project/osrd-confidential/issues/670

Signed-off-by: theocrsb <theo_crosbie@yahoo.fr>
Signed-off-by: theocrsb <theo_crosbie@yahoo.fr>
@codecov-commenter
Copy link

codecov-commenter commented Nov 21, 2024

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

Codecov Report

Attention: Patch coverage is 0% with 71 lines in your changes missing coverage. Please review.

Project coverage is 37.79%. Comparing base (57c96f7) to head (e8ba25e).
Report is 20 commits behind head on dev.

Files with missing lines Patch % Lines
front/src/common/Map/Buttons/MapButtons.tsx 0.00% 45 Missing ⚠️
front/src/common/Map/Buttons/MapButton.tsx 0.00% 23 Missing and 1 partial ⚠️
...ents/SimulationResultsMap/SimulationResultsMap.tsx 0.00% 1 Missing ⚠️
...ainschedule/components/ManageTrainSchedule/Map.tsx 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    #9798      +/-   ##
==========================================
- Coverage   37.82%   37.79%   -0.03%     
==========================================
  Files         994      989       -5     
  Lines       91126    91145      +19     
  Branches     1176     1169       -7     
==========================================
- Hits        34466    34447      -19     
- Misses      56206    56249      +43     
+ Partials      454      449       -5     
Flag Coverage Δ
editoast 72.95% <ø> (-0.06%) ⬇️
front 20.10% <0.00%> (-0.02%) ⬇️
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.


🚨 Try these New Features:


.osrd-btn-map {
color: var(--black100);
width: 48px;
Copy link
Contributor

Choose a reason for hiding this comment

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

where does 48px come from?
Screenshot_20241121_165841

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I used the mockup Graphic update for OSRD#2
image

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.

As you are re-writting these buttons, I think it would be better to do a bit of refacto :)
All these buttons are almost the same, the only things that change are the function onClick, the text in the span + its translation, the icon and the data-test-id.

You can create a generic component MapButton which will take only these 4-5 props, and in MapButtons, render this new component with the correct props if we are using the newButtons.

If you do this, you won't need to modify all the existing Buttons

@@ -55,6 +56,7 @@ export default function MapButtons({
bearing,
editorProps,
viewPort: viewportProps,
isNewButtons,
Copy link
Contributor

Choose a reason for hiding this comment

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

Set it to false by default, this way you can remove the props in the components which do not need the new buttons

Suggested change
isNewButtons,
isNewButtons = false,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -446,6 +446,7 @@ const Editor = () => {
activeTool: toolAndState.tool,
}}
viewPort={viewport}
isNewButtons={false}
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this props if it's set by default to false

Suggested change
isNewButtons={false}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

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

As you are re-writting these buttons, I think it would be better to do a bit of refacto :) All these buttons are almost the same, the only things that change are the function onClick, the text in the span + its translation, the icon and the data-test-id.

You can create a generic component MapButton which will take only these 4-5 props, and in MapButtons, render this new component with the correct props if we are using the newButtons.

If you do this, you won't need to modify all the existing Buttons

You're right, I just proposed a refacto in my fixups :)

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.

4 participants