Skip to content

Commit

Permalink
update flow/hilla/copilot to 24.5.0.beta7/24.6.0.beta5/24.6.0.beta3 (#…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
5 people authored Dec 4, 2024
1 parent b579761 commit 33bf410
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ export default function HelloHilla() {
position: 'middle',
})}> Say hello </Button>
</VerticalLayout>
)
;
}
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Button, TextField, VerticalLayout } from "@vaadin/react-components";
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js";
import { useState } from "react";
import { Notification } from '@vaadin/react-components/Notification.js';

export const config: ViewConfig = {
menu: {
title: "Hello React NO Flow Layout",
},
title: "Hilla outside Flow",
flowLayout: false,
};

export default function HelloHilla() {
const [name, setName] = useState("");

return (
<VerticalLayout theme="padding" id={"no-flow-hilla"}>
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} />
<Button onClick = {() => Notification.show(`Hello ${name}` , {
position: 'middle',
})}> Say hello </Button>
</VerticalLayout>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Button, TextField, VerticalLayout } from "@vaadin/react-components";
import type { ViewConfig } from "@vaadin/hilla-file-router/types.js";
import { useState } from "react";
import { Notification } from '@vaadin/react-components/Notification.js';

export const config: ViewConfig = {
menu: {
title: "Non root React in Flow",
},
title: "React in Flow Layout Deep Tree"
};

export default function HelloHilla() {
const [name, setName] = useState("");

return (
<VerticalLayout theme="padding" id={"flow-hilla-deep-tree"}>
<TextField label="Your name for Hilla" onValueChanged={(e) => setName(e.detail.value)} />
<Button onClick = {() => Notification.show(`Hello ${name}` , {
position: 'middle',
})}> Say hello </Button>
</VerticalLayout>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.vaadin.platform.react.test.views;

import com.vaadin.flow.component.applayout.AppLayout;
import com.vaadin.flow.component.applayout.DrawerToggle;
import com.vaadin.flow.component.html.Footer;
import com.vaadin.flow.component.html.H1;
import com.vaadin.flow.component.html.Header;
import com.vaadin.flow.component.html.Span;
import com.vaadin.flow.component.orderedlayout.Scroller;
import com.vaadin.flow.component.sidenav.SideNav;
import com.vaadin.flow.component.sidenav.SideNavItem;
import com.vaadin.flow.router.Layout;
import com.vaadin.flow.router.RoutePrefix;
import com.vaadin.flow.server.menu.MenuConfiguration;
import com.vaadin.flow.theme.lumo.LumoUtility;

@Layout("/home/deep")
public class DeepLayout extends FlowLayout {

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ private SideNav createNavigation() {
nav.addItem(
new SideNavItem(menuEntry.title(), menuEntry.path()));
}
if(menuEntry.path().startsWith("home") || menuEntry.path().startsWith("/home")) {
nav.addItem(
new SideNavItem(menuEntry.title(), menuEntry.path()));
}
});

return nav;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import com.vaadin.flow.component.button.testbench.ButtonElement;
import com.vaadin.flow.component.html.testbench.AnchorElement;
import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement;

public class FlowMainLayoutIT extends AbstractPlatformTest {

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

// Navigate to Flow view
// Navigate to Hilla view
getMenuElement("Hello React in Flow Layout").get().click();

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

// navigate away from Flow view
// navigate away from Hilla view
getMenuElement("Flow Hello").get().click();

waitForElement("Should have navigated to HelloWorld Flow",
By.id("flow-hello"));
}

@Test
public void hillaViewWithFlowOptOut() {
waitUntil(ExpectedConditions.presenceOfElementLocated(
By.id("flow-main")));

// Navigate to Hilla view without Flow layout
SideNavItemElement helloReactNoFlowLayout = getMenuElement(
"Hello React NO Flow Layout").get();
helloReactNoFlowLayout.click();

waitUntil(ExpectedConditions.presenceOfElementLocated(
By.id("no-flow-hilla")));

Assert.assertTrue("No menu should be available for view",
ExpectedConditions.stalenessOf(helloReactNoFlowLayout)
.apply(getDriver()));
}

@Test
public void hillaView_deepTree_FlowLayoutExists() {
waitUntil(ExpectedConditions.presenceOfElementLocated(
By.id("flow-main")));

// Navigate to Hilla view
getMenuElement("Non root React in Flow").get().click();

waitUntil(ExpectedConditions.presenceOfElementLocated(
By.id("flow-hilla-deep-tree")));

// navigate away from Hilla view
getMenuElement("Flow Hello").get().click();

waitForElement("Should have navigated to HelloWorld Flow",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void flowViewInHillaLayout() {
// navigate away from Flow view
getMenuElement("React Components").get().click();

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

Expand Down
6 changes: 3 additions & 3 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"npmName": "@vaadin/field-highlighter"
},
"flow": {
"javaVersion": "24.6.0.beta3"
"javaVersion": "24.6.0.beta7"
},
"flow-cdi": {
"javaVersion": "15.1.0"
Expand All @@ -143,7 +143,7 @@
"npmName": "@vaadin/grid"
},
"hilla": {
"javaVersion": "24.6.0.beta1"
"javaVersion": "24.6.0.beta5"
},
"horizontal-layout": {
"jsVersion": "24.6.0-rc1",
Expand Down Expand Up @@ -391,7 +391,7 @@
"javaVersion": "1.1.0.beta2"
},
"copilot": {
"javaVersion": "24.6.0.beta1"
"javaVersion": "24.6.0.beta3"
},
"kubernetes-kit-starter": {
"javaVersion": "2.3.0"
Expand Down

0 comments on commit 33bf410

Please # to comment.