Skip to content

Commit

Permalink
Filter with default configuration is not applied if the link was open…
Browse files Browse the repository at this point in the history
…ed in a new browser tab #4018

(cherry picked from commit 391d077)
  • Loading branch information
KremnevDmitry committed Jan 13, 2025
1 parent 592f022 commit d063735
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ protected void initComponent() {

protected void onFilterValueChanged(ComponentValueChangeEvent<CustomField<V>, V> event) {
updateQueryCondition(event.getValue());
apply();

if (event.isFromClient()) {
apply();
}
}

protected HorizontalLayout createRootComponent() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,14 +582,13 @@ public void setCurrentConfiguration(Configuration currentConfiguration) {
protected void setCurrentConfigurationInternal(Configuration currentConfiguration, boolean fromClient) {
if (configurations.contains(currentConfiguration)
|| getEmptyConfiguration().equals(currentConfiguration)) {
if (this.currentConfiguration != currentConfiguration) {
clearValues();
}

Configuration previousConfiguration = this.currentConfiguration;
this.currentConfiguration = currentConfiguration;

if (previousConfiguration != currentConfiguration) {
clearValues();
}

refreshCurrentConfigurationLayout();
updateSelectConfigurationDropdown();

Expand Down Expand Up @@ -977,7 +976,7 @@ protected void clearValues() {
return;
}

for (FilterComponent component : getCurrentConfiguration().getRootLogicalFilterComponent().getFilterComponents()) {
for (FilterComponent component : rootLogicalFilterComponent.getFilterComponents()) {
if (component instanceof SingleFilterComponentBase singleFilterComponent) {
singleFilterComponent.setValue(getCurrentConfiguration()
.getFilterComponentDefaultValue(singleFilterComponent.getParameterName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public Map<String, Object> initConfigurationValuesMap(Configuration configuratio
SingleFilterComponentBase singleFilterComponent = ((SingleFilterComponentBase<?>) filterComponent);
String parameterName = singleFilterComponent.getParameterName();
valuesMap.put(parameterName, singleFilterComponent.getValue());
singleFilterComponent.setValue(configuration.getFilterComponentDefaultValue(parameterName));
}
}

Expand Down

0 comments on commit d063735

Please sign in to comment.