Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ResponseOps][Alerting] Update Elasticsearch Query rule to display ES|QL as "Technical Preview" #166491

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import React, { useMemo } from 'react';
import {
EuiBetaBadge,
EuiButtonIcon,
EuiFlexGroup,
EuiFlexItem,
Expand All @@ -21,6 +22,24 @@ import { i18n } from '@kbn/i18n';
import { SearchType } from '../types';
import { useTriggerUiActionServices } from '../util';

export const ExperimentalBadge = React.memo(() => (
<EuiBetaBadge
size="s"
label={i18n.translate('xpack.stackAlerts.esQuery.ui.selectQueryFormType.experimentalLabel', {
defaultMessage: 'Technical preview',
})}
tooltipContent={i18n.translate(
'xpack.stackAlerts.esQuery.ui.selectQueryFormType.experimentalDescription',
{
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="bottom"
/>
));
ExperimentalBadge.displayName = 'ExperimentalBadge';

export interface QueryFormTypeProps {
searchType: SearchType | null;
onFormTypeSelect: (formType: SearchType | null) => void;
Expand Down Expand Up @@ -94,9 +113,18 @@ export const QueryFormTypeChooser: React.FC<QueryFormTypeProps> = ({
<>
<EuiFlexGroup alignItems="center" gutterSize="s" responsive={false}>
<EuiFlexItem>
<EuiTitle size="xs" data-test-subj="selectedRuleFormTypeTitle">
<h5>{activeFormTypeItem?.label}</h5>
</EuiTitle>
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiTitle size="xs" data-test-subj="selectedRuleFormTypeTitle">
<h5>{activeFormTypeItem?.label}</h5>
</EuiTitle>
</EuiFlexItem>
{activeFormTypeItem?.formType === SearchType.esqlQuery && (
<EuiFlexItem>
<ExperimentalBadge />
</EuiFlexItem>
)}
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonIcon
Expand Down Expand Up @@ -140,7 +168,16 @@ export const QueryFormTypeChooser: React.FC<QueryFormTypeProps> = ({
color="primary"
label={
<span>
<strong>{item.label}</strong>
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
<strong>{item.label}</strong>
</EuiFlexItem>
{item.formType === SearchType.esqlQuery && (
<EuiFlexItem>
<ExperimentalBadge />
</EuiFlexItem>
)}
</EuiFlexGroup>
<EuiText color="subdued" size="s">
<p>{item.description}</p>
</EuiText>
Expand Down
Loading