mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
# Backport This will backport the following commits from `main` to `8.6`: - [[Fleet] Fix add fleet server flow from agent policy page (#149507)](https://github.com/elastic/kibana/pull/149507) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Nicolas Chaulet","email":"nicolas.chaulet@elastic.co"},"sourceCommit":{"committedDate":"2023-01-26T15:55:36Z","message":"[Fleet] Fix add fleet server flow from agent policy page (#149507)","sha":"da83d96ff65a3ad5f56d350576e6c4811e5f26af","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.7.0","v8.6.1"],"number":149507,"url":"https://github.com/elastic/kibana/pull/149507","mergeCommit":{"message":"[Fleet] Fix add fleet server flow from agent policy page (#149507)","sha":"da83d96ff65a3ad5f56d350576e6c4811e5f26af"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/149507","number":149507,"mergeCommit":{"message":"[Fleet] Fix add fleet server flow from agent policy page (#149507)","sha":"da83d96ff65a3ad5f56d350576e6c4811e5f26af"}},{"branch":"8.6","label":"v8.6.1","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
parent
a37bf49288
commit
b744988d28
1 changed files with 9 additions and 5 deletions
|
@ -42,7 +42,8 @@ export const Instructions = (props: InstructionProps) => {
|
|||
refreshAgentPolicies,
|
||||
} = props;
|
||||
const fleetStatus = useFleetStatus();
|
||||
const { isUnhealthy: isFleetServerUnhealthy } = useFleetServerUnhealthy();
|
||||
const { isUnhealthy: isFleetServerUnhealthy, isLoading: isLoadingFleetServerHealth } =
|
||||
useFleetServerUnhealthy();
|
||||
|
||||
useEffect(() => {
|
||||
refreshAgentPolicies();
|
||||
|
@ -66,14 +67,17 @@ export const Instructions = (props: InstructionProps) => {
|
|||
|
||||
const fleetServers = agents?.items || [];
|
||||
|
||||
if (isLoadingAgents || isLoadingAgentPolicies) return <Loading size="l" />;
|
||||
if (isLoadingAgents || isLoadingAgentPolicies || isLoadingFleetServerHealth)
|
||||
return <Loading size="l" />;
|
||||
|
||||
const hasNoFleetServerHost = fleetStatus.isReady && (fleetServerHosts?.length ?? 0) === 0;
|
||||
|
||||
const showAgentEnrollment =
|
||||
fleetStatus.isReady &&
|
||||
(isFleetServerPolicySelected ||
|
||||
(!isFleetServerUnhealthy && fleetServers.length > 0 && (fleetServerHosts?.length ?? 0) > 0));
|
||||
isFleetServerPolicySelected ||
|
||||
(fleetStatus.isReady &&
|
||||
!isFleetServerUnhealthy &&
|
||||
fleetServers.length > 0 &&
|
||||
(fleetServerHosts?.length ?? 0) > 0);
|
||||
|
||||
const showFleetServerEnrollment =
|
||||
!isFleetServerPolicySelected &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue