Skip to content

Commit

Permalink
[Fleet] Fix agent config yaml view to work without fleet (elastic#61194)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Mar 25, 2020
1 parent b8e3ccb commit 49f0372
Showing 1 changed file with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const ConfigYamlView = memo<{ config: AgentConfig }>(({ config }) => {

const fullConfigRequest = useGetOneAgentConfigFull(config.id);
const apiKeysRequest = useGetEnrollmentAPIKeys();
const apiKeyRequest = useGetOneEnrollmentAPIKey(apiKeysRequest.data?.list?.[0].id as string);
const apiKeyRequest = useGetOneEnrollmentAPIKey(apiKeysRequest.data?.list?.[0]?.id as string);

if (fullConfigRequest.isLoading && !fullConfigRequest.data) {
return <Loading />;
Expand All @@ -49,30 +49,30 @@ export const ConfigYamlView = memo<{ config: AgentConfig }>(({ config }) => {
})}
</EuiCodeBlock>
</EuiFlexItem>
<EuiFlexItem grow={3}>
<EuiTitle size="s">
<h3>
{apiKeyRequest.data && (
<EuiFlexItem grow={3}>
<EuiTitle size="s">
<h3>
<FormattedMessage
id="xpack.ingestManager.yamlConfig.instructionTittle"
defaultMessage="Enroll with fleet"
/>
</h3>
</EuiTitle>
<EuiSpacer size="m" />
<EuiText size="s">
<FormattedMessage
id="xpack.ingestManager.yamlConfig.instructionTittle"
defaultMessage="Enroll with fleet"
id="xpack.ingestManager.yamlConfig.instructionDescription"
defaultMessage="To enroll an agent with this configuration, copy and run the following command on your host."
/>
</h3>
</EuiTitle>
<EuiSpacer size="m" />
<EuiText size="s">
<FormattedMessage
id="xpack.ingestManager.yamlConfig.instructionDescription"
defaultMessage="To enroll an agent with this configuration, copy and run the following command on your host."
/>
</EuiText>
<EuiSpacer size="m" />
{apiKeyRequest.data && (
</EuiText>
<EuiSpacer size="m" />
<ShellEnrollmentInstructions
apiKey={apiKeyRequest.data.item}
kibanaUrl={`${window.location.origin}${core.http.basePath.get()}`}
/>
)}
</EuiFlexItem>
</EuiFlexItem>
)}
</EuiFlexGroup>
);
});

0 comments on commit 49f0372

Please sign in to comment.