Skip to content

Commit

Permalink
axiom search visibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Feb 15, 2022
1 parent 4dfd2aa commit 822c50a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<textarea class="form-control input-sm" rows="2" wicket:id="advancedArea"
style="margin-right: 30px; width: 220px; height: 60px; overflow: hidden; float:right;"></textarea>
<input wicket:id="axiomQueryField" type="text" class="form-control input-sm"
style="width: 91.6666667%; min-width: 300px; float:right;">
style="margin-right: 30px; min-width: 600px; float:right;">
</div>
</wicket:fragment>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.stream.Collectors;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.prism.Containerable;

import com.evolveum.midpoint.web.component.search.SearchValue;
Expand Down Expand Up @@ -257,7 +258,8 @@ protected void initSearchItemsPanel(RepeatingView searchItemsRepeatingView) {
AdvancedSearchFragment advancedSearchFragment = new AdvancedSearchFragment(searchItemsRepeatingView.newChildId(), ID_ADVANCED_SEARCH_FRAGMENT,
SearchPanel.this);
advancedSearchFragment.setOutputMarkupId(true);
advancedSearchFragment.add(new VisibleBehaviour(() -> SearchBoxModeType.ADVANCED.equals(getModelObject().getSearchMode())));
advancedSearchFragment.add(new VisibleBehaviour(() -> SearchBoxModeType.ADVANCED.equals(getModelObject().getSearchMode()) ||
SearchBoxModeType.AXIOM_QUERY.equals(getModelObject().getSearchMode())));
searchItemsRepeatingView.add(advancedSearchFragment);

FulltextSearchFragment fulltextSearchFragment = new FulltextSearchFragment(searchItemsRepeatingView.newChildId(), ID_FULLTEXT_SEARCH_FRAGMENT,
Expand Down Expand Up @@ -310,6 +312,10 @@ public void onClick(AjaxRequestTarget target) {

@Override
public IModel<Boolean> getVisible() {
if (SearchBoxModeType.AXIOM_QUERY.equals(searchBoxModeType)) {
return Model.of(WebModelServiceUtils.isEnableExperimentalFeature(getPageBase())
&& getModelObject().getConfig().getAllowedMode().contains(searchBoxModeType));
}
return Model.of(getModelObject().getConfig().getAllowedMode().contains(searchBoxModeType));
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,8 @@ public static <C extends Containerable> SearchBoxConfigurationType createDefault
config.searchItems(searchItems)
.defaultMode(SearchBoxModeType.BASIC)
.allowedMode(SearchBoxModeType.BASIC)
.allowedMode(SearchBoxModeType.ADVANCED);
.allowedMode(SearchBoxModeType.ADVANCED)
.allowedMode(SearchBoxModeType.AXIOM_QUERY);

if (ObjectType.class.isAssignableFrom(type) && isFullTextSearchEnabled(modelServiceLocator, (Class<? extends ObjectType>) type)) {
config.allowedMode(SearchBoxModeType.FULLTEXT);
Expand Down

0 comments on commit 822c50a

Please sign in to comment.