Skip to content

Commit

Permalink
[8.2] [Security Solution] fix flashing authz on endpoint integration (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
joeypoon authored Apr 26, 2022
1 parent 1d1cbc9 commit c12d03b
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiSpacer } from '@elastic/eui';
import { EuiSpacer, EuiLoadingSpinner } from '@elastic/eui';
import React, { memo, useMemo } from 'react';
import { useHttp } from '../../../../../../common/lib/kibana/hooks';
import { PackageCustomExtensionComponentProps } from '../../../../../../../../fleet/public';
Expand Down Expand Up @@ -99,7 +99,7 @@ export const EndpointPackageCustomExtension = memo<PackageCustomExtensionCompone
(props) => {
const http = useHttp();
const canSeeHostIsolationExceptions = useCanSeeHostIsolationExceptionsMenu();
const { canAccessEndpointManagement } = useEndpointPrivileges();
const { loading, canAccessEndpointManagement } = useEndpointPrivileges();

const trustedAppsApiClientInstance = useMemo(
() => TrustedAppsApiClient.getInstance(http),
Expand Down Expand Up @@ -171,7 +171,13 @@ export const EndpointPackageCustomExtension = memo<PackageCustomExtensionCompone
]
);

return canAccessEndpointManagement ? artifactCards : <NoPermissions />;
return loading ? (
<EuiLoadingSpinner data-test-subj="endpointExtensionLoadingSpinner" />
) : canAccessEndpointManagement ? (
artifactCards
) : (
<NoPermissions />
);
}
);

Expand Down

0 comments on commit c12d03b

Please sign in to comment.