Skip to content

Commit

Permalink
Add beta badge to alert and actions UI components (#58691)
Browse files Browse the repository at this point in the history
* Added Beta badge to Alerts and Actions UI components

* Fixed failing test

* Fixed FT

* Fixed labels
  • Loading branch information
YulNaumenko authored Feb 27, 2020
1 parent f62bda0 commit a896515
Show file tree
Hide file tree
Showing 8 changed files with 110 additions and 5 deletions.
13 changes: 13 additions & 0 deletions x-pack/plugins/triggers_actions_ui/public/application/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ import {
EuiTab,
EuiTabs,
EuiTitle,
EuiBetaBadge,
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
import { BASE_PATH, Section, routeToConnectors, routeToAlerts } from './constants';
import { getCurrentBreadcrumb } from './lib/breadcrumb';
import { getCurrentDocTitle } from './lib/doc_title';
Expand Down Expand Up @@ -91,6 +93,17 @@ export const TriggersActionsUIHome: React.FunctionComponent<RouteComponentProps<
id="xpack.triggersActionsUI.home.appTitle"
defaultMessage="Alerts and Actions"
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.home.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h1>
</EuiTitle>
</EuiPageContentHeaderSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
EuiButtonEmpty,
EuiButton,
EuiFlyoutBody,
EuiBetaBadge,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useActionsConnectorsContext } from '../../context/actions_connectors_context';
Expand Down Expand Up @@ -146,6 +147,17 @@ export const ConnectorAddFlyout = () => {
actionTypeName: actionType.name,
}}
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.addConnectorForm.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h3>
</EuiTitle>
<EuiText size="s" color="subdued">
Expand All @@ -159,6 +171,17 @@ export const ConnectorAddFlyout = () => {
defaultMessage="Select a connector"
id="xpack.triggersActionsUI.sections.addConnectorForm.selectConnectorFlyoutTitle"
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.addFlyout.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h3>
</EuiTitle>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/
import React, { useCallback, useReducer, useState } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiTitle, EuiFlexItem, EuiIcon, EuiFlexGroup } from '@elastic/eui';
import { EuiTitle, EuiFlexItem, EuiIcon, EuiFlexGroup, EuiBetaBadge } from '@elastic/eui';
import {
EuiModal,
EuiButton,
Expand Down Expand Up @@ -129,6 +129,17 @@ export const ConnectorAddModal = ({
actionTypeName: actionType.name,
}}
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.addModalConnectorForm.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h3>
</EuiTitle>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
EuiFlyoutFooter,
EuiButtonEmpty,
EuiButton,
EuiBetaBadge,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useActionsConnectorsContext } from '../../context/actions_connectors_context';
Expand Down Expand Up @@ -96,6 +97,17 @@ export const ConnectorEditFlyout = ({ initialConnector }: ConnectorEditProps) =>
defaultMessage="Edit connector"
id="xpack.triggersActionsUI.sections.editConnectorForm.flyoutTitle"
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.editConnectorForm.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h3>
</EuiTitle>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
EuiButton,
EuiFlyoutBody,
EuiPortal,
EuiBetaBadge,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useAlertsContext } from '../../context/alerts_context';
Expand Down Expand Up @@ -136,6 +137,16 @@ export const AlertAdd = ({ consumer, canChangeTrigger, alertTypeId }: AlertAddPr
defaultMessage="Create Alert"
id="xpack.triggersActionsUI.sections.alertAdd.flyoutTitle"
/>
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.alertAdd.betaBadgeTooltipContent',
{
defaultMessage: 'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h3>
</EuiTitle>
</EuiFlyoutHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ import uuid from 'uuid';
import { shallow } from 'enzyme';
import { AlertDetails } from './alert_details';
import { Alert, ActionType } from '../../../../types';
import { EuiTitle, EuiBadge, EuiFlexItem, EuiButtonEmpty, EuiSwitch } from '@elastic/eui';
import {
EuiTitle,
EuiBadge,
EuiFlexItem,
EuiButtonEmpty,
EuiSwitch,
EuiBetaBadge,
} from '@elastic/eui';
import { times, random } from 'lodash';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';

jest.mock('../../../app_context', () => ({
useAppDependencies: jest.fn(() => ({
Expand Down Expand Up @@ -54,7 +62,19 @@ describe('alert_details', () => {
<AlertDetails alert={alert} alertType={alertType} actionTypes={[]} {...mockAlertApis} />
).containsMatchingElement(
<EuiTitle size="m">
<h1>{alert.name}</h1>
<h1>
{alert.name}
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.alertDetails.betaBadgeTooltipContent',
{
defaultMessage: 'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h1>
</EuiTitle>
)
).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import {
EuiSwitch,
EuiCallOut,
EuiSpacer,
EuiBetaBadge,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { useAppDependencies } from '../../../app_context';
import { hasSaveAlertsCapability } from '../../../lib/capabilities';
import { Alert, AlertType, ActionType } from '../../../../types';
Expand Down Expand Up @@ -66,7 +68,20 @@ export const AlertDetails: React.FunctionComponent<AlertDetailsProps> = ({
<EuiPageContentHeader>
<EuiPageContentHeaderSection>
<EuiTitle size="m">
<h1 data-test-subj="alertDetailsTitle">{alert.name}</h1>
<h1 data-test-subj="alertDetailsTitle">
{alert.name}
&emsp;
<EuiBetaBadge
label="Beta"
tooltipContent={i18n.translate(
'xpack.triggersActionsUI.sections.alertDetails.betaBadgeTooltipContent',
{
defaultMessage:
'This module is not GA. Please help us by reporting any bugs.',
}
)}
/>
</h1>
</EuiTitle>
</EuiPageContentHeaderSection>
<EuiPageContentHeaderSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
await log.debug('Checking for section heading to say Triggers and Actions.');

const headingText = await pageObjects.triggersActionsUI.getSectionHeadingText();
expect(headingText).to.be('Alerts and Actions');
expect(headingText).to.be('Alerts and Actions BETA');
});

describe('Connectors tab', () => {
Expand Down

0 comments on commit a896515

Please sign in to comment.