diff --git a/frontend/fleet/helpers.ts b/frontend/fleet/helpers.ts index dd82f15eea..35963ef0b2 100644 --- a/frontend/fleet/helpers.ts +++ b/frontend/fleet/helpers.ts @@ -344,6 +344,14 @@ export const humanHostDetailUpdated = (detailUpdated: string): string => { return moment(detailUpdated).fromNow(); }; +export const hostTeamName = (teamName: string | null): string => { + if (!teamName) { + return "No team"; + } + + return teamName; +}; + export const humanQueryLastRun = (lastRun: string): string => { // Handles the case when a query has never been ran. // July 28, 2016 is the date of the initial commit to fleet/fleet. @@ -405,6 +413,7 @@ export default { humanHostEnrolled, humanHostMemory, humanHostDetailUpdated, + hostTeamName, humanQueryLastRun, secondsToHms, labelSlug, diff --git a/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx b/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx index a9b6c477e3..40f5d1ab78 100644 --- a/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx +++ b/frontend/pages/hosts/ManageHostsPage/HostTableConfig.tsx @@ -16,6 +16,7 @@ import { humanHostUptime, humanHostLastSeen, humanHostDetailUpdated, + hostTeamName, } from "fleet/helpers"; import { IConfig } from "interfaces/config"; import { IUser } from "interfaces/user"; @@ -107,9 +108,16 @@ const allHostTableHeaders: IHostDataColumn[] = [ }, { title: "Team", - Header: "Team", + Header: (cellProps) => ( + + ), accessor: "team_name", - Cell: (cellProps) => , + Cell: (cellProps) => ( + + ), }, { title: "Status",