fix: client software overview shows client roles only

The overview is always limited to devices whose role is listed in
software_device_roles, now "Client" and "Windows Client" by default and
matched by name or slug (windows-client from the Windows agent). The role
filter offers only these roles as checkboxes; none ticked means all client
roles, so servers can no longer appear by clearing the filter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-18 14:25:12 +01:00
1 parent e24a12164c
commit 7d267ec05d
7 files changed
+59 -20

No files matched your search

+10
View File
@@ -73,3 +73,13 @@ class SoftwareSummaryTest(SimpleTestCase):
self.assertTrue(software.supports_software(client, roles=["Clients"]))
self.assertFalse(software.supports_software(server, roles=["Clients"]))
self.assertFalse(software.supports_software(SimpleNamespace(role=None), roles=["Clients"]))
def test_default_client_roles_match_name_or_slug_but_not_servers(self):
def role(name, slug):
return SimpleNamespace(name=name, slug=slug)
roles = software.DEFAULT_SOFTWARE_DEVICE_ROLES
self.assertTrue(software.is_client_role(role("Client", "client"), roles))
self.assertTrue(software.is_client_role(role("Windows Client", "windows-client"), roles))
self.assertTrue(software.is_client_role(role("Windows-Clients", "windows-client"), roles))
self.assertFalse(software.is_client_role(role("Server", "server"), roles))