Allow the Terms panel to ignore it's own filters #1201
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit implements what was discussed in #1126. It is also dependant on that pull-request for allowing toggling of filters (included here).
The change adds 3 settings to the terms panel config: "Filter mode", "Ignore own", and "Radio select".
It is useful for using the terms panel as a type of "selector" to easily flip between different term factors. The idea being that with this setting turned on, the terms panel will not be affected by the facet filters it added itself to the filtering panel.
Imagine I have a terms panel showing "Top 5 Pages". At the moment, if you click on one, you'll be left with only that single page name listed in the panel after it refreshes. With the 'ignore own' toggle all 5 pages will remain and can be clicked for toggling additional term filters.
I've also added some color overrides to the rendering to grey out any terms which are not being selected (if you select at least one term). The "Radio Select" mode allows that only one term filter can be selected at a time. If you have term1 filtered on, and you select term2, then term1's filter will be removed.
Lastly, the "Filter mode" setting allows you to specify the facet filters which are added to be 'must' or 'either' mode.