Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IVYPORTAL-17458 Quick Search function keeps working although it is deactivated #979

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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.stream.Collectors;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.primefaces.PrimeFaces;
import org.primefaces.model.SortMeta;
Expand Down Expand Up @@ -248,6 +249,11 @@ public void loadUserFilter() {

@Override
public void setQuickSearchKeyword() {
this.dataModel.getCriteria().setQuickSearchKeyword(this.getQuickSearchKeyword());
if (BooleanUtils.isTrue(enableQuickSearch)) {
this.dataModel.getCriteria().setQuickSearchKeyword(this.getQuickSearchKeyword());
}
else {
this.setQuickSearchKeyword(StringUtils.EMPTY);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.BooleanUtils;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

Expand Down Expand Up @@ -176,4 +178,11 @@ public boolean isEnableQuickSearch() {
public void setEnableQuickSearch(boolean enableQuickSearch) {
this.enableQuickSearch = enableQuickSearch;
}

@Override
public void setQuickSearchKeyword(String quickSearchKeyword) {
if (BooleanUtils.isTrue(this.enableQuickSearch)) {
super.setQuickSearchKeyword(quickSearchKeyword);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.stream.Collectors;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.primefaces.PrimeFaces;
import org.primefaces.model.SortMeta;
Expand Down Expand Up @@ -209,8 +210,12 @@ public void setRowsPerPage(int rowsPerPage) {

@Override
public void setQuickSearchKeyword() {
this.dataModel.getCriteria().setQuickSearchKeyword(this.getQuickSearchKeyword());
}
if (BooleanUtils.isTrue(this.enableQuickSearch)) {
this.dataModel.getCriteria().setQuickSearchKeyword(this.getQuickSearchKeyword());
}
else {
this.setQuickSearchKeyword(StringUtils.EMPTY);
}}

public List<DashboardFilter> getFilters() {
return this.dataModel.getCriteria().getFilters();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<c:set var="widgetContentId" value="#{cc.clientId}:widget-content" />
<p:inputText id="quick-search-input-#{index}" value="#{widget.quickSearchKeyword}"
placeholder="#{ivy.cms.co('/ch.ivy.addon.portalkit.ui.jsf/common/globalSearch')}"
onkeydown="handleKeyDown(event)" disabled="#{!isReadOnlyMode and widget.type eq 'PROCESS'}">
onkeydown="handleKeyDown(event)" disabled="#{!isReadOnlyMode}">
<p:ajax delay="800" listener="#{widget.updateQuickSearchKeyword()}"
onstart="return shouldTriggerAjax(event)"
event="keydown" process="@this"
Expand Down
Loading