Skip to content

Commit

Permalink
[Fix] Fix bug with missing license data (#22485) (#22520)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv authored Aug 30, 2018
1 parent aed7302 commit ed314be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { get } from 'lodash';
import { HeaderContainer } from '../../shared/UIComponents';
import TabNavigation from '../../shared/TabNavigation';
import List from './List';
Expand Down Expand Up @@ -35,7 +36,7 @@ class ErrorGroupOverview extends Component {
<div>
<HeaderContainer>
<h1>{serviceName}</h1>
{license.data.features.watcher.isAvailable && (
{get(license.data, 'features.watcher.isAvailable') && (
<WatcherButton onOpenFlyout={this.onOpenFlyout} />
)}
</HeaderContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import styled from 'styled-components';
import chrome from 'ui/chrome';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { get } from 'lodash';
import { HeaderContainer, HeaderMedium } from '../../shared/UIComponents';
import TabNavigation from '../../shared/TabNavigation';
import Charts from '../../shared/charts/TransactionCharts';
Expand Down Expand Up @@ -69,7 +70,7 @@ class TransactionOverview extends Component {
const mlEnabled = chrome.getInjected('mlEnabled');

const ChartHeaderContent =
hasDynamicBaseline && license.data.features.ml.isAvailable ? (
hasDynamicBaseline && get(license.data, 'features.ml.isAvailable') ? (
<MLTipContainer>
<EuiIconTip content="The stream around the average response time shows the expected bounds. An annotation is shown for anomaly scores &gt;= 75." />
<MLText>
Expand All @@ -91,7 +92,7 @@ class TransactionOverview extends Component {
<div>
<HeaderContainer>
<h1>{serviceName}</h1>
{license.data.features.ml.isAvailable &&
{get(license.data, 'features.ml.isAvailable') &&
mlEnabled && (
<DynamicBaselineButton onOpenFlyout={this.onOpenFlyout} />
)}
Expand Down

0 comments on commit ed314be

Please sign in to comment.