Skip to content

Add tenant group filter to map sidebar - #31

Merged
Jackass4life merged 3 commits into
mainfrom
copilot/add-filter-for-teanet-group
Mar 23, 2026
Merged

Add tenant group filter to map sidebar#31
Jackass4life merged 3 commits into
mainfrom
copilot/add-filter-for-teanet-group

Conversation

Copilot AI commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

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)

  • New _build_tenant_group_map() builds a {tenant_id: tenant_group_name} lookup by fetching tenancy/tenants/ and resolving each tenant's tenant_group field, with tenancy/tenant-groups/ as a fallback for brief nested objects
  • get_locations() now includes tenant_group in each location dict

Frontend

  • templates/index.html: new <select id="filter-tenant-group"> dropdown
  • static/js/map.js: populate, apply (AND logic), and clear the tenant group filter

Mock server & tests

  • demo/mock_nautobot.py: TENANT_GROUPS seed data, tenant_group on tenants, /api/tenancy/tenant-groups/ endpoint
  • 5 new tests covering populated/empty tenant group values and the HTML filter element
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature: Added filter for Teanet group</issue_title>
<issue_description>In the filter section added also for Teanet group.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 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.

Copilot AI and others added 2 commits March 23, 2026 20:56
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
Copilot AI changed the title [WIP] Add filter for Teanet group Add tenant group filter to map sidebar Mar 23, 2026
Copilot AI requested a review from Jackass4life March 23, 2026 20:59
@Jackass4life
Jackass4life marked this pull request as ready for review March 23, 2026 21:03
@Jackass4life
Jackass4life merged commit 39a4271 into main Mar 23, 2026
3 checks passed
@Jackass4life
Jackass4life deleted the copilot/add-filter-for-teanet-group branch March 24, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Added filter for Teanet group

2 participants