Skip to content

Commit

Permalink
MID-8313 additional menu link now visible
Browse files Browse the repository at this point in the history
(cherry picked from commit ef788ac)
  • Loading branch information
1azyman committed Nov 25, 2022
1 parent 4c451c1 commit dabe046
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.xml.ns._public.common.common_3.RichHyperlinkType;

import org.apache.commons.lang3.StringUtils;

/**
* Created by Kate on 19.09.2016.
*/
public class AdditionalMenuItem extends MainMenuItem {

private String targetUrl;

public AdditionalMenuItem(RichHyperlinkType link, Class<? extends PageBase> page) {
super(link.getLabel(), link.getIcon() == null ? BaseMenuItem.DEFAULT_ICON : link.getIcon().getCssClass(), page);

this.targetUrl = link.getTargetUrl();
}


public String getTargetUrl() {
return targetUrl;
}

@Override
protected boolean isNotEmpty() {
return super.isNotEmpty() || StringUtils.isNotEmpty(targetUrl);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void addCollectionMenuItem(MenuItem menuItem) {
}
}

private boolean isNotEmpty() {
protected boolean isNotEmpty() {
// If pageClass is not null, we can check page authorization
// otherwise, empty items means that no sub-items were authorized
if (getPageClass() != null) {
Expand Down

0 comments on commit dabe046

Please sign in to comment.