Skip to content

Commit

Permalink
Move this up a level so unit tests can pass
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline committed Nov 26, 2019
1 parent 095bb81 commit 6dc6eb5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ import {
import { i18n } from '@kbn/i18n';
import { Alert } from '../../../../alerting/server/types';
import { getSetupModeState, addSetupModeCallback, toggleSetupMode } from '../../lib/setup_mode';
import {
NUMBER_OF_MIGRATED_ALERTS,
KIBANA_ALERTING_ENABLED,
ALERT_TYPE_PREFIX,
} from '../../../common/constants';
import { NUMBER_OF_MIGRATED_ALERTS, ALERT_TYPE_PREFIX } from '../../../common/constants';
import { AlertsConfiguration } from './configuration';

export interface AlertsStatusProps {
Expand Down Expand Up @@ -143,10 +139,6 @@ export const AlertsStatus: React.FC<AlertsStatusProps> = (props: AlertsStatusPro
}
}

if (!KIBANA_ALERTING_ENABLED) {
return null;
}

const content = renderContent();
if (content) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,46 +13,55 @@ import { BeatsPanel } from './beats_panel';
import { AlertsStatus } from '../../alerts/status';
import { EuiPage, EuiPageBody } from '@elastic/eui';
import { ApmPanel } from './apm_panel';
import { STANDALONE_CLUSTER_CLUSTER_UUID } from '../../../../common/constants';
import {
STANDALONE_CLUSTER_CLUSTER_UUID,
KIBANA_ALERTING_ENABLED,
} from '../../../../common/constants';

export function Overview(props) {
const isFromStandaloneCluster = props.cluster.cluster_uuid === STANDALONE_CLUSTER_CLUSTER_UUID;

const kibanaAlerts = KIBANA_ALERTING_ENABLED ? (
<AlertsStatus clusterUuid={props.cluster.cluster_uuid} emailAddress={props.emailAddress} />
) : null;

return (
<EuiPage>
<EuiPageBody>
<AlertsStatus
clusterUuid={props.cluster.cluster_uuid}
emailAddress={props.emailAddress}
/>
{kibanaAlerts}

<AlertsPanel alerts={props.cluster.alerts} changeUrl={props.changeUrl} />

{ !isFromStandaloneCluster ?
(
<Fragment>
<ElasticsearchPanel
{...props.cluster.elasticsearch}
version={props.cluster.version}
ml={props.cluster.ml}
changeUrl={props.changeUrl}
license={props.cluster.license}
setupMode={props.setupMode}
showLicenseExpiration={props.showLicenseExpiration}
/>
<KibanaPanel
{...props.cluster.kibana}
setupMode={props.setupMode}
changeUrl={props.changeUrl}
/>
</Fragment>
)
: null
}

<LogstashPanel {...props.cluster.logstash} setupMode={props.setupMode} changeUrl={props.changeUrl} />

<BeatsPanel {...props.cluster.beats} setupMode={props.setupMode} changeUrl={props.changeUrl} />
{!isFromStandaloneCluster ? (
<Fragment>
<ElasticsearchPanel
{...props.cluster.elasticsearch}
version={props.cluster.version}
ml={props.cluster.ml}
changeUrl={props.changeUrl}
license={props.cluster.license}
setupMode={props.setupMode}
showLicenseExpiration={props.showLicenseExpiration}
/>
<KibanaPanel
{...props.cluster.kibana}
setupMode={props.setupMode}
changeUrl={props.changeUrl}
/>
</Fragment>
) : null}

<LogstashPanel
{...props.cluster.logstash}
setupMode={props.setupMode}
changeUrl={props.changeUrl}
/>

<BeatsPanel
{...props.cluster.beats}
setupMode={props.setupMode}
changeUrl={props.changeUrl}
/>

<ApmPanel {...props.cluster.apm} setupMode={props.setupMode} changeUrl={props.changeUrl} />
</EuiPageBody>
Expand Down

0 comments on commit 6dc6eb5

Please sign in to comment.