Skip to content
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
20 changes: 18 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
<version>1.18.34</version>
</dependency>
<dependency>
<groupId>com.flowingcode.vaadin</groupId>
<artifactId>json-migration-helper</artifactId>
<version>0.9.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down Expand Up @@ -543,14 +554,19 @@
<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<vaadin.version>25.0.0-beta2</vaadin.version>
<vaadin.version>25.0.3</vaadin.version>
<jetty.version>11.0.26</jetty.version>
</properties>
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-dev</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.flowingcode.vaadin.addons.demo</groupId>
<artifactId>commons-demo</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -28,6 +28,7 @@
import com.flowingcode.vaadin.addons.orgchart.event.NodesRemovedEvent;
import com.flowingcode.vaadin.addons.orgchart.event.ParentAddedEvent;
import com.flowingcode.vaadin.addons.orgchart.event.SiblingsAddedEvent;
import com.flowingcode.vaadin.jsonmigration.JsonMigration;
import com.vaadin.flow.component.AttachEvent;
import com.vaadin.flow.component.ClientCallable;
import com.vaadin.flow.component.ComponentEvent;
Expand All @@ -44,6 +45,7 @@
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.experimental.ExtensionMethod;

/**
* OrgChart component definition. <br>
Expand All @@ -57,13 +59,15 @@
@NpmPackage(value = "orgchart", version = "3.7.0")
@NpmPackage(value = "html2canvas", version = "1.4.1")
@NpmPackage(value = "jquery", version = "3.6.2")
@NpmPackage(value = "@polymer/polymer", version = "3.5.2")
@JsModule("jquery/dist/jquery.js")
@JsModule("orgchart/dist/js/jquery.orgchart.js")
@CssImport("orgchart/dist/css/jquery.orgchart.min.css")
@Tag("fc-orgchart")
@JsModule("./fc-orgchart.js")
@CssImport("./fc-orgchart-styles.css")
@NpmPackage(value = "json-digger", version = "2.0.2")
@ExtensionMethod(value = JsonMigration.class, suppressBaseMethods = true)
public class OrgChart extends Div {

private OrgChartItem orgChartItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*-
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* 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.orgchart.event;

import com.flowingcode.vaadin.addons.orgchart.OrgChart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/frontend/fc-orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -177,7 +177,10 @@ private VerticalLayout getEditionLayout() {
// Action Selector
actionSelector = new RadioButtonGroup<>();
actionSelector.setLabel("Select Action");
actionSelector.setItems("Add", "Edit", "Delete");
// #if vaadin eq 0
ReflectionUtil.setItems(actionSelector,"Add", "Edit", "Delete");
// #endif
// show-source actionSelector.setItems("Add", "Edit", "Delete");
actionSelector.addValueChangeListener(event -> updateComponentStates());

Div separator = new Div();
Expand All @@ -204,7 +207,10 @@ private VerticalLayout getEditionLayout() {
// Relation type selector
typeSelector = new RadioButtonGroup<String>();
typeSelector.setLabel("Select Relation Type:");
typeSelector.setItems("Parent(root)", "Child", "Sibling");
// #if vaadin eq 0
ReflectionUtil.setItems(typeSelector, "Parent(root)", "Child", "Sibling");
// #endif
// show-source typeSelector.setItems("Parent(root)", "Child", "Sibling");
typeSelector.setValue("Child");
typeSelector.addThemeVariants(RadioGroupVariant.LUMO_VERTICAL);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*-
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* 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.orgchart;

import java.util.Arrays;
import java.util.Collection;

import com.vaadin.flow.component.radiobutton.RadioButtonGroup;

public class ReflectionUtil {

/** Reflective call in order to maintain binary compatibility with Vaadin 14 - 24+ */
static void setItems(RadioButtonGroup<String> radioButtonGroup,
String... items) {
try {
RadioButtonGroup.class
.getMethod("setItems", Collection.class)
.invoke(radioButtonGroup, Arrays.asList(items));
} catch (Exception e) {
throw new RuntimeException(e);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* #%L
* OrgChart Add-on
* %%
* Copyright (C) 2017 - 2025 Flowing Code S.A.
* Copyright (C) 2017 - 2026 Flowing Code S.A.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down