-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Module specific filter panels #837
Merged
gogonzo
merged 30 commits into
filter_panel_refactor@main
from
135_multiple_filterpanels@filter_panel_refactor@main
Jun 16, 2023
Merged
Module specific filter panels #837
gogonzo
merged 30 commits into
filter_panel_refactor@main
from
135_multiple_filterpanels@filter_panel_refactor@main
Jun 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nels@filter_panel_refactor@main
…els@filter_panel_refactor@main
…els@filter_panel_refactor@main
- avoid observers to trigger when the app starts - change id when the duplicated state is added - disable filter manager only when is global
- deep copy filters on init
moved teal.code to suggests
…els@filter_panel_refactor@main
- global filter is a singleton - local filter set on nested-tabs level - resolve module$filters before creating FilteredData
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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 PR solves insightsengineering/teal.slice#135 use together with insightsengineering/teal.slice#300
I propose following API in which each filter_var (teal_slice) has own id which can be linked with the modules in the
mapping
argument.id
can be specified by the user (see 4th filter_var), and mapping is also unrestricted as far as one uses module names and filter names. Code below means that module called funny would haveADSL_categorical
andSE
. Except that all modules will haveglobal_filters = "ADSL_numeric"
on startup.Problem is solved mostly in
teal
by managing three objects:slices_global
is a single object containing combinedteal_slices
object from each module.slices_map
is a single list where each element (named after module) containing character vector of filters used in this module.Whole implementation is based on relationships between these objects so that update in one causes relevant actions to update the rest (to keep 1,2,3 consistent). These objects are distinguished by the green color on the diagram below and they represent particular state. We expect that these states can be changed or initialized in several ways, which are:
slices_global
and activate it in any module.Let me explain all possible scenarios in detail. Numeration below is corresponding to red numbers on the diagram.
FilteredData
designated to this module.id
of the filters so it is easy to determine if something has been added, activated or deactivated (removed from module).slices_global
.slices_map
.slices_map
can be displayed any time when opening filter manager and it is represented by the matrix of TRUE/FALSE.slices_map
could be also changed by the app user by interacting within a filter manager. I imagine this in the way where user can activate any filter kept inslices_global
in any module.slices_map
is observed and compared with module filters.set_filter_state
method for module-FilteredData.remove_filter_state
method for the module-FilteredDataslices_global
could be changed directly.slices_global
are observed and comparison with module-slices is made14-15. It could be concluded that new global filters been added or removed which need to be followed by (6).
Challanges
teal
applications modules could have duplicated labels. This can happen when one uses nested tabs. This will cause module-specific to fail as it's impossible to find unique module specified inmapping
. Solved: when module-specific filter panel is enabled there is assertion on modules to have a unique label.disable
can't be independent and shared in the same time - agreed with @lcd2yyz to remove this functionality. Instead we will be activating/deactivating filters through filter-manager or by quick-add button available inFilterState$ui/srv_active
example app
Example safety