Skip to content

Commit

Permalink
Merge branch '8.3' into backport/8.3/pr-134859
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavyarm authored Jun 22, 2022
2 parents 16a0f5e + d88b972 commit d872dac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const getSelectAgentPolicyStep = ({
}): EuiStepProps => {
return {
title:
eligibleFleetServerPolicies.length === 0
eligibleFleetServerPolicies.length === 0 && !policyId
? i18n.translate('xpack.fleet.fleetServerSetup.stepCreateAgentPolicyTitle', {
defaultMessage: 'Create a policy for Fleet Server',
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ export const SelectCreateAgentPolicy: React.FC<Props> = ({
);

useEffect(() => {
setShowCreatePolicy(regularAgentPolicies.length === 0);
setShowCreatePolicy(regularAgentPolicies.length === 0 && !selectedPolicyId);
setNewName(incrementPolicyName(regularAgentPolicies, isFleetServerPolicy));
}, [regularAgentPolicies, isFleetServerPolicy]);
}, [regularAgentPolicies, isFleetServerPolicy, selectedPolicyId]);

const onAgentPolicyCreated = useCallback(
async (policy: AgentPolicy | null, errorMessage?: JSX.Element) => {
Expand Down

0 comments on commit d872dac

Please sign in to comment.