From fbbbbfafc7f5623f8c711d9250f1bff0dc7d692a Mon Sep 17 00:00:00 2001 From: John Schulz Date: Mon, 19 Apr 2021 15:12:29 -0400 Subject: [PATCH] Don't show 'Upgrade available' for agents in hosted policies --- .../fleet/sections/agents/agent_list_page/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx index 6dd1b8a9693e8..49fdd156c4f56 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/agent_list_page/index.tsx @@ -407,7 +407,7 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { {safeMetadata(version)} - {isAgentUpgradeable(agent, kibanaVersion) ? ( + {isAgentSelectable(agent) && isAgentUpgradeable(agent, kibanaVersion) ? ( @@ -593,7 +593,15 @@ export const AgentListPage: React.FunctionComponent<{}> = () => { emptyPrompt ) } - items={totalAgents ? agents : []} + items={ + totalAgents + ? showUpgradeable + ? agents.filter( + (agent) => isAgentSelectable(agent) && isAgentUpgradeable(agent, kibanaVersion) + ) + : agents + : [] + } itemId="id" columns={columns} pagination={{