From 5c55013d7b12aeb2cead4fdcf17b878cd4afdd44 Mon Sep 17 00:00:00 2001 From: Dmitriy Zakharov Date: Mon, 8 Sep 2025 11:48:23 +0400 Subject: [PATCH 1/2] #JBPMP-575 Menu item "Process instances" doesn't change color when the process instances screen is showed Removed redundant urlQueryParameters which interfered with menu --- src/main/resources/io/openbpm/control/menu.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/main/resources/io/openbpm/control/menu.xml b/src/main/resources/io/openbpm/control/menu.xml index d6c28f5..b1e75ff 100644 --- a/src/main/resources/io/openbpm/control/menu.xml +++ b/src/main/resources/io/openbpm/control/menu.xml @@ -13,9 +13,6 @@ - - - From 8799f5314c37cd8f60a6df77985f7d9e0521a905 Mon Sep 17 00:00:00 2001 From: dbimaka Date: Wed, 24 Sep 2025 15:10:30 +0300 Subject: [PATCH 2/2] #JBPMP-575 Menu item "Process instances" doesn't change color when the process instances screen is showed Added new HighlightCondition for Process instances menu item, to highlight the menu item even with added url parameters --- .../uicomponent/menu/ControlListMenu.java | 18 ++++++++++++++++++ src/main/resources/io/openbpm/control/menu.xml | 3 +++ 2 files changed, 21 insertions(+) diff --git a/src/main/java/io/openbpm/control/uicomponent/menu/ControlListMenu.java b/src/main/java/io/openbpm/control/uicomponent/menu/ControlListMenu.java index 0975201..ab5527d 100644 --- a/src/main/java/io/openbpm/control/uicomponent/menu/ControlListMenu.java +++ b/src/main/java/io/openbpm/control/uicomponent/menu/ControlListMenu.java @@ -8,8 +8,10 @@ import com.vaadin.flow.component.Component; import com.vaadin.flow.component.html.ListItem; import com.vaadin.flow.component.html.Span; +import com.vaadin.flow.router.*; import io.jmix.flowui.component.main.JmixListMenu; import io.jmix.flowui.kit.component.main.ListMenu; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.lang.Nullable; @@ -74,6 +76,22 @@ protected ListItem createMenuRecursively(MenuItem menuItem) { return super.createMenuRecursively(menuItem); } + @Override + protected @NotNull RouterLink createMenuItemComponent(@NotNull MenuItem menuItem) { + RouterLink menuItemComponent = super.createMenuItemComponent(menuItem); + if ("bpm_ProcessInstance.list".equals(menuItem.getId())) { + menuItemComponent.setHighlightCondition((HighlightCondition) (routerLink, event) -> { + Location menuLocation = new Location(routerLink.getHref()); + String menuPath = menuLocation.getPath(); + + String currentPath = event.getLocation().getPath(); + + return currentPath.equals(menuPath); + }); + } + return menuItemComponent; + } + @Nullable protected MenuItem getExistingMenu(String menuId) { MenuItem existingMenuItem = getMenuItem(menuId); diff --git a/src/main/resources/io/openbpm/control/menu.xml b/src/main/resources/io/openbpm/control/menu.xml index b1e75ff..d6c28f5 100644 --- a/src/main/resources/io/openbpm/control/menu.xml +++ b/src/main/resources/io/openbpm/control/menu.xml @@ -13,6 +13,9 @@ + + +