From 5a89d93f73b51389a01485847a2408a7397ed4e0 Mon Sep 17 00:00:00 2001 From: Luke Heath Date: Thu, 19 May 2022 17:21:06 -0500 Subject: [PATCH] Remove view all hosts links from device user page (#5793) --- .../hosts/ManageHostsPage/ManageHostsPage.tsx | 21 +++++++++++-------- .../hosts/details/DeviceUserPage/_styles.scss | 4 ++++ .../hosts/details/cards/Policies/Policies.tsx | 6 ++++-- frontend/services/entities/hosts.ts | 7 +++++++ 4 files changed, 27 insertions(+), 11 deletions(-) diff --git a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx index 002ee6e090..dd3a67168a 100644 --- a/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx +++ b/frontend/pages/hosts/ManageHostsPage/ManageHostsPage.tsx @@ -1329,8 +1329,6 @@ const ManageHostsPage = ({ }`} > {`${count} host${count === 1 ? "" : "s"}`} - {/* Export all columns initially in 4.13 release but feature being pushed - back by product until we build client side filtering to export only selected columns */} + ); }, [isHostCountLoading, filteredHostCount]); @@ -1494,14 +1492,19 @@ const ManageHostsPage = ({ }, ]; + const tableColumns = generateVisibleTableColumns( + hiddenColumns, + config, + currentUser, + currentTeam + ); + + const columnAccessors = tableColumns.map((column) => column.accessor); + columnAccessors.shift(); + return ( !isValidPolicyResponse(policy.response) diff --git a/frontend/services/entities/hosts.ts b/frontend/services/entities/hosts.ts index fa71b87f23..ca690597b5 100644 --- a/frontend/services/entities/hosts.ts +++ b/frontend/services/entities/hosts.ts @@ -18,6 +18,7 @@ export interface ILoadHostsOptions { policyId?: number; policyResponse?: string; softwareId?: number; + columns?: string; } export type ILoadHostDetailsExtension = "device_mapping" | "macadmins"; @@ -59,6 +60,7 @@ export default { const policyId = options?.policyId || null; const policyResponse = options?.policyResponse || null; const softwareId = options?.softwareId || null; + const columns = options?.columns || null; let orderKeyParam = ""; let orderDirection = ""; @@ -129,6 +131,7 @@ export default { const policyId = options?.policyId || null; const policyResponse = options?.policyResponse || null; const softwareId = options?.softwareId || null; + const columns = options?.columns || null; // TODO: add this query param logic to client class const pagination = `page=${page}&per_page=${perPage}`; @@ -187,6 +190,10 @@ export default { path += `&software_id=${softwareId}`; } + if (columns) { + path += `&columns=${columns}`; + } + return sendRequest("GET", path); }, loadHostDetails: (hostID: number) => {