Renable logs disabled callout for managed policies (#131204) (#131211)

(cherry picked from commit 5c485d405d)

Co-authored-by: Jen Huang <jen.huang@elastic.co>
This commit is contained in:
Kibana Machine 2022-04-29 02:49:13 -05:00 committed by GitHub
parent be8602e755
commit f24af7c4e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -83,25 +83,27 @@ const AgentPolicyLogsNotEnabledCallout: React.FunctionComponent<{ agentPolicy: A
/>
}
>
<FormattedMessage
id="xpack.fleet.agentLogs.logDisabledCallOutDescription"
defaultMessage="Update the agent's policy {settingsLink} to enable logs collection."
values={{
settingsLink: (
<EuiLink
href={getHref('policy_details', {
policyId: agentPolicy.id,
tabId: 'settings',
})}
>
<FormattedMessage
id="xpack.fleet.agentLogs.settingsLink"
defaultMessage="settings"
/>
</EuiLink>
),
}}
/>
{agentPolicy.is_managed ? null : (
<FormattedMessage
id="xpack.fleet.agentLogs.logDisabledCallOutDescription"
defaultMessage="Update the agent's policy {settingsLink} to enable logs collection."
values={{
settingsLink: (
<EuiLink
href={getHref('policy_details', {
policyId: agentPolicy.id,
tabId: 'settings',
})}
>
<FormattedMessage
id="xpack.fleet.agentLogs.settingsLink"
defaultMessage="settings"
/>
</EuiLink>
),
}}
/>
)}
</EuiCallOut>
</EuiFlexItem>
);
@ -277,9 +279,9 @@ export const AgentLogsUI: React.FunctionComponent<AgentLogsProps> = memo(
return (
<WrapperFlexGroup direction="column" gutterSize="m">
{agentPolicy &&
!agentPolicy.monitoring_enabled?.includes('logs') &&
!agentPolicy.is_managed && <AgentPolicyLogsNotEnabledCallout agentPolicy={agentPolicy} />}
{agentPolicy && !agentPolicy.monitoring_enabled?.includes('logs') && (
<AgentPolicyLogsNotEnabledCallout agentPolicy={agentPolicy} />
)}
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="m">
<EuiFlexItem>