From 0f6272811fc432d49042223051fe32da67ed43ae Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:16:42 -0300 Subject: [PATCH 01/11] chore(demo): rename route to applayout-full --- .../com/flowingcode/addons/applayout/ApplayoutDemoView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java index b8c7960..7fb7d88 100644 --- a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java +++ b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java @@ -46,7 +46,7 @@ import org.junit.Ignore; @SuppressWarnings("serial") -@Route(value = "applayout", layout = DemoLayout.class) +@Route(value = "applayout-full", layout = DemoLayout.class) @StyleSheet("context://frontend/styles/app-layout/demo-styles.css") @Ignore public class ApplayoutDemoView extends VerticalLayout { From 59bbdf1ce9e6b54b84e20efb4ca91a833894e030 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:17:19 -0300 Subject: [PATCH 02/11] refactor(demo): remove unused annotation --- .../java/com/flowingcode/addons/applayout/ApplayoutDemoView.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java index 7fb7d88..6ed800a 100644 --- a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java +++ b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java @@ -48,7 +48,6 @@ @SuppressWarnings("serial") @Route(value = "applayout-full", layout = DemoLayout.class) @StyleSheet("context://frontend/styles/app-layout/demo-styles.css") -@Ignore public class ApplayoutDemoView extends VerticalLayout { private VerticalLayout container = new VerticalLayout(); From 88a3830952bebb8cbd14c7a8dcaa54d1990cd396 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:19:35 -0300 Subject: [PATCH 03/11] refactor(demo): rename InternalView to SampleInternalView --- .../com/flowingcode/addons/applayout/ApplayoutDemoView.java | 2 +- .../applayout/{InternalView.java => SampleInternalView.java} | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) rename src/test/java/com/flowingcode/addons/applayout/{InternalView.java => SampleInternalView.java} (89%) diff --git a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java index 6ed800a..7d34a32 100644 --- a/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java +++ b/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java @@ -231,7 +231,7 @@ private Component[] createMenuItems() { new MenuItem("Toggle", VaadinIcon.BACKSPACE).configure(mi -> mi.add(new PaperToggle())), new MenuItem("Toggle", MenuItem.BLANK).configure(mi -> mi.add(new PaperToggle())), new MenuItem("External link").setHref("http://www.google.com"), - new MenuItem("Internal Link", InternalView.class), + new MenuItem("Internal Link", SampleInternalView.class), // icon as VaadinIcon enum new MenuItem("Content", VaadinIcon.BOOK, () -> showHamletContent()) diff --git a/src/test/java/com/flowingcode/addons/applayout/InternalView.java b/src/test/java/com/flowingcode/addons/applayout/SampleInternalView.java similarity index 89% rename from src/test/java/com/flowingcode/addons/applayout/InternalView.java rename to src/test/java/com/flowingcode/addons/applayout/SampleInternalView.java index 63f0e06..7deb75b 100644 --- a/src/test/java/com/flowingcode/addons/applayout/InternalView.java +++ b/src/test/java/com/flowingcode/addons/applayout/SampleInternalView.java @@ -24,11 +24,12 @@ import com.vaadin.flow.router.Route; import org.junit.Ignore; +@SuppressWarnings("serial") @Route("internal-view") @Ignore -public class InternalView extends Div { +public class SampleInternalView extends Div { - public InternalView() { + public SampleInternalView() { add(new Span("Internal view")); } } From e4cc32d8cdcb22f076b37502dbe45691a6e66d66 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:21:02 -0300 Subject: [PATCH 04/11] refactor(demo): change DemoView location --- .../com/flowingcode/{ => vaadin}/addons/applayout/DemoView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/test/java/com/flowingcode/{ => vaadin}/addons/applayout/DemoView.java (95%) diff --git a/src/test/java/com/flowingcode/addons/applayout/DemoView.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java similarity index 95% rename from src/test/java/com/flowingcode/addons/applayout/DemoView.java rename to src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java index 679e720..5ab424a 100644 --- a/src/test/java/com/flowingcode/addons/applayout/DemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java @@ -17,7 +17,7 @@ * limitations under the License. * #L% */ -package com.flowingcode.addons.applayout; +package com.flowingcode.vaadin.addons.applayout; import com.vaadin.flow.component.orderedlayout.VerticalLayout; import com.vaadin.flow.router.BeforeEnterEvent; From 5ab63bf6ce830a99374d27c6bc61b6ccc3644cde Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:22:10 -0300 Subject: [PATCH 05/11] refactor(demo): rename ApplayoutDemoView to AppLayoutDemoView --- .../addons/applayout/AppLayoutDemoView.java | 40 +++++++++++++++++++ .../vaadin/addons/applayout/DemoView.java | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java diff --git a/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java new file mode 100644 index 0000000..c53ffd6 --- /dev/null +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java @@ -0,0 +1,40 @@ +/*- + * #%L + * Template Add-on + * %% + * Copyright (C) 2023 Flowing Code + * %% + * 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. + * #L% + */ +package com.flowingcode.vaadin.addons.applayout; + +import com.flowingcode.vaadin.addons.DemoLayout; +import com.flowingcode.vaadin.addons.GithubLink; +import com.flowingcode.vaadin.addons.demo.TabbedDemo; +import com.vaadin.flow.router.ParentLayout; +import com.vaadin.flow.router.Route; + +@SuppressWarnings("serial") +@ParentLayout(DemoLayout.class) +@Route("applayout") +@GithubLink("https://github.com/FlowingCode/ExtendedLoginAddon") +public class AppLayoutDemoView extends TabbedDemo { + + public AppLayoutDemoView() { + addDemo(AppLayoutDemo.class); + addDemo(ExtendingAppLayoutDemo.class); + + setSizeFull(); + } +} diff --git a/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java index 5ab424a..1faf6d5 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/DemoView.java @@ -30,6 +30,6 @@ public class DemoView extends VerticalLayout implements BeforeEnterObserver { @Override public void beforeEnter(BeforeEnterEvent event) { - event.forwardTo(ApplayoutDemoView.class); + event.forwardTo(AppLayoutDemoView.class); } } From a7da267a0b5423ab37d4679fbf90ba3b13456575 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:23:07 -0300 Subject: [PATCH 06/11] refactor(demo): rename AbstractLayoutDemo to CustomAppLayout --- .../{AbstractLayoutDemo.java => CustomAppLayout.java} | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) rename src/test/java/com/flowingcode/addons/applayout/{AbstractLayoutDemo.java => CustomAppLayout.java} (94%) diff --git a/src/test/java/com/flowingcode/addons/applayout/AbstractLayoutDemo.java b/src/test/java/com/flowingcode/addons/applayout/CustomAppLayout.java similarity index 94% rename from src/test/java/com/flowingcode/addons/applayout/AbstractLayoutDemo.java rename to src/test/java/com/flowingcode/addons/applayout/CustomAppLayout.java index d399e6e..d7188b1 100644 --- a/src/test/java/com/flowingcode/addons/applayout/AbstractLayoutDemo.java +++ b/src/test/java/com/flowingcode/addons/applayout/CustomAppLayout.java @@ -23,9 +23,10 @@ import com.vaadin.flow.component.html.Image; import com.vaadin.flow.component.html.Span; -public class AbstractLayoutDemo extends AppLayout { +@SuppressWarnings("serial") +public class CustomAppLayout extends AppLayout { - public AbstractLayoutDemo() { + public CustomAppLayout() { setMenuItems(new MenuItem("Item 1"), new MenuItem("Item 2")); // menu header From e5010684279428288dca68c9c417c3a4d2ac0e48 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:23:49 -0300 Subject: [PATCH 07/11] refactor(demo): rename AbstractLayoutView to SampleView --- .../applayout/{AbstractLayoutView.java => SampleView.java} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/test/java/com/flowingcode/addons/applayout/{AbstractLayoutView.java => SampleView.java} (88%) diff --git a/src/test/java/com/flowingcode/addons/applayout/AbstractLayoutView.java b/src/test/java/com/flowingcode/addons/applayout/SampleView.java similarity index 88% rename from src/test/java/com/flowingcode/addons/applayout/AbstractLayoutView.java rename to src/test/java/com/flowingcode/addons/applayout/SampleView.java index 184f569..7da47b8 100644 --- a/src/test/java/com/flowingcode/addons/applayout/AbstractLayoutView.java +++ b/src/test/java/com/flowingcode/addons/applayout/SampleView.java @@ -24,9 +24,9 @@ import com.vaadin.flow.router.Route; import org.junit.Ignore; -@Route(value = "view", layout = AbstractLayoutDemo.class) -@Ignore -public class AbstractLayoutView extends Div { +@SuppressWarnings("serial") +@Route(value = "view", layout = CustomAppLayout.class) +public class SampleView extends Div { { add(new Span("Hello world")); From 387d90c16410a06e3be59c39dde09fbf379d427a Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:24:28 -0300 Subject: [PATCH 08/11] feat(demo): add AppLayout Full Demo --- .../addons/applayout/AppLayoutDemo.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemo.java diff --git a/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemo.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemo.java new file mode 100644 index 0000000..2a38576 --- /dev/null +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemo.java @@ -0,0 +1,24 @@ +package com.flowingcode.vaadin.addons.applayout; + +import com.flowingcode.vaadin.addons.demo.DemoSource; +import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.component.html.IFrame; +import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.router.Route; + +@DemoSource("/src/test/java/com/flowingcode/addons/applayout/ApplayoutDemoView.java") +@DemoSource("/frontend/styles/app-layout/demo-styles.css") +@PageTitle("AppLayout Full Demo") +@SuppressWarnings("serial") +@Route(value = "applayout/applayout-demo", layout = AppLayoutDemoView.class) +public class AppLayoutDemo extends Div { + + public AppLayoutDemo() { + setClassName("wrap-iframe"); + IFrame iframe = new IFrame("/applayout-full"); + iframe.setClassName("frame"); + iframe.setSizeFull(); + iframe.getElement().setAttribute("frameBorder", "0"); + add(iframe); + } +} From ac85fca5ef078e739fb249b6c19119b2403ec55e Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Fri, 16 Aug 2024 18:24:46 -0300 Subject: [PATCH 09/11] feat(demo): add extending layout demo --- .../applayout/ExtendingAppLayoutDemo.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/test/java/com/flowingcode/vaadin/addons/applayout/ExtendingAppLayoutDemo.java diff --git a/src/test/java/com/flowingcode/vaadin/addons/applayout/ExtendingAppLayoutDemo.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/ExtendingAppLayoutDemo.java new file mode 100644 index 0000000..0718557 --- /dev/null +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/ExtendingAppLayoutDemo.java @@ -0,0 +1,24 @@ +package com.flowingcode.vaadin.addons.applayout; + +import com.flowingcode.vaadin.addons.demo.DemoSource; +import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.component.html.IFrame; +import com.vaadin.flow.router.PageTitle; +import com.vaadin.flow.router.Route; + +@DemoSource("/src/test/java/com/flowingcode/addons/applayout/CustomAppLayout.java") +@DemoSource("/src/test/java/com/flowingcode/addons/applayout/SampleView.java") +@PageTitle("Extending AppLayout Demo") +@SuppressWarnings("serial") +@Route(value = "applayout/extending-applayout-demo", layout = AppLayoutDemoView.class) +public class ExtendingAppLayoutDemo extends Div { + + public ExtendingAppLayoutDemo() { + setClassName("wrap-iframe"); + IFrame iframe = new IFrame("/view"); + iframe.setClassName("frame"); + iframe.setSizeFull(); + iframe.getElement().setAttribute("frameBorder", "0"); + add(iframe); + } +} From d6afab3e2553652791e631392f89b1735fee0e09 Mon Sep 17 00:00:00 2001 From: Martin Lopez Date: Tue, 15 Oct 2024 19:14:27 -0300 Subject: [PATCH 10/11] build(demo): add commons-demo dependency --- pom.xml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pom.xml b/pom.xml index 9411c00..588df61 100644 --- a/pom.xml +++ b/pom.xml @@ -15,6 +15,7 @@ UTF-8 UTF-8 ${project.basedir}/drivers + 4.0.0 11.0.14 @@ -54,6 +55,11 @@ import ${vaadin.version} + + com.flowingcode.vaadin.addons.demo + commons-demo + ${flowingcode.commons.demo.version} + @@ -105,6 +111,11 @@ 6.0.9 true + + com.flowingcode.vaadin.addons.demo + commons-demo + test + org.slf4j slf4j-simple From 1e848dbba7ddb9300523a7e1b21339b3149be450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20L=C3=B3pez?= Date: Fri, 18 Oct 2024 20:12:41 -0300 Subject: [PATCH 11/11] fix(demo): fix @GitHubLink value Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java index c53ffd6..52d870d 100644 --- a/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java +++ b/src/test/java/com/flowingcode/vaadin/addons/applayout/AppLayoutDemoView.java @@ -28,7 +28,7 @@ @SuppressWarnings("serial") @ParentLayout(DemoLayout.class) @Route("applayout") -@GithubLink("https://github.com/FlowingCode/ExtendedLoginAddon") +@GithubLink("https://github.com/FlowingCode/AppLayoutAddon") public class AppLayoutDemoView extends TabbedDemo { public AppLayoutDemoView() {