Skip to content

Fix/1551 deactivate filters via legend panel - #6846

Open
meyerlor wants to merge 3 commits into
3liz:masterfrom
meyerlor:fix/1551-deactivate-all-filters
Open

Fix/1551 deactivate filters via legend panel#6846
meyerlor wants to merge 3 commits into
3liz:masterfrom
meyerlor:fix/1551-deactivate-all-filters

Conversation

@meyerlor

@meyerlor meyerlor commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Make the "Deactivate all Filters" button work in the Legend panel and add button behind every layer in Legend panel:

FilterDeactivate

Fixes: #1551

@github-actions github-actions Bot added this to the 3.11.0 milestone May 17, 2026
@meyerlor
meyerlor force-pushed the fix/1551-deactivate-all-filters branch from 6e4640d to 793a3db Compare May 17, 2026 13:14
@meyerlor meyerlor changed the title Fix/1551 deactivate all filters Fix/1551 deactivate filters via legend panel May 17, 2026
@meyerlor
meyerlor force-pushed the fix/1551-deactivate-all-filters branch from 9bffd55 to 0642357 Compare May 17, 2026 13:26
@josemvm

josemvm commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Amazing, thanks a lot! 🚀

@rldhont

rldhont commented May 17, 2026

Copy link
Copy Markdown
Collaborator

@meyerlor could you add an end2end test ?

@meyerlor

meyerlor commented May 17, 2026

Copy link
Copy Markdown
Collaborator Author

added two tests:

  1. for the "deactivate all" button
  2. for the single layer button

Do you want to backport it to 3.9 or as it's a new feature just backport it to 3.10?

meyerlor added 2 commits May 17, 2026 21:15
Clear filters on every filtered layer instead of only the last one,
detect both selection-tool and form-filter (simple method) filters,
guard a null attributeLayerConfig crash in the removal cascade, and
keep the button visible while any layer remains filtered.
Each filtered layer in the legend tree now shows a filter button that
deactivates that single layer filter.
@meyerlor
meyerlor force-pushed the fix/1551-deactivate-all-filters branch 2 times, most recently from ff175d6 to 8816a2c Compare May 17, 2026 20:38
@meyerlor
meyerlor force-pushed the fix/1551-deactivate-all-filters branch from 8816a2c to 7986387 Compare May 17, 2026 21:13
@rldhont

rldhont commented May 18, 2026

Copy link
Copy Markdown
Collaborator

added two tests:

1. for the "deactivate all" button

2. for the single layer button

Do you want to backport it to 3.9 or as it's a new feature just backport it to 3.10?

Thanks for added tests!

I think it's a new feature and it has just to be backported to 3.10.

@rldhont
rldhont requested a review from mdouchin May 18, 2026 10:18
@mdouchin

Copy link
Copy Markdown
Collaborator

If I understand correctly, the previous changes made around the filter feature bring (nice) improvements which IMHO could lead to misbehaviours in the present state of the code.

Let me try to explain : when the filter tool was developed (the first time the attribute table tool was added to LWC), we restricted it to be able to filter only one layer at a time.

We did so because the filtered layer could be in relationships with child layers. We developed the cascading filter feature allowing to filter all children layers (and children of children). This was complex at the time (mainly because of the possibility to have pivot table A <- pivot -> B and be sure to not go in an infinite loop of filters). We did not develop it with recent "State based" tools. So this part of the code is fragile I think.

Since the recent changes, it seems to me we can now have more than one active filter ? If so, I think there can be collision between layers depending on theirs relationships. Imagine a child layer beeing filtered from the parent, and also with the form filter tool. How do we consolidate the filter for this layer at present (I think we don't yet)

We planed with @rldhont to refactor the whole code around the attribute table to detach the filtering feature, and build a proper "filter" state allowing to better control which layers were filtered, how the filter should be built and how it is discovered and shared among the different tools (time manager, form filter, attribute table, etc.).

We could create a new issue for discussion purpose. What do you think @rldhont @meyerlor @mind84 ?

@mind84

mind84 commented May 19, 2026

Copy link
Copy Markdown
Collaborator

@mdouchin,

+1 for creating a dedicated issue. Also, I think it's worth making the filtering functionality stable on multiple levels at the same time. There are cases where this feature would be very convenient, such as the ability to view a set of historical data by filtering on the validity of the records. This isn't a particularly common request, but sometimes such needs arise.

@meyerlor

Copy link
Copy Markdown
Collaborator Author

+1
same from me, a dedicated discussion issue seems a good idea!
I had no time yet to test if those remaining PR's make trouble with the child features filter. I will test it thoroughly as soon i find the time!

@github-actions

Copy link
Copy Markdown

The Lizmap project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 2 months and is being automatically marked as "stale".
If there is no further activity on this pull request, it will be closed in two weeks.

@github-actions github-actions Bot added the stale This ticket might be closed soon label Jul 20, 2026
@meyerlor meyerlor removed the stale This ticket might be closed soon label Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filter - desative current filter --> desative all filters

5 participants