Skip to content

Commit

Permalink
[ML] Explain Log Rate Spikes: Adds technical preview badge. (#136862)
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra authored Jul 25, 2022
1 parent f055ce2 commit 0c97516
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

import React, { FC } from 'react';

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';

import { FormattedMessage } from '@kbn/i18n-react';
import { ExplainLogRateSpikes } from '@kbn/aiops-plugin/public';

import { useMlContext } from '../contexts/ml';
import { useMlKibana } from '../contexts/kibana';
import { HelpMenu } from '../components/help_menu';
import { TechnicalPreviewBadge } from '../components/technical_preview_badge';

import { MlPageHeader } from '../components/page_header';

Expand All @@ -28,10 +31,17 @@ export const ExplainLogRateSpikesPage: FC = () => {
return (
<>
<MlPageHeader>
<FormattedMessage
id="xpack.ml.explainLogRateSpikes.pageHeader"
defaultMessage="Explain log rate spikes"
/>
<EuiFlexGroup responsive={false} wrap={false} alignItems={'center'} gutterSize={'m'}>
<EuiFlexItem grow={false}>
<FormattedMessage
id="xpack.ml.explainLogRateSpikes.pageHeader"
defaultMessage="Explain log rate spikes"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<TechnicalPreviewBadge />
</EuiFlexItem>
</EuiFlexGroup>
</MlPageHeader>
{dataView.timeFieldName && (
<ExplainLogRateSpikes dataView={dataView} savedSearch={savedSearch} />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

export { TechnicalPreviewBadge } from './technical_preview_badge';
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import React, { FC } from 'react';

import { EuiBetaBadge } from '@elastic/eui';

import { i18n } from '@kbn/i18n';

export const TechnicalPreviewBadge: FC = () => {
return (
<EuiBetaBadge
label={i18n.translate('xpack.ml.navMenu.trainedModelsTabBetaLabel', {
defaultMessage: 'Technical preview',
})}
size="m"
color="hollow"
tooltipContent={i18n.translate('xpack.ml.navMenu.trainedModelsTabBetaTooltipContent', {
defaultMessage:
'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.',
})}
tooltipPosition={'right'}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import React, { FC } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { NavigateToPath } from '../../../contexts/kibana';
import { MlRoute, PageLoader, PageProps } from '../../router';
import { useResolver } from '../../use_resolver';
import { basicResolvers } from '../../resolvers';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { ModelsList } from '../../../trained_models/models_management';
import { MlPageHeader } from '../../../components/page_header';
import { TechnicalPreviewBadge } from '../../../components/technical_preview_badge';

export const modelsListRouteFactory = (
navigateToPath: NavigateToPath,
Expand Down Expand Up @@ -60,21 +61,7 @@ const PageWrapper: FC<PageProps> = ({ location, deps }) => {
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={i18n.translate('xpack.ml.navMenu.trainedModelsTabBetaLabel', {
defaultMessage: 'Technical preview',
})}
size="m"
color="hollow"
tooltipContent={i18n.translate(
'xpack.ml.navMenu.trainedModelsTabBetaTooltipContent',
{
defaultMessage:
'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.',
}
)}
tooltipPosition={'right'}
/>
<TechnicalPreviewBadge />
</EuiFlexItem>
</EuiFlexGroup>
</MlPageHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@
import React, { FC } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { i18n } from '@kbn/i18n';
import { EuiBetaBadge, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { NavigateToPath, useTimefilter } from '../../../contexts/kibana';
import { MlRoute, PageLoader, PageProps } from '../../router';
import { useResolver } from '../../use_resolver';
import { basicResolvers } from '../../resolvers';
import { getBreadcrumbWithUrlForApp } from '../../breadcrumbs';
import { NodesList } from '../../../trained_models/nodes_overview';
import { MlPageHeader } from '../../../components/page_header';
import { TechnicalPreviewBadge } from '../../../components/technical_preview_badge';

export const nodesListRouteFactory = (
navigateToPath: NavigateToPath,
Expand Down Expand Up @@ -58,21 +59,7 @@ const PageWrapper: FC<PageProps> = ({ location, deps }) => {
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBetaBadge
label={i18n.translate('xpack.ml.navMenu.trainedModelsTabBetaLabel', {
defaultMessage: 'Technical preview',
})}
size="m"
color="hollow"
tooltipContent={i18n.translate(
'xpack.ml.navMenu.trainedModelsTabBetaTooltipContent',
{
defaultMessage:
'This functionality is in technical preview and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but features in technical preview are not subject to the support SLA of official GA features.',
}
)}
tooltipPosition={'right'}
/>
<TechnicalPreviewBadge />
</EuiFlexItem>
</EuiFlexGroup>
</MlPageHeader>
Expand Down

0 comments on commit 0c97516

Please sign in to comment.