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

Update flow to 24.6.0.beta6 #7059

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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