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

[Alerting] removes unimplemented buttons from Alert Details page #60934

Merged
merged 4 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
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 @@ -8,16 +8,8 @@ import uuid from 'uuid';
import { shallow } from 'enzyme';
import { AlertDetails } from './alert_details';
import { Alert, ActionType } from '../../../../types';
import {
EuiTitle,
EuiBadge,
EuiFlexItem,
EuiButtonEmpty,
EuiSwitch,
EuiBetaBadge,
} from '@elastic/eui';
import { EuiTitle, EuiBadge, EuiFlexItem, EuiSwitch, EuiBetaBadge } from '@elastic/eui';
import { times, random } from 'lodash';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@kbn/i18n';
import { ViewInApp } from './view_in_app';

Expand Down Expand Up @@ -218,31 +210,6 @@ describe('alert_details', () => {
});

describe('links', () => {
it('links to the Edit flyout', () => {
const alert = mockAlert();

const alertType = {
id: '.noop',
name: 'No Op',
actionGroups: [{ id: 'default', name: 'Default' }],
actionVariables: { context: [], state: [] },
defaultActionGroupId: 'default',
};

expect(
shallow(
<AlertDetails alert={alert} alertType={alertType} actionTypes={[]} {...mockAlertApis} />
).containsMatchingElement(
<EuiButtonEmpty disabled={true} iconType="pencil">
<FormattedMessage
id="xpack.triggersActionsUI.sections.alertDetails.editAlertButtonLabel"
defaultMessage="Edit"
/>
</EuiButtonEmpty>
)
).toBeTruthy();
});

it('links to the app that created the alert', () => {
const alert = mockAlert();

Expand All @@ -260,31 +227,6 @@ describe('alert_details', () => {
).containsMatchingElement(<ViewInApp alert={alert} />)
).toBeTruthy();
});

it('links to the activity log', () => {
const alert = mockAlert();

const alertType = {
id: '.noop',
name: 'No Op',
actionGroups: [{ id: 'default', name: 'Default' }],
actionVariables: { context: [], state: [] },
defaultActionGroupId: 'default',
};

expect(
shallow(
<AlertDetails alert={alert} alertType={alertType} actionTypes={[]} {...mockAlertApis} />
).containsMatchingElement(
<EuiButtonEmpty disabled={true} iconType="menuLeft">
<FormattedMessage
id="xpack.triggersActionsUI.sections.alertDetails.activityLogButtonLabel"
defaultMessage="Activity Log"
/>
</EuiButtonEmpty>
)
).toBeTruthy();
});
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
EuiBadge,
EuiPage,
EuiPageContentBody,
EuiButtonEmpty,
EuiSwitch,
EuiCallOut,
EuiSpacer,
Expand Down Expand Up @@ -87,25 +86,9 @@ export const AlertDetails: React.FunctionComponent<AlertDetailsProps> = ({
</EuiPageContentHeaderSection>
<EuiPageContentHeaderSection>
<EuiFlexGroup responsive={false} gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiButtonEmpty disabled={true} iconType="pencil">
<FormattedMessage
id="xpack.triggersActionsUI.sections.alertDetails.editAlertButtonLabel"
defaultMessage="Edit"
/>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<ViewInApp alert={alert} />
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty disabled={true} iconType="menuLeft">
<FormattedMessage
id="xpack.triggersActionsUI.sections.alertDetails.activityLogButtonLabel"
defaultMessage="Activity Log"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentHeaderSection>
</EuiPageContentHeader>
Expand Down