-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issues/18130_componenttracker_disable_parameter
- Loading branch information
Showing
14 changed files
with
527 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<artifactId>flow-tests</artifactId> | ||
<groupId>com.vaadin</groupId> | ||
<version>24.4-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>flow-test-react-router-prod</artifactId> | ||
<name>Flow tests for routing using react-router in production mode</name> | ||
|
||
<packaging>war</packaging> | ||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
<surefire.reportNameSuffix>production</surefire.reportNameSuffix> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-test-resources</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-html-components-testbench</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-test-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>flow-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>prepare-frontend</goal> | ||
<goal>build-frontend</goal> | ||
</goals> | ||
<phase>compile</phase> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<cleanFrontendFiles>false</cleanFrontendFiles> | ||
</configuration> | ||
</plugin> | ||
<!-- This module is mapped to default web context --> | ||
<plugin> | ||
<groupId>org.eclipse.jetty.ee10</groupId> | ||
<artifactId>jetty-ee10-maven-plugin</artifactId> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
33 changes: 33 additions & 0 deletions
33
flow-tests/test-react-router/src/main/java/com/vaadin/flow/AnchorView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2000-2023 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.vaadin.flow; | ||
|
||
import com.vaadin.flow.component.html.Anchor; | ||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.router.Route; | ||
|
||
@Route("com.vaadin.flow.AnchorView") | ||
public class AnchorView extends Div { | ||
|
||
public AnchorView() { | ||
Anchor navigation = new Anchor("com.vaadin.flow.NavigationView", | ||
"Navigation"); | ||
navigation.setId(NavigationView.ANCHOR_ID); | ||
add(new Span("AnchorView"), new Div(), navigation); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
flow-tests/test-react-router/src/main/java/com/vaadin/flow/NavigationView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2000-2023 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.vaadin.flow; | ||
|
||
import com.vaadin.flow.component.html.Anchor; | ||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.html.NativeButton; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.router.Route; | ||
import com.vaadin.flow.router.RouterLink; | ||
|
||
@Route("com.vaadin.flow.NavigationView") | ||
public class NavigationView extends Div { | ||
|
||
public static final String SERVER_ID = "server-navigation"; | ||
public static final String ANCHOR_ID = "anchor-navigation"; | ||
public static final String ROUTER_LINK_ID = "router-link-navigation"; | ||
public static final String POSTPONE_ID = "postpone-view-link"; | ||
|
||
public NavigationView() { | ||
Anchor anchorNavigation = new Anchor("com.vaadin.flow.AnchorView", | ||
"Navigate to AnchorView"); | ||
anchorNavigation.setId(ANCHOR_ID); | ||
NativeButton serverNavigation = new NativeButton( | ||
"Navigate through Server", event -> { | ||
event.getSource().getUI().get().navigate(ServerView.class); | ||
}); | ||
serverNavigation.setId(SERVER_ID); | ||
RouterLink link = new RouterLink("RouterView", RouterView.class); | ||
link.setId(ROUTER_LINK_ID); | ||
|
||
RouterLink postponeView = new RouterLink("PostponeView", | ||
PostponeView.class); | ||
postponeView.setId(POSTPONE_ID); | ||
|
||
add(new Span("NavigationView"), new Div(), anchorNavigation, new Div(), | ||
serverNavigation, new Div(), link, new Div(), postponeView); | ||
} | ||
|
||
} |
65 changes: 65 additions & 0 deletions
65
flow-tests/test-react-router/src/main/java/com/vaadin/flow/PostponeView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* | ||
* Copyright 2000-2023 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.vaadin.flow; | ||
|
||
import com.vaadin.flow.component.html.Anchor; | ||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.html.NativeButton; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.router.BeforeLeaveEvent; | ||
import com.vaadin.flow.router.BeforeLeaveObserver; | ||
import com.vaadin.flow.router.Route; | ||
import com.vaadin.flow.router.RouterLink; | ||
|
||
@Route("com.vaadin.flow.PostponeView") | ||
public class PostponeView extends Div implements BeforeLeaveObserver { | ||
|
||
public static String CONTINUE_ID = "continue-button"; | ||
public static String STAY_ID = "stay-button"; | ||
public static String NAVIGATION_ID = "to-navigation"; | ||
public static String NAVIGATION_ROUTER_LINK_ID = "to-navigation"; | ||
|
||
private NativeButton navigate, stay; | ||
|
||
public PostponeView() { | ||
Anchor link = new Anchor("com.vaadin.flow.NavigationView", | ||
"Navigation");// NavigationView.class); | ||
link.setId(NAVIGATION_ID); | ||
RouterLink routerLink = new RouterLink("Navigation", | ||
NavigationView.class); | ||
routerLink.setId(NAVIGATION_ROUTER_LINK_ID); | ||
|
||
add(new Span("PostponeView"), new Div(), link, new Div(), routerLink); | ||
} | ||
|
||
@Override | ||
public void beforeLeave(BeforeLeaveEvent event) { | ||
BeforeLeaveEvent.ContinueNavigationAction postpone = event.postpone(); | ||
navigate = new NativeButton("Continue", e -> { | ||
postpone.proceed(); | ||
remove(navigate, stay); | ||
}); | ||
navigate.setId(CONTINUE_ID); | ||
stay = new NativeButton("Stay", e -> { | ||
postpone.cancel(); | ||
remove(navigate, stay); | ||
}); | ||
stay.setId(STAY_ID); | ||
|
||
add(navigate, stay); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
flow-tests/test-react-router/src/main/java/com/vaadin/flow/RouterView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2000-2023 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.vaadin.flow; | ||
|
||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.router.Route; | ||
import com.vaadin.flow.router.RouterLink; | ||
|
||
@Route("com.vaadin.flow.RouterView") | ||
public class RouterView extends Div { | ||
|
||
public RouterView() { | ||
RouterLink link = new RouterLink("RouterLink", NavigationView.class); | ||
link.setId(NavigationView.ROUTER_LINK_ID); | ||
|
||
add(new Span("RouterView"), new Div(), link); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
flow-tests/test-react-router/src/main/java/com/vaadin/flow/ServerView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* Copyright 2000-2023 Vaadin Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not | ||
* use this file except in compliance with the License. You may obtain a copy of | ||
* the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* License for the specific language governing permissions and limitations under | ||
* the License. | ||
*/ | ||
|
||
package com.vaadin.flow; | ||
|
||
import com.vaadin.flow.component.html.Div; | ||
import com.vaadin.flow.component.html.NativeButton; | ||
import com.vaadin.flow.component.html.Span; | ||
import com.vaadin.flow.router.Route; | ||
|
||
@Route("com.vaadin.flow.ServerView") | ||
public class ServerView extends Div { | ||
|
||
public ServerView() { | ||
NativeButton serverNavigation = new NativeButton( | ||
"Navigate through Server", event -> { | ||
event.getSource().getUI().get() | ||
.navigate(NavigationView.class); | ||
}); | ||
serverNavigation.setId(NavigationView.SERVER_ID); | ||
|
||
add(new Span("ServerView"), new Div(), serverNavigation); | ||
} | ||
} |
Oops, something went wrong.