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

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

@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 38.20%. Comparing base (a89f540) to head (5235fd8).
Report is 1 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   38.20%   38.20%           
=======================================
  Files         997      992    -5     
  Lines       92198    92158   -40     
  Branches     1191     1186    -5     
=======================================
- Hits        35221    35210   -11     
+ Misses      56521    56497   -24     
+ Partials      456      451    -5     
Flag Coverage Δ
editoast 73.36% <ø> (-0.04%) ⬇️
front 20.18% <0.00%> (+0.01%) ⬆️
gateway 2.18% <ø> (ø)
osrdyne 3.28% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
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

@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

front/src/common/Map/Buttons/MapButtons.tsx Outdated Show resolved Hide resolved
front/src/applications/editor/Editor.tsx Outdated Show resolved Hide resolved
@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 :)

@theocrsb theocrsb force-pushed the tce/front/redesign-btn-map branch 3 times, most recently from 1fe7855 to f37ed91 Compare November 26, 2024 12:11
@theocrsb theocrsb marked this pull request as ready for review November 26, 2024 12:20
@theocrsb theocrsb requested a review from a team as a code owner November 26, 2024 12:20
@anisometropie
Copy link
Contributor

anisometropie commented Nov 28, 2024

I think all the icons aren’t centered
Screenshot_20241128_102413

@theocrsb
Copy link
Contributor Author

I think all the icons aren’t centered Screenshot_20241128_102413

Thanks, it's done

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.

There is a bug in the old buttons :/ Look at the compass button
image

front/src/styles/scss/common/map/_map.scss Outdated Show resolved Hide resolved
@theocrsb theocrsb force-pushed the tce/front/redesign-btn-map branch 2 times, most recently from 9fef6a1 to 0564826 Compare November 28, 2024 10:42
@theocrsb
Copy link
Contributor Author

There is a bug in the old buttons :/ Look at the compass button image

Thanks, I just fixed

@theocrsb
Copy link
Contributor Author

It doesn't yet have “hover” and “active” behavior.
I've just checked with @thibautsailly , the mockup are in progress.

@theocrsb theocrsb force-pushed the tce/front/redesign-btn-map branch 2 times, most recently from 8bfa3a7 to d81de37 Compare November 29, 2024 09:15
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 ✅ Only left 2 small comments, you can close them once you have fixed them and merge without a new approval 👍 :)

front/src/common/Map/Buttons/MapButton.tsx Outdated Show resolved Hide resolved
front/src/styles/scss/common/map/_map.scss Outdated Show resolved Hide resolved
@theocrsb theocrsb force-pushed the tce/front/redesign-btn-map branch from 211da1d to 5235fd8 Compare December 3, 2024 12:45
@theocrsb theocrsb enabled auto-merge December 3, 2024 12:45
@theocrsb theocrsb added this pull request to the merge queue Dec 3, 2024
Merged via the queue into dev with commit fa283de Dec 3, 2024
27 checks passed
@theocrsb theocrsb deleted the tce/front/redesign-btn-map branch December 3, 2024 13:29
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