mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[RAM] Use alert name in flyout header (#133038)
* Use alert name * Fix unit tests
This commit is contained in:
parent
bff21e760c
commit
1bc354e28f
2 changed files with 5 additions and 11 deletions
|
@ -121,7 +121,7 @@ describe('AlertsFlyout', () => {
|
|||
await nextTick();
|
||||
wrapper.update();
|
||||
});
|
||||
expect(wrapper.find('h2').first().text()).toBe('Sample title');
|
||||
expect(wrapper.find('h2').first().text()).toBe('one');
|
||||
expect(wrapper.find('h5').first().text()).toBe('Body');
|
||||
});
|
||||
|
||||
|
@ -142,7 +142,7 @@ describe('AlertsFlyout', () => {
|
|||
await nextTick();
|
||||
wrapper.update();
|
||||
});
|
||||
expect(wrapper.find('h2').first().text()).toBe('Sample title');
|
||||
expect(wrapper.find('h2').first().text()).toBe('one');
|
||||
expect(wrapper.find('h5').first().text()).toBe('Body');
|
||||
expect(wrapper.find('h6').first().text()).toBe('Footer');
|
||||
});
|
||||
|
|
|
@ -5,22 +5,16 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import React from 'react';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { get } from 'lodash';
|
||||
import { ALERT_RULE_NAME } from '@kbn/rule-data-utils';
|
||||
import { EuiTitle } from '@elastic/eui';
|
||||
import { AlertsTableFlyoutBaseProps } from '../../../../types';
|
||||
|
||||
const SAMPLE_TITLE_LABEL = i18n.translate(
|
||||
'xpack.triggersActionsUI.sections.alertsTable.alertsFlyout.sampleTitle',
|
||||
{
|
||||
defaultMessage: 'Sample title',
|
||||
}
|
||||
);
|
||||
|
||||
type Props = AlertsTableFlyoutBaseProps;
|
||||
const AlertsFlyoutHeader = ({ alert }: Props) => {
|
||||
return (
|
||||
<EuiTitle size="m">
|
||||
<h2>{SAMPLE_TITLE_LABEL}</h2>
|
||||
<h2>{get(alert, ALERT_RULE_NAME)}</h2>
|
||||
</EuiTitle>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue