Skip to content

Commit

Permalink
Update flow to 24.6.0.beta7 (#7069)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

---------

Co-authored-by: Zhe Sun <[email protected]>
Co-authored-by: caalador <[email protected]>
Co-authored-by: Manuel Carrasco Moñino <[email protected]>

---------

Co-authored-by: Zhe Sun <[email protected]>
Co-authored-by: caalador <[email protected]>
Co-authored-by: Manuel Carrasco Moñino <[email protected]>
  • Loading branch information
4 people authored Dec 4, 2024
1 parent 4fe9e3a commit dcc6237
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 6 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
2 changes: 1 addition & 1 deletion 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 Down

0 comments on commit dcc6237

Please sign in to comment.