Skip to content

Commit

Permalink
fix: unselect scope when select all
Browse files Browse the repository at this point in the history
  • Loading branch information
Hadrien Froger committed Nov 4, 2024
1 parent af869fd commit 302fa05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/packs/src/decidim/geo/stores/filterStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ const onFilteredByScope = (filters) => {
if (previousScope && `${scopeId}` === `${previousScope?.id}`) return;
const selectedScope = scopeForId(scopeId);
if (selectedScope) selectScope(selectedScope);
else selectScope(null)
} else {
if (previousScope) {
previousScope.repaint();
}
const toRepaintScope = scopeForId(previousScope.id)
selectScope(null);
if (toRepaintScope) {
toRepaintScope.repaint();
}
}
};

Expand All @@ -146,8 +148,8 @@ store.subscribe(
// Select/Unselect scopes if a scopeFilter is present
if (activeFilters) {
await pointStore.getState().pointsForFilters(activeFilters);
onFilteredByScope(activeFilters);
}
onFilteredByScope(activeFilters);

// Update the filter modal state
const { toFilterOptions } = store.getState();
Expand Down
1 change: 1 addition & 0 deletions lib/decidim/geo/proposal/proposal_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def filter_active(query)
query.where(
"(resource_type = ? AND resource_status NOT IN ('rejected', 'withdrawn')) OR (resource_type = ? AND (end_date >= ? OR end_date IS NULL))",
manifest_name,
manifest_name,
15.days.ago.to_date
)
end
Expand Down

0 comments on commit 302fa05

Please sign in to comment.