Skip to content

Commit 33bf410

Browse files
vaadin-botZheSun88caaladormanolo
authored
update flow/hilla/copilot to 24.5.0.beta7/24.6.0.beta5/24.6.0.beta3 (#7073)
* update hilla to 24.6.0.beta5 * update hilla to 24.6.0.beta4 (#7072) * update hilla to 24.6.0.beta4 * Update flow to 24.6.0.beta7 (#7069) * Update flow to 24.6.0.beta7 * Update flow to 24.6.0.beta6 (#7059) * Update flow to 24.6.0.beta6 * feat: Add test for mixed flowLayout and deep tree (#7056) Add tests for testing use of flowLayout as both true and false in same layout path. Add test for hilla view with a deep path that should get a Flow layout. Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com> --------- Co-authored-by: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com> --------- Co-authored-by: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com> --------- Co-authored-by: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com> * add wait until to hilla test * copilot beta3 --------- Co-authored-by: Zhe Sun <31067185+ZheSun88@users.noreply.github.com> Co-authored-by: caalador <mikael.grankvist@vaadin.com> Co-authored-by: Manuel Carrasco Moñino <manolo@vaadin.com> Co-authored-by: Zhe Sun <zhe@vaadin.com>
1 parent b579761 commit 33bf410

File tree

8 files changed

+118
-9
lines changed

8 files changed

+118
-9
lines changed

vaadin-platform-react-hybrid-test/src/main/frontend/views/flow/hello-hilla.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ export default function HelloHilla() {
2020
position: 'middle',
2121
})}> Say hello </Button>
2222
</VerticalLayout>
23-
)
24-
;
25-
}
23+
);
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { Button, TextField, VerticalLayout } from "@vaadin/react-components";
2+
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js";
3+
import { useState } from "react";
4+
import { Notification } from '@vaadin/react-components/Notification.js';
5+
6+
export const config: ViewConfig = {
7+
menu: {
8+
title: "Hello React NO Flow Layout",
9+
},
10+
title: "Hilla outside Flow",
11+
flowLayout: false,
12+
};
13+
14+
export default function HelloHilla() {
15+
const [name, setName] = useState("");
16+
17+
return (
18+
<VerticalLayout theme="padding" id={"no-flow-hilla"}>
19+
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} />
20+
<Button onClick = {() => Notification.show(`Hello ${name}` , {
21+
position: 'middle',
22+
})}> Say hello </Button>
23+
</VerticalLayout>
24+
);
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Button, TextField, VerticalLayout } from "@vaadin/react-components";
2+
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js";
3+
import { useState } from "react";
4+
import { Notification } from '@vaadin/react-components/Notification.js';
5+
6+
export const config: ViewConfig = {
7+
menu: {
8+
title: "Non root React in Flow",
9+
},
10+
title: "React in Flow Layout Deep Tree"
11+
};
12+
13+
export default function HelloHilla() {
14+
const [name, setName] = useState("");
15+
16+
return (
17+
<VerticalLayout theme="padding" id={"flow-hilla-deep-tree"}>
18+
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} />
19+
<Button onClick = {() => Notification.show(`Hello ${name}` , {
20+
position: 'middle',
21+
})}> Say hello </Button>
22+
</VerticalLayout>
23+
);
24+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.vaadin.platform.react.test.views;
2+
3+
import com.vaadin.flow.component.applayout.AppLayout;
4+
import com.vaadin.flow.component.applayout.DrawerToggle;
5+
import com.vaadin.flow.component.html.Footer;
6+
import com.vaadin.flow.component.html.H1;
7+
import com.vaadin.flow.component.html.Header;
8+
import com.vaadin.flow.component.html.Span;
9+
import com.vaadin.flow.component.orderedlayout.Scroller;
10+
import com.vaadin.flow.component.sidenav.SideNav;
11+
import com.vaadin.flow.component.sidenav.SideNavItem;
12+
import com.vaadin.flow.router.Layout;
13+
import com.vaadin.flow.router.RoutePrefix;
14+
import com.vaadin.flow.server.menu.MenuConfiguration;
15+
import com.vaadin.flow.theme.lumo.LumoUtility;
16+
17+
@Layout("/home/deep")
18+
public class DeepLayout extends FlowLayout {
19+
20+
}

vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowLayout.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ private SideNav createNavigation() {
5454
nav.addItem(
5555
new SideNavItem(menuEntry.title(), menuEntry.path()));
5656
}
57+
if(menuEntry.path().startsWith("home") || menuEntry.path().startsWith("/home")) {
58+
nav.addItem(
59+
new SideNavItem(menuEntry.title(), menuEntry.path()));
60+
}
5761
});
5862

5963
return nav;

vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/FlowMainLayoutIT.java

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import com.vaadin.flow.component.button.testbench.ButtonElement;
1010
import com.vaadin.flow.component.html.testbench.AnchorElement;
11+
import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement;
1112

1213
public class FlowMainLayoutIT extends AbstractPlatformTest {
1314

@@ -16,13 +17,49 @@ public void hillaViewInFlowLayout() {
1617
waitUntil(ExpectedConditions.presenceOfElementLocated(
1718
By.id("flow-main")));
1819

19-
// Navigate to Flow view
20+
// Navigate to Hilla view
2021
getMenuElement("Hello React in Flow Layout").get().click();
2122

2223
waitUntil(ExpectedConditions.presenceOfElementLocated(
2324
By.id("flow-hilla")));
2425

25-
// navigate away from Flow view
26+
// navigate away from Hilla view
27+
getMenuElement("Flow Hello").get().click();
28+
29+
waitForElement("Should have navigated to HelloWorld Flow",
30+
By.id("flow-hello"));
31+
}
32+
33+
@Test
34+
public void hillaViewWithFlowOptOut() {
35+
waitUntil(ExpectedConditions.presenceOfElementLocated(
36+
By.id("flow-main")));
37+
38+
// Navigate to Hilla view without Flow layout
39+
SideNavItemElement helloReactNoFlowLayout = getMenuElement(
40+
"Hello React NO Flow Layout").get();
41+
helloReactNoFlowLayout.click();
42+
43+
waitUntil(ExpectedConditions.presenceOfElementLocated(
44+
By.id("no-flow-hilla")));
45+
46+
Assert.assertTrue("No menu should be available for view",
47+
ExpectedConditions.stalenessOf(helloReactNoFlowLayout)
48+
.apply(getDriver()));
49+
}
50+
51+
@Test
52+
public void hillaView_deepTree_FlowLayoutExists() {
53+
waitUntil(ExpectedConditions.presenceOfElementLocated(
54+
By.id("flow-main")));
55+
56+
// Navigate to Hilla view
57+
getMenuElement("Non root React in Flow").get().click();
58+
59+
waitUntil(ExpectedConditions.presenceOfElementLocated(
60+
By.id("flow-hilla-deep-tree")));
61+
62+
// navigate away from Hilla view
2663
getMenuElement("Flow Hello").get().click();
2764

2865
waitForElement("Should have navigated to HelloWorld Flow",

vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/HillaMainLayoutIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public void flowViewInHillaLayout() {
2424
// navigate away from Flow view
2525
getMenuElement("React Components").get().click();
2626

27-
Assert.assertTrue("React components view should be shown",
27+
waitUntil(driver ->
2828
$(ButtonElement.class).id("open-overlay").isDisplayed());
2929
}
3030

versions.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
"npmName": "@vaadin/field-highlighter"
123123
},
124124
"flow": {
125-
"javaVersion": "24.6.0.beta3"
125+
"javaVersion": "24.6.0.beta7"
126126
},
127127
"flow-cdi": {
128128
"javaVersion": "15.1.0"
@@ -143,7 +143,7 @@
143143
"npmName": "@vaadin/grid"
144144
},
145145
"hilla": {
146-
"javaVersion": "24.6.0.beta1"
146+
"javaVersion": "24.6.0.beta5"
147147
},
148148
"horizontal-layout": {
149149
"jsVersion": "24.6.0-rc1",
@@ -391,7 +391,7 @@
391391
"javaVersion": "1.1.0.beta2"
392392
},
393393
"copilot": {
394-
"javaVersion": "24.6.0.beta1"
394+
"javaVersion": "24.6.0.beta3"
395395
},
396396
"kubernetes-kit-starter": {
397397
"javaVersion": "2.3.0"

0 commit comments

Comments
 (0)