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 option menu to manchette #8775

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

SharglutDev
Copy link
Contributor

@SharglutDev SharglutDev commented Sep 5, 2024

close #8687

As requested by @thibautsailly, the manchette menu button should remain hidden until the waypoint modal is completed (#8627 and #8628)

To test the component, uncomment it

@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch from ed881a9 to 541423b Compare September 5, 2024 16:01
@codecov-commenter
Copy link

codecov-commenter commented Sep 5, 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 105 lines in your changes missing coverage. Please review.

Project coverage is 36.89%. Comparing base (2e51022) to head (beb51be).
Report is 7 commits behind head on dev.

Files with missing lines Patch % Lines
.../components/SpaceTimeChart/ManchetteMenuButton.tsx 0.00% 70 Missing and 1 partial ⚠️
front/src/common/OSRDMenu.tsx 0.00% 23 Missing and 1 partial ⚠️
front/src/utils/hooks/useModalFocusTrap.ts 0.00% 6 Missing ⚠️
...WithSpaceTimeChart/ManchetteWithSpaceTimeChart.tsx 0.00% 4 Missing ⚠️

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

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #8775      +/-   ##
============================================
- Coverage     36.92%   36.89%   -0.04%     
  Complexity     2242     2242              
============================================
  Files          1255     1257       +2     
  Lines        116971   117069      +98     
  Branches       3270     3272       +2     
============================================
  Hits          43190    43190              
- Misses        71836    71932      +96     
- Partials       1945     1947       +2     
Flag Coverage Δ
core 74.78% <ø> (ø)
editoast 72.28% <ø> (ø)
front 15.59% <0.00%> (-0.03%) ⬇️
gateway 2.22% <ø> (ø)
osrdyne 2.46% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.71% <ø> (ø)

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.

@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch from 541423b to 4314175 Compare September 5, 2024 16:44
Copy link
Contributor

@Yohh Yohh left a comment

Choose a reason for hiding this comment

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

nice, a few suggestions first

@SharglutDev
Copy link
Contributor Author

Also I was wondering about the reusability of the menu :
The UI from the manchette menu and the one from an op click on the manchette (see sketch) are very close. Do you think it would be better to have a "common" component for these cases and some custom props ? Like the width, items etc
But if yes, wouldn't it be better to have a component like this in osrd-ui ? (even though we didn't have a request for that)

@Yohh
Copy link
Contributor

Yohh commented Sep 6, 2024

Also I was wondering about the reusability of the menu : The UI from the manchette menu and the one from an op click on the manchette (see sketch) are very close. Do you think it would be better to have a "common" component for these cases and some custom props ? Like the width, items etc But if yes, wouldn't it be better to have a component like this in osrd-ui ? (even though we didn't have a request for that)

I'm a bit confused, in this case why don't we create a component in OSRD-UI? witch could be called as a child of manchette and used for each case

@SharglutDev
Copy link
Contributor Author

What I meant was :

The manchette menu
Capture d’écran 2024-09-06 à 14 14 58

and the OP menu
Capture d’écran 2024-09-06 à 14 14 33

are looking exactly the same except the items inside and the width of the menu. Maybe it should be better to have only one generic component for that to avoid code duplication.

Second question is : do we want it in osrd-ui or do we consider that it's purely an osrd component and we keep in osrd code base.

@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch from 4314175 to caed404 Compare September 6, 2024 12:24
@SharglutDev SharglutDev requested review from Yohh and kmer2016 September 9, 2024 14:29
@emersion emersion changed the title Pfn/front/manchette/add option menu front: add option menu to manchette Sep 10, 2024
@emersion
Copy link
Member

I've taken the liberty to rename the PR, I hope that's fine.

@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch 2 times, most recently from bb8ccf0 to 32196de Compare September 11, 2024 11:37
@SharglutDev SharglutDev requested a review from Yohh September 11, 2024 12:00
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.

In the mock-up, the button for displaying the menu is located on the Header. In the implementation, however, it's outside. Are you waiting for the new version of the headline?

image

image

@SharglutDev
Copy link
Contributor Author

In the mock-up, the button for displaying the menu is located on the Header. In the implementation, however, it's outside. Are you waiting for the new version of the headline?

image

image

Yes that's exactly why. For now the space time chart header is inside the osrd-ui components and I can't access it but the other issue will be done, I would be able to create it on osrd side and put the button at the right place.

@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch from f9736fa to df2bd35 Compare September 20, 2024 14:29
@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch 2 times, most recently from 10f5c2d to 1919fac Compare October 4, 2024 15:29
@SharglutDev SharglutDev marked this pull request as ready for review October 4, 2024 15:31
@SharglutDev SharglutDev requested a review from a team as a code owner October 4, 2024 15:31
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.

Just small suggestions

@SharglutDev SharglutDev requested review from Yohh and kmer2016 October 8, 2024 07:19
Copy link
Contributor

@Yohh Yohh 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/manchette/add-option-menu branch from 1926750 to bff4546 Compare October 8, 2024 08:44
PR contains :
 - a button to toggle the menu
 - menu has only one option to show/hide ops

Signed-off-by: SharglutDev <[email protected]>
@SharglutDev SharglutDev force-pushed the pfn/front/manchette/add-option-menu branch from bff4546 to beb51be Compare October 8, 2024 08:46
@SharglutDev SharglutDev enabled auto-merge October 8, 2024 08:58
@SharglutDev SharglutDev added this pull request to the merge queue Oct 8, 2024
Merged via the queue into dev with commit 34f978a Oct 8, 2024
24 checks passed
@SharglutDev SharglutDev deleted the pfn/front/manchette/add-option-menu branch October 8, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Manchette : add an options menu
5 participants