-
Notifications
You must be signed in to change notification settings - Fork 20
Fix and refactor column filters in stacked tables #3231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
Use signals instead to make the models independent of DB editor. Re #3229
The list in DB editor wasn't chronologically ordered. Also, made RecentDatabasesPopupMenu independent of DB editor. Re #3229
Stacked tables would try to repaint their contents while a new DB was being added to DB editor. This failed because the db_map used by the views' single models was unregistered from DB manager and therefore DB locks associated with the DB were not present. Re #3229
Modernized and simplified code regarding (auto) filter menus. Some internal semantics did change, but no user-facing changes were intended. Re #3229
Menus are UI components and have no place in the models. Re #3229
Since StackedTableView is used as a base class for the empty tables who don't use autofilter functionality, it makes more sense to offer it as a mixin. Also, the functionality is only used in spine_db_editor so move the class there from spinetoolbox.widgets Re #3229
This is a considerable refactoring to auto filter functionality in stacked tables (compound/single models). Originally, filter data carried entity class ids and DB mappings with it but this complicated stuff and caused bugs. Filter data is now simply a set values that should pass the filter. Further, the filter doesn't follow DB changes with fetch parents anymore since that also complicated stuff too much. Instead, we now recreate the available values every time the filter menu is opened. If this proves to be too slow for large datasets, we may consider a caching scheme later. Re #2886 Re #3229
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3231 +/- ##
==========================================
+ Coverage 69.78% 70.02% +0.24%
==========================================
Files 201 202 +1
Lines 39048 39081 +33
Branches 4729 4725 -4
==========================================
+ Hits 27248 27367 +119
+ Misses 10493 10412 -81
+ Partials 1307 1302 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
|
Great! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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 contains a considerable rework of the column filters in stacked tables (a.k.a auto filters). The most impactful change is that the filters now filter solely by values; entity class ids and databases are not considered as part of the value anymore. Further, filter data is recreated when the filter menu is opened. This ensures the menu always contains latest information and simplifies the code a lot. Additionally, some minor bugs in the filter menu were fixed like the "Add current selection to filter" option not always working as intended due to a row number mistake.
Fixes #2886, #3229
Checklist before merging