Skip to content

Commit

Permalink
feature/IVYPORTAL-17458-Quick-Search-function-keeps-working-although-… (
Browse files Browse the repository at this point in the history
#979)

* feature/IVYPORTAL-17458-Quick-Search-function-keeps-working-although-it-is-deactivated-LE

- fix bug related to quick search function in Task, Case, Process widget

* feature/IVYPORTAL-17458-Quick-Search-function-keeps-working-although-it-is-deactivated-LE

- Disable the input of quick search in edit mode
  • Loading branch information
lmluat-axonivy authored Sep 5, 2024
1 parent 7332d9b commit 8114583
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
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

0 comments on commit 8114583

Please sign in to comment.