From 7327cd8208044a2e12d6b490dee52e380da8ef43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 15:23:17 +0200 Subject: [PATCH 1/3] chore(deps): bump com.nimbusds:nimbus-jose-jwt from 9.38 to 9.39 (#19354) Bumps [com.nimbusds:nimbus-jose-jwt](https://bitbucket.org/connect2id/nimbus-jose-jwt) from 9.38 to 9.39. - [Changelog](https://bitbucket.org/connect2id/nimbus-jose-jwt/src/master/CHANGELOG.txt) - [Commits](https://bitbucket.org/connect2id/nimbus-jose-jwt/branches/compare/9.39..9.38) --- updated-dependencies: - dependency-name: com.nimbusds:nimbus-jose-jwt dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- flow-tests/vaadin-spring-tests/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-tests/vaadin-spring-tests/pom.xml b/flow-tests/vaadin-spring-tests/pom.xml index d872c867c88..de82393bd36 100644 --- a/flow-tests/vaadin-spring-tests/pom.xml +++ b/flow-tests/vaadin-spring-tests/pom.xml @@ -17,7 +17,7 @@ true 24.3.11 - 9.38 + 9.39 From 4cb7723b907986269395c53126f76c245cb8242c Mon Sep 17 00:00:00 2001 From: caalador Date: Mon, 13 May 2024 09:46:48 +0300 Subject: [PATCH 2/3] fix!: rename createWebComponent method (#19309) * fix!: rename createWebComponent method Rename the createWebComponent function as the create gives the impression that the function is heavy. * renameMethod to reactElement --------- Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com> --- .../src/main/resources/com/vaadin/flow/server/frontend/Flow.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flow-server/src/main/resources/com/vaadin/flow/server/frontend/Flow.tsx b/flow-server/src/main/resources/com/vaadin/flow/server/frontend/Flow.tsx index 2021a3f0ce1..09d2c28ad11 100644 --- a/flow-server/src/main/resources/com/vaadin/flow/server/frontend/Flow.tsx +++ b/flow-server/src/main/resources/com/vaadin/flow/server/frontend/Flow.tsx @@ -446,7 +446,7 @@ interface Properties { * @param onload optional callback to be called for script onload * @param onerror optional callback for error loading the script */ -export const createWebComponent = (tag: string, props?: Properties, onload?: () => void, onerror?: (err:any) => void) => { +export const reactElement = (tag: string, props?: Properties, onload?: () => void, onerror?: (err:any) => void) => { loadComponentScript(tag).then(() => onload?.(), (err) => { if(onerror) { onerror(err); From e8f91fc447c35c9ddebfc76c54ef85057fa0084a Mon Sep 17 00:00:00 2001 From: Tomi Virtanen Date: Mon, 13 May 2024 10:19:51 +0300 Subject: [PATCH 3/3] fix: change type of Menu order to double (#19332) Changing `Menu#order` type double and `MenuData#order` type to Double to match it with Hilla's `ViewConfig` type `number`. Fixes: #19320 --- flow-server/src/main/java/com/vaadin/flow/router/Menu.java | 6 +++--- .../src/main/java/com/vaadin/flow/router/MenuData.java | 6 +++--- .../vaadin/flow/router/internal/AbstractRouteRegistry.java | 3 ++- .../vaadin/flow/spring/flowsecurity/views/AdminView.java | 2 +- .../vaadin/flow/spring/flowsecurity/views/PrivateView.java | 2 +- .../java/com/vaadin/flow/spring/flowsecurity/AppViewIT.java | 4 +++- .../vaadin/flow/spring/flowsecurity/views/PrivateView.java | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/router/Menu.java b/flow-server/src/main/java/com/vaadin/flow/router/Menu.java index ffdbdfa11c7..9ef713dfab8 100644 --- a/flow-server/src/main/java/com/vaadin/flow/router/Menu.java +++ b/flow-server/src/main/java/com/vaadin/flow/router/Menu.java @@ -50,13 +50,13 @@ /** * Used to determine the order in the menu. Ties are resolved based on the * used title. Entries without explicitly defined ordering are put below - * entries with an order. {@link Long#MIN_VALUE} is the default value and + * entries with an order. {@link Double#MIN_VALUE} is the default value and * considered as undefined. * - * @return the order of the item in the menu. {@link Long#MIN_VALUE} by + * @return the order of the item in the menu. {@link Double#MIN_VALUE} by * default. */ - long order() default Long.MIN_VALUE; + double order() default Double.MIN_VALUE; /** * Icon to use in the menu. Value can go inside a {@code } diff --git a/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java b/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java index 43634257612..9f233bcabeb 100644 --- a/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java +++ b/flow-server/src/main/java/com/vaadin/flow/router/MenuData.java @@ -27,7 +27,7 @@ public class MenuData implements Serializable { private final String title; - private final Long order; + private final Double order; private final boolean exclude; private final String icon; @@ -43,7 +43,7 @@ public class MenuData implements Serializable { * @param icon * the icon of the menu item */ - public MenuData(String title, Long order, boolean exclude, String icon) { + public MenuData(String title, Double order, boolean exclude, String icon) { this.title = title; this.order = order; this.exclude = exclude; @@ -64,7 +64,7 @@ public String getTitle() { * * @return the order of the menu item */ - public Long getOrder() { + public Double getOrder() { return order; } diff --git a/flow-server/src/main/java/com/vaadin/flow/router/internal/AbstractRouteRegistry.java b/flow-server/src/main/java/com/vaadin/flow/router/internal/AbstractRouteRegistry.java index ff7b079ce71..510481cbcef 100644 --- a/flow-server/src/main/java/com/vaadin/flow/router/internal/AbstractRouteRegistry.java +++ b/flow-server/src/main/java/com/vaadin/flow/router/internal/AbstractRouteRegistry.java @@ -309,7 +309,8 @@ private void populateRegisteredRoutes(ConfiguredRoutes configuration, MenuData menuData = AnnotationReader .getAnnotationFor(target, Menu.class) .map(menu -> new MenuData(menu.title(), - (menu.order() == Long.MIN_VALUE) ? null : menu.order(), + (Objects.equals(menu.order(), Double.MIN_VALUE)) ? null + : menu.order(), false, menu.icon())) .orElse(null); diff --git a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/AdminView.java b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/AdminView.java index fd4f6d88023..ac99f4dd086 100644 --- a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/AdminView.java +++ b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/AdminView.java @@ -14,7 +14,7 @@ @Route(value = "admin", layout = MainView.class) @RouteAlias(value = "alias-for-admin", layout = MainView.class) @PageTitle("Admin View") -@Menu(order = 3) +@Menu(order = 1.10001) public class AdminView extends VerticalLayout { public AdminView(SecurityUtils securityUtils) { diff --git a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java index d1dddfb71bc..6d3d80a8122 100644 --- a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java +++ b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java @@ -35,7 +35,7 @@ @Route(value = "private", layout = MainView.class) @RouteAlias(value = "privateAndForbiddenForAll") @PageTitle("Private View") -@Menu(order = 2) +@Menu(order = 1.1) public class PrivateView extends VerticalLayout { private BankService bankService; diff --git a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/test/java/com/vaadin/flow/spring/flowsecurity/AppViewIT.java b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/test/java/com/vaadin/flow/spring/flowsecurity/AppViewIT.java index a0ad3b281e9..d6251da2730 100644 --- a/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/test/java/com/vaadin/flow/spring/flowsecurity/AppViewIT.java +++ b/flow-tests/vaadin-spring-tests/test-spring-security-flow-routepathaccesschecker/src/test/java/com/vaadin/flow/spring/flowsecurity/AppViewIT.java @@ -341,7 +341,9 @@ public void client_menu_routes_correct_for_admin() { private void assertMenuListContains(String expected) { TestBenchElement menuList = waitUntil(driver -> $("*").id("menu-list")); String menuListText = menuList.getText(); - Assert.assertTrue(menuListText.contains(expected)); + Assert.assertTrue( + "Expected " + expected + " but actual is " + menuListText, + menuListText.contains(expected)); } private void navigateToClientMenuList() { diff --git a/flow-tests/vaadin-spring-tests/test-spring-security-flow/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java b/flow-tests/vaadin-spring-tests/test-spring-security-flow/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java index 2de12409082..7abaaf87e84 100644 --- a/flow-tests/vaadin-spring-tests/test-spring-security-flow/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java +++ b/flow-tests/vaadin-spring-tests/test-spring-security-flow/src/main/java/com/vaadin/flow/spring/flowsecurity/views/PrivateView.java @@ -34,7 +34,7 @@ @Route(value = "private", layout = MainView.class) @PageTitle("Private View") @PermitAll -@Menu(order = 2) +@Menu(order = 1.5) public class PrivateView extends VerticalLayout { private BankService bankService;