diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts index d16be0d8b97e2..d2e7c4089e88b 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.mocks.ts @@ -50,6 +50,7 @@ jest.mock('./steps', () => { AgentPolicySelectionStep: jest.fn(), AgentEnrollmentKeySelectionStep: jest.fn(), ViewDataStep: jest.fn(), + DownloadStep: jest.fn(), }; }); diff --git a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx index 8eeb5fac4b0df..329e0c144687a 100644 --- a/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx +++ b/x-pack/plugins/fleet/public/components/agent_enrollment_flyout/steps.tsx @@ -9,15 +9,24 @@ import React, { useCallback, useMemo } from 'react'; import { EuiText, EuiButton, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; +import semver from 'semver'; import type { AgentPolicy, PackagePolicy } from '../../types'; -import { sendGetOneAgentPolicy } from '../../hooks'; +import { sendGetOneAgentPolicy, useKibanaVersion } from '../../hooks'; import { FLEET_SERVER_PACKAGE } from '../../constants'; import { EnrollmentStepAgentPolicy } from './agent_policy_selection'; import { AdvancedAgentAuthenticationSettings } from './advanced_agent_authentication_settings'; export const DownloadStep = () => { + const kibanaVersion = useKibanaVersion(); + const kibanaVersionURLString = useMemo( + () => + `${semver.major(kibanaVersion)}-${semver.minor(kibanaVersion)}-${semver.patch( + kibanaVersion + )}`, + [kibanaVersion] + ); return { title: i18n.translate('xpack.fleet.agentEnrollment.stepDownloadAgentTitle', { defaultMessage: 'Download the Elastic Agent to your host', @@ -30,9 +39,16 @@ export const DownloadStep = () => { defaultMessage="Fleet Server runs on an Elastic Agent. You can download the Elastic Agent binaries and verification signatures from Elastic’s download page." /> + + + +