Add tenant group filter to map sidebar - #31
Merged
Conversation
Add a "Tenant Group" filter dropdown to the sidebar filter section. Locations are resolved to their tenant group via the tenant's tenant_group field in the Nautobot API. Changes: - app.py: add _build_tenant_group_map() helper and tenant_group field - templates/index.html: add filter-tenant-group select element - static/js/map.js: populate, apply, and clear tenant group filter - demo/mock_nautobot.py: add TENANT_GROUPS seed data and endpoint - tests: add unit and integration tests for tenant_group Co-authored-by: Jackass4life <94110786+Jackass4life@users.noreply.github.com> Agent-Logs-Url: https://github.com/Jackass4life/Nautobot-maps/sessions/8a5b4fe1-ccd3-406f-be2a-4124fd563b8e
Co-authored-by: Jackass4life <94110786+Jackass4life@users.noreply.github.com> Agent-Logs-Url: https://github.com/Jackass4life/Nautobot-maps/sessions/8a5b4fe1-ccd3-406f-be2a-4124fd563b8e
Copilot
AI
changed the title
[WIP] Add filter for Teanet group
Add tenant group filter to map sidebar
Mar 23, 2026
Jackass4life
marked this pull request as ready for review
March 23, 2026 21:03
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
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.
Adds a "Tenant Group" filter dropdown alongside the existing Status, Type, Parent, and Tenant filters. Tenant group is resolved indirectly: location → tenant → tenant_group.
Backend (
app.py)_build_tenant_group_map()builds a{tenant_id: tenant_group_name}lookup by fetchingtenancy/tenants/and resolving each tenant'stenant_groupfield, withtenancy/tenant-groups/as a fallback for brief nested objectsget_locations()now includestenant_groupin each location dictFrontend
templates/index.html: new<select id="filter-tenant-group">dropdownstatic/js/map.js: populate, apply (AND logic), and clear the tenant group filterMock server & tests
demo/mock_nautobot.py:TENANT_GROUPSseed data,tenant_groupon tenants,/api/tenancy/tenant-groups/endpointOriginal prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.