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

fix: use order index and paths comparison to sort menu items #2309

Merged
merged 5 commits into from
Apr 12, 2024

Conversation

taefi
Copy link
Contributor

@taefi taefi commented Apr 9, 2024

Description

This will fix the menu item orders by interpreting ViewConfig's menu order as the natural index, so that menu items with lower order will show up on top menu items with higher order. This also will adjust sort behavior in a way that views without any defined order would be show after the menu items with defined order. Ties are resolved based on the path string natural comparison.

Fixes #2222

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.44%. Comparing base (a3258b4) to head (992016c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2309      +/-   ##
==========================================
+ Coverage   95.35%   95.44%   +0.09%     
==========================================
  Files          67       67              
  Lines        4431     4438       +7     
  Branches      630      633       +3     
==========================================
+ Hits         4225     4236      +11     
+ Misses        163      162       -1     
+ Partials       43       40       -3     
Flag Coverage Δ
unittests 95.44% <100.00%> (+0.09%) ⬆️

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.

@taefi taefi requested a review from Lodin April 10, 2024 09:48
@taefi taefi requested a review from Lodin April 12, 2024 13:02
Copy link

sonarcloud bot commented Apr 12, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@taefi taefi merged commit 16ab52f into main Apr 12, 2024
15 checks passed
@taefi taefi deleted the taefi/fix-menu-order branch April 12, 2024 13:15
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Hilla 24.4.0.alpha23 and is also targeting the upcoming stable 24.4.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default menu order puts ordered items after unordered items
3 participants