When APM is disabled, don't throw an error in Infrastructure (#35030)
* When APM is disabled, we were throwing an error in infra uiCapabilities.apm is undefined in these situations, so we can't check uiCapabilities.apm.save * Fixing tslint issues
This commit is contained in:
parent
1bfcf502a7
commit
f2388dbe6d
|
@ -65,19 +65,22 @@ export const NodeContextMenu = injectUICapabilities(
|
|||
})
|
||||
: undefined;
|
||||
|
||||
const apmTracesUrl = uiCapabilities.apm.show
|
||||
? {
|
||||
name: intl.formatMessage(
|
||||
{
|
||||
id: 'xpack.infra.nodeContextMenu.viewAPMTraces',
|
||||
defaultMessage: 'View {nodeType} APM traces',
|
||||
},
|
||||
{ nodeType }
|
||||
),
|
||||
href: `../app/apm#/traces?_g=()&kuery=${APM_FIELDS[nodeType]}~20~3A~20~22${node.id}~22`,
|
||||
'data-test-subj': 'viewApmTracesContextMenuItem',
|
||||
}
|
||||
: undefined;
|
||||
const apmTracesUrl =
|
||||
uiCapabilities.apm && uiCapabilities.apm.show
|
||||
? {
|
||||
name: intl.formatMessage(
|
||||
{
|
||||
id: 'xpack.infra.nodeContextMenu.viewAPMTraces',
|
||||
defaultMessage: 'View {nodeType} APM traces',
|
||||
},
|
||||
{ nodeType }
|
||||
),
|
||||
href: `../app/apm#/traces?_g=()&kuery=${APM_FIELDS[nodeType]}~20~3A~20~22${
|
||||
node.id
|
||||
}~22`,
|
||||
'data-test-subj': 'viewApmTracesContextMenuItem',
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const panels: EuiContextMenuPanelDescriptor[] = [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue