bugfix: default to null when agentPolicy not loaded (#106092)
This commit is contained in:
parent
f9089e11df
commit
4e7f9460e5
|
@ -133,33 +133,37 @@ export const AgentDetailsOverviewSection: React.FunctionComponent<{
|
|||
title: i18n.translate('xpack.fleet.agentDetails.monitorLogsLabel', {
|
||||
defaultMessage: 'Monitor logs',
|
||||
}),
|
||||
description: agentPolicy?.monitoring_enabled?.includes('logs') ? (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorLogsEnabledText"
|
||||
defaultMessage="True"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorLogsDisabledText"
|
||||
defaultMessage="False"
|
||||
/>
|
||||
),
|
||||
description: Array.isArray(agentPolicy?.monitoring_enabled) ? (
|
||||
agentPolicy?.monitoring_enabled?.includes('logs') ? (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorLogsEnabledText"
|
||||
defaultMessage="True"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorLogsDisabledText"
|
||||
defaultMessage="False"
|
||||
/>
|
||||
)
|
||||
) : null,
|
||||
},
|
||||
{
|
||||
title: i18n.translate('xpack.fleet.agentDetails.monitorMetricsLabel', {
|
||||
defaultMessage: 'Monitor metrics',
|
||||
}),
|
||||
description: agentPolicy?.monitoring_enabled?.includes('metrics') ? (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorMetricsEnabledText"
|
||||
defaultMessage="True"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorMetricsDisabledText"
|
||||
defaultMessage="False"
|
||||
/>
|
||||
),
|
||||
description: Array.isArray(agentPolicy?.monitoring_enabled) ? (
|
||||
agentPolicy?.monitoring_enabled?.includes('metrics') ? (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorMetricsEnabledText"
|
||||
defaultMessage="True"
|
||||
/>
|
||||
) : (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.agentList.monitorMetricsDisabledText"
|
||||
defaultMessage="False"
|
||||
/>
|
||||
)
|
||||
) : null,
|
||||
},
|
||||
].map(({ title, description }) => {
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue