mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Fleet] Small clean up on add agent instructions (#130193)
* Set selection type to undefined in the beginning * Hide copy when doing radio selection * Adjust policy selection spacing, hide API key selection when no policy is chosen
This commit is contained in:
parent
4aedd6cd20
commit
fae0afbd12
4 changed files with 18 additions and 12 deletions
|
@ -119,6 +119,7 @@ export const AgentPolicySelection: React.FC<Props> = (props) => {
|
|||
/>
|
||||
)}
|
||||
</EuiText>
|
||||
<EuiSpacer size="m" />
|
||||
<AgentPolicyFormRow
|
||||
fullWidth={true}
|
||||
label={
|
||||
|
@ -165,14 +166,14 @@ export const AgentPolicySelection: React.FC<Props> = (props) => {
|
|||
/>
|
||||
</>
|
||||
)}
|
||||
{props.withKeySelection && props.onKeyChange && (
|
||||
{props.withKeySelection && props.onKeyChange && selectedPolicy?.id && (
|
||||
<>
|
||||
<EuiSpacer />
|
||||
<EuiSpacer size="m" />
|
||||
<AdvancedAgentAuthenticationSettings
|
||||
selectedApiKeyId={props.selectedApiKeyId}
|
||||
onKeyChange={props.onKeyChange}
|
||||
initialAuthenticationSettingsOpen={!props.selectedApiKeyId}
|
||||
agentPolicyId={selectedPolicy?.id}
|
||||
agentPolicyId={selectedPolicy.id}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
|
|
@ -59,7 +59,7 @@ export const AgentEnrollmentFlyout: React.FunctionComponent<FlyOutProps> = ({
|
|||
const [isFleetServerPolicySelected, setIsFleetServerPolicySelected] = useState<boolean>(false);
|
||||
const [selectedApiKeyId, setSelectedAPIKeyId] = useState<string | undefined>();
|
||||
const [mode, setMode] = useState<FlyoutMode>(defaultMode);
|
||||
const [selectionType, setSelectionType] = useState<SelectionType>('tabs');
|
||||
const [selectionType, setSelectionType] = useState<SelectionType>();
|
||||
|
||||
const {
|
||||
agentPolicies,
|
||||
|
|
|
@ -32,6 +32,7 @@ export const Instructions = (props: InstructionProps) => {
|
|||
isFleetServerPolicySelected,
|
||||
settings,
|
||||
isLoadingAgentPolicies,
|
||||
selectionType,
|
||||
setSelectionType,
|
||||
mode,
|
||||
isIntegrationFlow,
|
||||
|
@ -89,13 +90,17 @@ export const Instructions = (props: InstructionProps) => {
|
|||
} else if (showAgentEnrollment) {
|
||||
return (
|
||||
<>
|
||||
<EuiText>
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentEnrollment.managedDescription"
|
||||
defaultMessage="Enroll an Elastic Agent in Fleet to automatically deploy updates and centrally manage the agent."
|
||||
/>
|
||||
</EuiText>
|
||||
<EuiSpacer size="l" />
|
||||
{selectionType === 'tabs' && (
|
||||
<>
|
||||
<EuiText>
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentEnrollment.managedDescription"
|
||||
defaultMessage="Enroll an Elastic Agent in Fleet to automatically deploy updates and centrally manage the agent."
|
||||
/>
|
||||
</EuiText>
|
||||
<EuiSpacer size="l" />
|
||||
</>
|
||||
)}
|
||||
{isFleetServerPolicySelected ? (
|
||||
<FleetServerSteps {...props} />
|
||||
) : (
|
||||
|
|
|
@ -11,7 +11,7 @@ import type { InstalledIntegrationPolicy } from './use_get_agent_incoming_data';
|
|||
|
||||
export type K8sMode = 'IS_LOADING' | 'IS_KUBERNETES' | 'IS_NOT_KUBERNETES';
|
||||
export type FlyoutMode = 'managed' | 'standalone';
|
||||
export type SelectionType = 'tabs' | 'radio';
|
||||
export type SelectionType = 'tabs' | 'radio' | undefined;
|
||||
|
||||
export interface BaseProps {
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue