From a3736a7222c9c2c556332295686c55751bf4a7b7 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 18 Jan 2022 12:48:28 -0500 Subject: [PATCH] [Fleet] Fix hide enrollment key tooltip (#123188) (#123246) (cherry picked from commit 8ac8d6910ccba857eef89c93ed87d555e2bf7530) Co-authored-by: Nicolas Chaulet --- .../sections/agents/enrollment_token_list_page/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx index a62c76882b2a1..2d776dc8d15d1 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agents/enrollment_token_list_page/index.tsx @@ -96,7 +96,6 @@ const ApiKeyField: React.FunctionComponent<{ apiKeyId: string }> = ({ apiKeyId } }) } color="text" - isDisabled={state === 'LOADING'} onClick={toggleKey} iconType={state === 'VISIBLE' ? 'eyeClosed' : 'eye'} /> @@ -269,6 +268,10 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { }, ]; + const isLoading = + (enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest) || + (agentPoliciesRequest.isLoading && agentPoliciesRequest.isInitialRequest); + return ( {isModalOpen && ( @@ -312,10 +315,10 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => { - loading={enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest} + loading={isLoading} hasActions={true} noItemsMessage={ - enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest ? ( + isLoading ? (