[Fleet] Fix hide enrollment key tooltip (#123188) (#123245)

(cherry picked from commit 8ac8d6910c)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
Kibana Machine 2022-01-18 12:44:39 -05:00 committed by GitHub
parent 5d35ae52cb
commit 999b27aca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 (
<DefaultLayout section="enrollment_tokens">
{isModalOpen && (
@ -312,10 +315,10 @@ export const EnrollmentTokenListPage: React.FunctionComponent<{}> = () => {
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiBasicTable<EnrollmentAPIKey>
loading={enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest}
loading={isLoading}
hasActions={true}
noItemsMessage={
enrollmentAPIKeysRequest.isLoading && enrollmentAPIKeysRequest.isInitialRequest ? (
isLoading ? (
<FormattedMessage
id="xpack.fleet.enrollemntAPIKeyList.loadingTokensMessage"
defaultMessage="Loading enrollment tokens..."