Skip to content

Commit

Permalink
[ML] Fix callout for regression/classification.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Oct 20, 2020
1 parent dea4599 commit dbbc3d0
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import React, { FC, useEffect, useState } from 'react';

import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui';
import { EuiCallOut, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiSpacer, EuiText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';

import { useUrlState } from '../../../../../util/url_state';
Expand Down Expand Up @@ -70,6 +70,7 @@ export const ExplorationPageWrapper: FC<Props> = ({
}) => {
const {
indexPattern,
indexPatternErrorMessage,
isInitialized,
isLoadingJobConfig,
jobCapsServiceErrorMessage,
Expand Down Expand Up @@ -99,6 +100,22 @@ export const ExplorationPageWrapper: FC<Props> = ({
}
}, [jobConfig?.dest.results_field]);

if (indexPatternErrorMessage !== undefined) {
return (
<EuiPanel grow={false}>
<EuiCallOut
title={i18n.translate('xpack.ml.dataframe.analytics.exploration.indexError', {
defaultMessage: 'An error occurred loading the index data.',
})}
color="danger"
iconType="cross"
>
<p>{indexPatternErrorMessage}</p>
</EuiCallOut>
</EuiPanel>
);
}

if (jobConfigErrorMessage !== undefined || jobCapsServiceErrorMessage !== undefined) {
return (
<JobConfigErrorCallout
Expand Down

0 comments on commit dbbc3d0

Please sign in to comment.