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