-
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
Saved Filters #9623
Comments
@jasonyates it sounds like a neat idea, but could you spend some more time fleshing out the proposal please? You haven't noted anything under database changes, and I'd assume this would require at least a new model. |
@jeremystretch Done. I included a proposed mockup of a piece of the UI too. |
Expanding on the proposed model a bit, we probably need:
If I've proposed making the We still need to determine how a saved filter would be applied in practice. I see two options:
There are some caveats to both approaches. Making reference to a filter doesn't reveal the actual query parameters being used, which is likely to lead to confusion. It might also be difficult to parse on the backend. However, the second approach is of very limited utility outside of the UI: It provides no way for an API client to directly employ a saved filter. A third, hybrid approach might be reasonable: A request for e.g. |
I like this idea. I also think we should leverage NetBox User preference framework to potentially store a "default" filter, per object type, per user. |
I like the "redirect" idea as it would mean it would be easy for a user to edit the fields after they've selected the filter. for example maybe theres a filter "find x cust devices with custom attrib" where its searching for devices where a tenant is set to x customer and some other logic. User selects that filter, gets redirected, then changes the tenant in the filter to the one that suits them. permissions: api: |
Still in the early stages, but came up with this pretty quick. After some experimentation, I'm leaning away from the redirect idea, primarily because there's no clean way to convey to the user which saved filter they have applied. The groundwork is all in place now though; happy to discuss up to and during the beta period. |
That looks awesome!Can the filter be selected via URL params?I know most of my users use bookmarks, so it would be beneficial if I could send them a URL pointing to a filter.On 27 Oct 2022, at 22:44, Jeremy Stretch ***@***.***> wrote:
Still in the early stages, but came up with this pretty quick. After some experimentation, I'm leaning away from the redirect idea, primarily because there's no clean way to convey to the user which saved filter they have applied. The groundwork is all in place now though; happy to discuss up to and during the beta period.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
@hagbarddenstore Yes, you link to e.g. |
Perfect!Awesome work!On 28 Oct 2022, at 20:13, Jeremy Stretch ***@***.***> wrote:
@hagbarddenstore Yes, you link to e.g. /dcim/devices/?filter=my-custom-filter to apply the saved filter.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
* Work on #7854 * Move to new URL scheme. * Fix PEP8 errors * Fix PEP8 errors * Add GraphQL and fix primary_ip missing * Fix PEP8 on GQL Type * Fix missing NestedSerializer. * Fix missing NestedSerializer & rename VDC to VDCs * Fix migration * Change Validation for identifier * Fix missing migration * Rebase to feature * Post-review changes * Remove VDC Type * Remove M2M Enforcement logic * Interface related changes * Add filter fields to filterset for Interface filter * Add form field to filterset form for Interface filter * Add VDC display to interface detail template * Remove VirtualDeviceContextTypeChoices * Accommodate recent changes in feature branch * Add tests Add missing search() * Update tests, and fix model form * Update test_api * Update test_api.InterfaceTest create_data * Fix issue with tests * Update interface serializer * Update serializer and tests * Update status to be required * Remove error message for constraint * Remove extraneous import * Re-ordered devices menu to place VDC below virtual chassis * Add helptext for `identifier` field * Fix breadcrumb link * Remove add interface link * Add missing tenant and status fields * Changes to tests as per Jeremy * Change for #9623 Co-authored-by: Jeremy Stretch <jstretch@ns1.com> * Update filterset form for status field * Remove Rename View * Change tabs to spaces * Update netbox/dcim/tables/devices.py Co-authored-by: Jeremy Stretch <jstretch@ns1.com> * Update netbox/dcim/tables/devices.py Co-authored-by: Jeremy Stretch <jstretch@ns1.com> * Fix tenant in bulk_edit * Apply suggestions from code review Co-authored-by: Jeremy Stretch <jstretch@ns1.com> * Add status field to table. * Re-order table fields. Co-authored-by: Jeremy Stretch <jstretch@ns1.com>
NetBox version
3.2.5
Feature type
New functionality
Proposed functionality
After building a filter it would be useful to be able to save it for future re-use, give it a name and the option to make it public. Public filters would then be viewable by all logged in to Netbox.
Proposing a 3rd tab alongside Results | Filters - perhaps 'Saved Filters'. Or possibly a section within the existing Filters tab to show any saved filters.
UI Suggestion for model list view
Filters would not need to be modifiable, once saved, the user that created the filter can delete it from the saved filters list. When a user is removed from the system, the filters they created should also be removed.
Use case
I often find myself having to build the same filter repeatedly in Netbox as well as having to remember to share links with the team when I build a useful filter. Having the option to save a filter in Netbox and share it with my users would save time.
Database changes
A new model would need to be created to store the saved filters. Model would require a relation to the object type e.g. dcim.devices, filter attributes, friendly name, is public and a relation to the user that created it (to allow that user to delete it).
External dependencies
No response
The text was updated successfully, but these errors were encountered: