Skip to content

Add rack as filter option to rack elevation #11504

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

Closed
rodvand opened this issue Jan 14, 2023 · 3 comments · Fixed by #12442
Closed

Add rack as filter option to rack elevation #11504

rodvand opened this issue Jan 14, 2023 · 3 comments · Fixed by #12442
Assignees
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application

Comments

@rodvand
Copy link
Contributor

rodvand commented Jan 14, 2023

NetBox version

v3.4.2

Feature type

New functionality

Proposed functionality

In the rack elevation filter section add rack as a multiple input choice field.

Use case

If you want to "compare" single racks to each other. It is possible today with using ?id=x&id=y in the URL but it would be nice to have this feature as a field in the filter section.

Database changes

None

External dependencies

None

@rodvand rodvand added the type: feature Introduction of new functionality to the application label Jan 14, 2023
@rodvand
Copy link
Contributor Author

rodvand commented Jan 15, 2023

As the id is exposed in the

class RackElevationFilterForm(RackFilterForm):
id = DynamicModelMultipleChoiceField(
queryset=Rack.objects.all(),
label=_('Rack'),
required=False,
query_params={
'site_id': '$site_id',
'location_id': '$location_id',
}
)
we can add the functionality by copying the
fieldsets = (
(None, ('q', 'filter_id', 'tag')),
('Location', ('region_id', 'site_group_id', 'site_id', 'location_id')),
('Function', ('status', 'role_id')),
('Hardware', ('type', 'width', 'serial', 'asset_tag')),
('Tenant', ('tenant_group_id', 'tenant_id')),
('Contacts', ('contact', 'contact_role', 'contact_group')),
('Weight', ('weight', 'max_weight', 'weight_unit')),
)
from RackFilterForm and add id on line
(None, ('q', 'filter_id', 'tag')),

as this: (None, ('q', 'filter_id', 'tag', 'id')),

It's not very DRY so if there is any other way of making this more dynamic I'm open for suggestions...

@rodvand
Copy link
Contributor Author

rodvand commented Jan 27, 2023

I haven't run the feature branch to test, but will #11598 cover this FR @jeremystretch ? Having to go from the rack list to elevations isn't a big deal for me.

@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions github-actions bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Apr 28, 2023
@arthanson arthanson self-assigned this May 2, 2023
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed pending closure Requires immediate attention to avoid being closed for inactivity labels May 3, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants