Skip to content

Commit

Permalink
[Cloud Security] fix cloud formation pop-up flicker (#191136)
Browse files Browse the repository at this point in the history
## Summary

Summarize your PR. If it involves visual changes include a screenshot or
gif.

If go to CSPM page and click save and continue, the Cloud Formation Pop
occasionally flickers and shows Fleet Server host error for one second.
This PR adds a boolean `isLoadingIntialRequest` for us to wait after
loading Fleet Server hosts before showing the errors.

[Quick Wins](elastic/security-team#10316)

Locally:

https://github.com/user-attachments/assets/bf393103-9d21-4ddf-96a9-8fc3e9626369

Serverless QA


https://github.com/user-attachments/assets/d1877a5a-97ba-4ce6-b87b-177656bdd004
  • Loading branch information
Omolola-Akinleye authored Aug 23, 2024
1 parent e6e75ef commit 5d0acf7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export const PostInstallCloudFormationModal: React.FunctionComponent<{
);

const { agentPolicyWithPackagePolicies } = useAgentPolicyWithPackagePolicies(agentPolicy.id);
const { fleetServerHost } = useFleetServerHostsForPolicy(agentPolicyWithPackagePolicies);
const { fleetServerHost, isLoadingInitialRequest } = useFleetServerHostsForPolicy(
agentPolicyWithPackagePolicies
);

const cloudFormationProps = getCloudFormationPropsFromPackagePolicy(packagePolicy);

Expand All @@ -67,7 +69,7 @@ export const PostInstallCloudFormationModal: React.FunctionComponent<{

<EuiModalBody>
<CloudFormationGuide awsAccountType={cloudFormationProps.awsAccountType} />
{error && isError && (
{error && isError && !isLoadingInitialRequest && (
<>
<EuiSpacer size="m" />
<EuiCallOut title={error} color="danger" iconType="error" />
Expand Down

0 comments on commit 5d0acf7

Please sign in to comment.