Skip to content

Commit 7781c54

Browse files
committed
[ML] Disable Overview view links for analytics jobs with no results
1 parent 0f42b1a commit 7781c54

File tree

1 file changed

+9
-3
lines changed
  • x-pack/plugins/ml/public/application/overview/components/analytics_panel

1 file changed

+9
-3
lines changed

x-pack/plugins/ml/public/application/overview/components/analytics_panel/actions.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
getResultsUrl,
1515
DataFrameAnalyticsListRow,
1616
} from '../../../data_frame_analytics/pages/analytics_management/components/analytics_list/common';
17+
import { getViewLinkStatus } from '../../../data_frame_analytics/pages/analytics_management/components/action_view/get_view_link_status';
1718

1819
interface Props {
1920
item: DataFrameAnalyticsListRow;
@@ -27,23 +28,28 @@ export const ViewLink: FC<Props> = ({ item }) => {
2728
navigateToPath(getResultsUrl(item.id, analysisType));
2829
}, []);
2930

30-
const openJobsInAnomalyExplorerText = i18n.translate(
31+
const { disabled, tooltipContent } = getViewLinkStatus(item);
32+
33+
const viewJobResultsButtonText = i18n.translate(
3134
'xpack.ml.overview.analytics.resultActions.openJobText',
3235
{
3336
defaultMessage: 'View job results',
3437
}
3538
);
3639

40+
const tooltipText = disabled === false ? viewJobResultsButtonText : tooltipContent;
41+
3742
return (
38-
<EuiToolTip position="bottom" content={openJobsInAnomalyExplorerText}>
43+
<EuiToolTip position="bottom" content={tooltipText}>
3944
<EuiButtonEmpty
4045
color="text"
4146
size="xs"
4247
onClick={clickHandler}
4348
iconType="visTable"
44-
aria-label={openJobsInAnomalyExplorerText}
49+
aria-label={viewJobResultsButtonText}
4550
className="results-button"
4651
data-test-subj="mlAnalyticsJobViewButton"
52+
isDisabled={disabled}
4753
>
4854
{i18n.translate('xpack.ml.overview.analytics.viewActionName', {
4955
defaultMessage: 'View',

0 commit comments

Comments
 (0)