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:
Brandon Kobel 2019-04-15 10:28:56 -07:00 committed by GitHub
parent 1bfcf502a7
commit f2388dbe6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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[] = [
{