-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fixes #11209 - Fix PrefixIPAddress view with saved sort preferences #12820
Fixes #11209 - Fix PrefixIPAddress view with saved sort preferences #12820
Conversation
This removes the annotations when an ordering is specified, however it does not seem possible to restore as the ordering is saved in the user's config as |
I've opened #12914 to address the above bug. |
Do you need anything cleaned up on this one? |
Unfortunately I'm not sure this approach is viable. Even with the fix for #12914 in, |
TLDR;
The annotations would not exist on #1 and #2, but would on #3, correct? The behaviour around #3 and #1 is desired, but the behaviour around #2 is not. I think we would need to clean up the #2 as that should show the annotations if the order has been cleared, but that might simply be also adding a check for "is None" or whatever it gets to when you clear it. I can work on that. I think it might be worth it to also wrap some tests around this. I think this is how we want to have tests work:
Could you confirm this? I think it would be trivial to fix the logic and build a test around that specific for IPAddresses |
I think I have this sorted out properly. Let me know if you want me to try and add in some table tests. |
Thanks for your work on on this @DanSheps but IMO we should find a cleaner way to evaluate the table's ordering logic. This might entail refactoring |
I think this is a chicken and egg problem. You need to generate the table before you can configure() it which is where the ordering changes happen, but you can't make the ordering changes without first initializing the table (which includes the data as part of initialization). The only thing I could think of if we refactor would be to call get_table() before with an empty dataset then take the data from get_table_data() and overwrite the data in the table class. Something like:
To me, that seems messy and could have unintended consequences, it does do a lot with that data within the init() method. It may make more sense to have the prep_table_data be part of the table class, but I can't see that working really well either unless we have a different table class for ObjectChildrenView. |
…erences are saved
236dc8b
to
eb89d2b
Compare
Tested latest changes. LGTM. |
Fixes: #11209 - Do not add available ips when IPAddressTable sort preferences are saved
Checked other views (PrefixPrefixes, PrefixIPRanges) for this and is only present in the IPAddress view (Prefixes are annotated with actual prefixes, IPRanges have no such annotation)