UI - Only include custom sourced emails that are present (#24411)

## Addresses #24321 

Note that the "Used by" section includes the Google chrome user and the
custom user that has an associated email, but ignores the custom user
with no email:

<img width="1349" alt="Screenshot 2024-12-04 at 9 37 10 PM"
src="https://github.com/user-attachments/assets/b03b519b-c904-4327-bf76-494a3c80a27b">

- [x] Changes file added for user-visible changes in `changes/`, 
- [x] Manual QA for all new/changed functionality

---------

Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
jacobshandling 2024-12-05 15:38:35 -08:00 committed by GitHub
parent f86fe0d408
commit 6514631dcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -0,0 +1,2 @@
- Exclude any custom sourced "users" from the host details "used by" display if Fleet doesn't have
an email for them.

View file

@ -119,7 +119,10 @@ export const mapDeviceUsersForDisplay = (
idpUser = d;
break;
case "custom":
customUser = d;
// exclude custom user without email
if (d.email) {
customUser = d;
}
break;
default:
newDeviceMapping.push(getDeviceUserForDisplay(d));

View file

@ -39,7 +39,6 @@ import {
IQueryKeyQueriesLoadAll,
ISchedulableQuery,
} from "interfaces/schedulable_query";
import { IHostScript } from "interfaces/script";
import {
normalizeEmptyValues,