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

feat: Get menu views api #19355

Merged
merged 10 commits into from
May 15, 2024
Merged

feat: Get menu views api #19355

merged 10 commits into from
May 15, 2024

Conversation

caalador
Copy link
Contributor

Create MenuRegistry for getting
automatic menu views for population.

Fixes #19321

Create MenuRegistry for getting
automatic menu views for population.

Fixes #19321
client routes get to start with /
Copy link

github-actions bot commented May 13, 2024

Test Results

1 104 files  + 1  1 104 suites  +1   1h 21m 35s ⏱️ + 1m 34s
7 014 tests + 5  6 965 ✅ + 5  49 💤 ±0  0 ❌ ±0 
7 383 runs  +31  7 324 ✅ +31  59 💤 ±0  0 ❌ ±0 

Results for commit bc8caf3. ± Comparison against base commit e8f91fc.

♻️ This comment has been updated with latest results.

Add collect server menu item methods.
rename parameters to match used ones
@mshabarov mshabarov requested a review from tltv May 13, 2024 11:39
caalador added a commit to vaadin/hilla that referenced this pull request May 14, 2024
Unify the views.json to use the same
names as createViewConfigJson generates.

depends on vaadin/flow#19355

Part of #19321
Copy link
Member

@tltv tltv left a 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.

add missing fields and fix constant usage.
Add test for static method.
Copy link

sonarcloud bot commented May 15, 2024

Quality Gate Passed Quality Gate passed

Issues
25 New issues
0 Accepted issues

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

See analysis details on SonarCloud

caalador added a commit to vaadin/hilla that referenced this pull request May 15, 2024
Unify the views.json to use the same
names as createViewConfigJson generates.

depends on vaadin/flow#19355

Part of #19321
caalador added a commit to vaadin/hilla that referenced this pull request May 15, 2024
Unify the views.json to use the same
names as createViewConfigJson generates.

depends on vaadin/flow#19355

Part of #19321
@caalador caalador merged commit 2f9bfc6 into main May 15, 2024
26 checks passed
@caalador caalador deleted the issues/19321-menu-api branch May 15, 2024 07:20
taefi added a commit to vaadin/hilla that referenced this pull request May 15, 2024
* 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>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version.

AceDev24 pushed a commit to AceDev24/hiliaGround that referenced this pull request Sep 3, 2024
* 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>
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.

API for getting main menu entries
3 participants