-
Notifications
You must be signed in to change notification settings - Fork 169
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
feat: Get menu views api #19355
feat: Get menu views api #19355
Conversation
Create MenuRegistry for getting automatic menu views for population. Fixes #19321
client routes get to start with /
Remove empty test.
2f011cf
to
bfa8575
Compare
0006429
to
297987c
Compare
Add collect server menu item methods. rename parameters to match used ones
Unify the views.json to use the same names as createViewConfigJson generates. depends on vaadin/flow#19355 Part of #19321
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering would it make sense to add all active access control automatically if they exist in UI instance. Hilla could not use that because UI instance does not exist, but in Flow apps UI always exists and all access control objects can be used automatically.
Access control objects can be read into a List like this:
UI.getCurrent().getInternals()
.getListeners(BeforeEnterHandler.class).stream()
.filter(handler -> handler instanceof BeforeEnterListener)
.map(BeforeEnterListener.class::cast).toList()
Note that calling getListeners(BeforeEnterListener.class)
would not work directly. It has to go via BeforeEnterHandler class.
Example in MenuListView
IT.
All public methods, that don't take in a list of BeforeEnterListeners, can check if UI instance is available, and if it is, then use available AC instances by default.
flow-server/src/main/java/com/vaadin/flow/router/RouteConfiguration.java
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/menu/AvailableViewInfo.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/menu/MenuRegistry.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/menu/MenuRegistry.java
Outdated
Show resolved
Hide resolved
flow-server/src/main/java/com/vaadin/flow/server/menu/MenuRegistry.java
Outdated
Show resolved
Hide resolved
add missing fields and fix constant usage. Add test for static method.
flow-server/src/main/java/com/vaadin/flow/server/menu/MenuRegistry.java
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Unify the views.json to use the same names as createViewConfigJson generates. depends on vaadin/flow#19355 Part of #19321
Unify the views.json to use the same names as createViewConfigJson generates. depends on vaadin/flow#19355 Part of #19321
* feat: use Flow menu item collection Unify the views.json to use the same names as createViewConfigJson generates. depends on vaadin/flow#19355 Part of #19321 * Remove new extra filed from result --------- Co-authored-by: Soroosh Taefi <taefi.soroosh@gmail.com>
This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version. |
* feat: use Flow menu item collection Unify the views.json to use the same names as createViewConfigJson generates. depends on vaadin/flow#19355 Part of #19321 * Remove new extra filed from result --------- Co-authored-by: Soroosh Taefi <taefi.soroosh@gmail.com>
Create MenuRegistry for getting
automatic menu views for population.
Fixes #19321