mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
81f1bdf7fc
commit
e3644b2263
1 changed files with 15 additions and 2 deletions
|
@ -4,13 +4,14 @@
|
|||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
|
||||
import React, { FC } from 'react';
|
||||
import React, { FC, useMemo } from 'react';
|
||||
|
||||
import { EuiCallOut, EuiLink, EuiPanel, EuiSpacer } from '@elastic/eui';
|
||||
|
||||
import { i18n } from '@kbn/i18n';
|
||||
|
||||
import { ExplorationTitle } from '../exploration_title';
|
||||
import { useMlKibana } from '../../../../../contexts/kibana';
|
||||
|
||||
const jobConfigErrorTitle = i18n.translate('xpack.ml.dataframe.analytics.jobConfig.errorTitle', {
|
||||
defaultMessage: 'Unable to fetch results. An error occurred loading the job configuration data.',
|
||||
|
@ -31,6 +32,11 @@ export const JobConfigErrorCallout: FC<Props> = ({
|
|||
jobConfigErrorMessage,
|
||||
title,
|
||||
}) => {
|
||||
const {
|
||||
services: {
|
||||
application: { getUrlForApp },
|
||||
},
|
||||
} = useMlKibana();
|
||||
const containsIndexPatternLink =
|
||||
typeof jobCapsServiceErrorMessage === 'string' &&
|
||||
jobCapsServiceErrorMessage.includes('locate that index-pattern') &&
|
||||
|
@ -39,9 +45,16 @@ export const JobConfigErrorCallout: FC<Props> = ({
|
|||
const message = (
|
||||
<p>{jobConfigErrorMessage ? jobConfigErrorMessage : jobCapsServiceErrorMessage}</p>
|
||||
);
|
||||
const newIndexPatternUrl = useMemo(
|
||||
() =>
|
||||
getUrlForApp('management', {
|
||||
path: 'kibana/indexPatterns',
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
const calloutBody = containsIndexPatternLink ? (
|
||||
<EuiLink href="management/kibana/indexPatterns" target="_blank">
|
||||
<EuiLink href={newIndexPatternUrl} target="_blank">
|
||||
{message}
|
||||
</EuiLink>
|
||||
) : (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue