Skip to content

Commit

Permalink
MID-8646:fix for allowed search mode in report preview
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Mar 28, 2023
1 parent 6d98856 commit 4e4d68c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<i class="fa fa-search mr-1"/>&nbsp;
<span wicket:id="searchButtonLabel"/>
</button>
<button aria-expanded="false" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
<button aria-expanded="false" type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
wicket:id="dropdownButton">
<span class="sr-only"><wicket:message key="SplitButtonDropDown.toggle"/></span>
</button>
<ul class="dropdown-menu dropdown-menu-right" role="menu">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
package com.evolveum.midpoint.gui.impl.component.search.panel;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.data.column.AjaxLinkPanel;

import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.list.ListItem;
Expand All @@ -31,6 +33,7 @@ public abstract class SearchButtonWithDropdownMenu<E extends Enum> extends BaseP
private static final String ID_SEARCH_BUTTON_LABEL = "searchButtonLabel";
private static final String ID_MENU_ITEMS = "menuItems";
private static final String ID_MENU_ITEM = "menuItem";
private static final String ID_DROPDOWN_BUTTON = "dropdownButton";

// E selectedValue = null;

Expand Down Expand Up @@ -79,6 +82,15 @@ protected String load() {
searchButton.add(buttonLabel);
add(searchButton);

AjaxButton dropdownButton = new AjaxButton(ID_DROPDOWN_BUTTON) {
@Override
public void onClick(AjaxRequestTarget target) {

}
};
dropdownButton.setOutputMarkupId(true);
dropdownButton.add(new VisibleEnableBehaviour(() -> true, () -> getModelObject().size() > 1));
add(dropdownButton);
ListView<E> menuItems = new ListView<E>(ID_MENU_ITEMS, getModel()) {

private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private void processVariables(VariablesMap variablesMap) {

@Override
protected SearchPanel initSearch(String headerId) {
getSearchModel().getObject().setAllowedModeList(List.of(SearchBoxModeType.BASIC));
return new SearchPanel<>(headerId, getSearchModel()) {
private static final long serialVersionUID = 1L;

Expand Down

0 comments on commit 4e4d68c

Please sign in to comment.