Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import { FormattedMessage } from '@kbn/i18n-react';
import { EuiText, EuiLink, EuiSteps, EuiSpacer, EuiLoadingSpinner } from '@elastic/eui';

import { Error } from '../../../../../../../components';
import {
useStartServices,
useAgentVersion,
useShowCompleteAgentInstructions,
} from '../../../../../../../../../hooks';
import { useStartServices, useAgentVersion } from '../../../../../../../../../hooks';

import { CreatePackagePolicyBottomBar, NotObscuredByBottomBar } from '../..';
import {
Expand Down Expand Up @@ -54,9 +50,6 @@ export const InstallElasticAgentManagedPageStep: React.FC<InstallAgentPageProps>
const [commandCopied, setCommandCopied] = useState(false);
const [applyCommandCopied, setApplyCommandCopied] = useState(false);

const { onChangeShowCompleteAgentInstructions, showCompleteAgentInstructions } =
useShowCompleteAgentInstructions();

if (!enrollmentAPIKey) {
return (
<Error
Expand All @@ -82,7 +75,6 @@ export const InstallElasticAgentManagedPageStep: React.FC<InstallAgentPageProps>
fleetServerHost,
agentVersion: agentVersion || '',
showInstallServers,
showCompleteAgentInstructions,
});

const steps = [
Expand All @@ -97,8 +89,6 @@ export const InstallElasticAgentManagedPageStep: React.FC<InstallAgentPageProps>
fleetServerHost,
onCopy: () => setCommandCopied(true),
rootIntegrations: getRootIntegrations(agentPolicy?.package_policies ?? []),
onChangeShowCompleteAgentInstructions,
showCompleteAgentInstructions,
}),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
} from '../..';

import { Error as FleetError } from '../../../../../../../components';
import {
useKibanaVersion,
useShowCompleteAgentInstructions,
} from '../../../../../../../../../hooks';
import { useKibanaVersion } from '../../../../../../../../../hooks';
import {
InstallStandaloneAgentStep,
ConfigureStandaloneAgentStep,
Expand All @@ -41,9 +38,6 @@ export const InstallElasticAgentStandalonePageStep: React.FC<InstallAgentPagePro
const { yaml, onCreateApiKey, isCreatingApiKey, apiKey, downloadYaml } =
useFetchFullPolicy(agentPolicy);

const { onChangeShowCompleteAgentInstructions, showCompleteAgentInstructions } =
useShowCompleteAgentInstructions();

if (!agentPolicy) {
return (
<FleetError
Expand All @@ -58,10 +52,7 @@ export const InstallElasticAgentStandalonePageStep: React.FC<InstallAgentPagePro
);
}

const installManagedCommands = StandaloneInstructions({
agentVersion: kibanaVersion,
showCompleteAgentInstructions,
});
const installManagedCommands = StandaloneInstructions({ agentVersion: kibanaVersion });

const steps = [
ConfigureStandaloneAgentStep({
Expand All @@ -80,8 +71,6 @@ export const InstallElasticAgentStandalonePageStep: React.FC<InstallAgentPagePro
fullCopyButton: true,
onCopy: () => setCommandCopied(true),
rootIntegrations: getRootIntegrations(agentPolicy?.package_policies ?? []),
onChangeShowCompleteAgentInstructions,
showCompleteAgentInstructions,
}),
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ import { getGcpIntegrationDetailsFromAgentPolicy } from '../../cloud_security_po

import { StandaloneInstructions, ManualInstructions } from '../../enrollment_instructions';

import {
useGetOneEnrollmentAPIKey,
useStartServices,
useAgentVersion,
useShowCompleteAgentInstructions,
} from '../../../hooks';
import { useGetOneEnrollmentAPIKey, useStartServices, useAgentVersion } from '../../../hooks';
import { useFetchFullPolicy } from '../hooks';

import type { InstructionProps } from '../types';
Expand Down Expand Up @@ -66,17 +61,13 @@ export const StandaloneSteps: React.FunctionComponent<InstructionProps> = ({
isK8s
);

const { showCompleteAgentInstructions, onChangeShowCompleteAgentInstructions } =
useShowCompleteAgentInstructions();

const agentVersion = useAgentVersion();

const instructionsSteps = useMemo(() => {
const standaloneInstallCommands = StandaloneInstructions({
agentVersion: agentVersion || '',
downloadSource,
downloadSourceProxy,
showCompleteAgentInstructions,
});

const steps: EuiContainedStepProps[] = !agentPolicy
Expand Down Expand Up @@ -116,8 +107,6 @@ export const StandaloneSteps: React.FunctionComponent<InstructionProps> = ({
isK8s,
cloudSecurityIntegration,
rootIntegrations: getRootIntegrations(selectedPolicy?.package_policies ?? []),
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
})
);

Expand All @@ -143,8 +132,6 @@ export const StandaloneSteps: React.FunctionComponent<InstructionProps> = ({
cloudSecurityIntegration,
mode,
setMode,
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
]);

if (!agentVersion) {
Expand Down Expand Up @@ -186,8 +173,6 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({
const { enrolledAgentIds } = usePollingAgentCount(selectedPolicy?.id || '');

const agentVersion = useAgentVersion();
const { showCompleteAgentInstructions, onChangeShowCompleteAgentInstructions } =
useShowCompleteAgentInstructions();

const { gcpProjectId, gcpOrganizationId, gcpAccountType } =
getGcpIntegrationDetailsFromAgentPolicy(selectedPolicy);
Expand All @@ -205,7 +190,6 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({
gcpOrganizationId,
gcpAccountType,
showInstallServers,
showCompleteAgentInstructions,
});

const instructionsSteps = useMemo(() => {
Expand Down Expand Up @@ -275,8 +259,6 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({
fleetServerHost,
enrollToken,
rootIntegrations: getRootIntegrations(selectedPolicy?.package_policies ?? []),
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
})
);
}
Expand Down Expand Up @@ -328,8 +310,6 @@ export const ManagedSteps: React.FunctionComponent<InstructionProps> = ({
agentDataConfirmed,
installedPackagePolicy,
gcpProjectId,
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
]);

if (!agentVersion) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import { i18n } from '@kbn/i18n';

import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';

import type { EuiSwitchProps } from '@elastic/eui';

import type { GetOneEnrollmentAPIKeyResponse } from '../../../../common/types/rest_spec/enrollment_api_key';

import { InstallSection } from '../../enrollment_instructions/install_section';
Expand All @@ -32,8 +30,6 @@ export const InstallManagedAgentStep = ({
fullCopyButton,
onCopy,
rootIntegrations,
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
}: {
selectedApiKeyId?: string;
apiKeyData?: GetOneEnrollmentAPIKeyResponse | null;
Expand All @@ -46,8 +42,6 @@ export const InstallManagedAgentStep = ({
fullCopyButton?: boolean;
onCopy?: () => void;
rootIntegrations?: Array<{ name: string; title: string }>;
showCompleteAgentInstructions: boolean;
onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange'];
}): EuiContainedStepProps => {
const nonCompleteStatus = selectedApiKeyId ? undefined : 'disabled';
const status = isComplete ? 'complete' : nonCompleteStatus;
Expand All @@ -67,8 +61,6 @@ export const InstallManagedAgentStep = ({
fullCopyButton={fullCopyButton}
fleetServerHost={fleetServerHost}
rootIntegrations={rootIntegrations}
showCompleteAgentInstructions={showCompleteAgentInstructions}
onChangeShowCompleteAgentInstructions={onChangeShowCompleteAgentInstructions}
/>
) : (
<React.Fragment />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { i18n } from '@kbn/i18n';

import type { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';

import type { EuiSwitchProps } from '@elastic/eui';

import type { CommandsByPlatform } from '../../../applications/fleet/components/fleet_server_instructions/utils/install_command_utils';

import { InstallSection } from '../../enrollment_instructions/install_section';
Expand All @@ -26,8 +24,6 @@ export const InstallStandaloneAgentStep = ({
fullCopyButton,
onCopy,
rootIntegrations,
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
}: {
installCommand: CommandsByPlatform;
isK8s?: K8sMode;
Expand All @@ -36,8 +32,6 @@ export const InstallStandaloneAgentStep = ({
fullCopyButton?: boolean;
onCopy?: () => void;
rootIntegrations?: Array<{ name: string; title: string }>;
showCompleteAgentInstructions: boolean;
onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange'];
}): EuiContainedStepProps => {
return {
title: i18n.translate('xpack.fleet.agentEnrollment.stepEnrollAndRunAgentTitle', {
Expand All @@ -52,8 +46,6 @@ export const InstallStandaloneAgentStep = ({
fullCopyButton={fullCopyButton}
isManaged={false}
rootIntegrations={rootIntegrations}
showCompleteAgentInstructions={showCompleteAgentInstructions}
onChangeShowCompleteAgentInstructions={onChangeShowCompleteAgentInstructions}
/>
),
status: isComplete ? 'complete' : undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

import React from 'react';

import type { EuiSwitchProps } from '@elastic/eui';
import { EuiFlexGroup, EuiIcon, EuiSpacer, EuiSwitch, EuiToolTip } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

import type { CommandsByPlatform } from '../../applications/fleet/components/fleet_server_instructions/utils';

import { InstallationMessage } from '../agent_enrollment_flyout/installation_message';
Expand All @@ -32,8 +27,6 @@ interface Props {
isManaged?: boolean;
onCopy?: () => void;
rootIntegrations?: Array<{ name: string; title: string }>;
showCompleteAgentInstructions: boolean;
onChangeShowCompleteAgentInstructions: EuiSwitchProps['onChange'];
}

export const InstallSection: React.FunctionComponent<Props> = ({
Expand All @@ -46,26 +39,12 @@ export const InstallSection: React.FunctionComponent<Props> = ({
isManaged = true,
onCopy,
rootIntegrations,
showCompleteAgentInstructions,
onChangeShowCompleteAgentInstructions,
}) => {
return (
<>
<InstallationMessage isK8s={isK8s} isManaged={isManaged} />
<RootPrivilegesCallout rootIntegrations={rootIntegrations} />
<UnprivilegedInfo />
<EuiFlexGroup gutterSize="xs">
<EuiSwitch
label={addElasticAgentCompleteLabel}
checked={showCompleteAgentInstructions}
onChange={onChangeShowCompleteAgentInstructions}
compressed
/>
<EuiToolTip position="top" content={addElasticAgentCompleteTooltipContent}>
<EuiIcon tabIndex={0} type="iInCircle" />
</EuiToolTip>
</EuiFlexGroup>
<EuiSpacer size="m" />
<PlatformSelector
fullCopyButton={fullCopyButton}
onCopy={onCopy}
Expand All @@ -80,17 +59,3 @@ export const InstallSection: React.FunctionComponent<Props> = ({
</>
);
};

const addElasticAgentCompleteLabel = i18n.translate(
'xpack.fleet.enrollmentInstructions.completeAgent.label',
{
defaultMessage: 'Use the elastic-agent-complete docker image',
}
);

const addElasticAgentCompleteTooltipContent = i18n.translate(
'xpack.fleet.enrollmentInstructions.completeAgent.tooltip',
{
defaultMessage: 'Required to run Synthetics browser tests',
}
);
Loading
Loading