mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
bring back KQL autocomplete in timeline + fix last updated (#105380)
This commit is contained in:
parent
32e6b1edb6
commit
1c5d548893
3 changed files with 47 additions and 3 deletions
|
@ -26,7 +26,7 @@ interface FlyoutPaneComponentProps {
|
|||
const StyledEuiFlyout = styled(EuiFlyout)<EuiFlyoutProps>`
|
||||
animation: none;
|
||||
min-width: 150px;
|
||||
z-index: ${({ theme }) => theme.eui.euiZLevel6};
|
||||
z-index: ${({ theme }) => theme.eui.euiZLevel4};
|
||||
`;
|
||||
|
||||
const FlyoutPaneComponent: React.FC<FlyoutPaneComponentProps> = ({
|
||||
|
|
|
@ -161,6 +161,50 @@ describe('Footer Timeline Component', () => {
|
|||
wrapper.find('[data-test-subj="timelineSizeRowPopover"] button').first().simulate('click');
|
||||
expect(wrapper.find('[data-test-subj="timelinePickSizeRow"]').exists()).toBeTruthy();
|
||||
});
|
||||
|
||||
test('it renders last updated when updated at is > 0', () => {
|
||||
const wrapper = mount(
|
||||
<TestProviders>
|
||||
<FooterComponent
|
||||
activePage={0}
|
||||
updatedAt={updatedAt}
|
||||
height={100}
|
||||
id={'timeline-id'}
|
||||
isLive={false}
|
||||
isLoading={false}
|
||||
itemsCount={itemsCount}
|
||||
itemsPerPage={2}
|
||||
itemsPerPageOptions={[1, 5, 10, 20]}
|
||||
onChangePage={loadMore}
|
||||
totalCount={serverSideEventCount}
|
||||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(wrapper.find('[data-test-subj="fixed-width-last-updated"]').exists()).toBeTruthy();
|
||||
});
|
||||
|
||||
test('it does NOT render last updated when updated at is 0', () => {
|
||||
const wrapper = mount(
|
||||
<TestProviders>
|
||||
<FooterComponent
|
||||
activePage={0}
|
||||
updatedAt={0}
|
||||
height={100}
|
||||
id={'timeline-id'}
|
||||
isLive={false}
|
||||
isLoading={false}
|
||||
itemsCount={itemsCount}
|
||||
itemsPerPage={2}
|
||||
itemsPerPageOptions={[1, 5, 10, 20]}
|
||||
onChangePage={loadMore}
|
||||
totalCount={serverSideEventCount}
|
||||
/>
|
||||
</TestProviders>
|
||||
);
|
||||
|
||||
expect(wrapper.find('[data-test-subj="fixed-width-last-updated"]').exists()).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Events', () => {
|
||||
|
|
|
@ -45,11 +45,11 @@ const FixedWidthLastUpdatedContainer = React.memo<FixedWidthLastUpdatedContainer
|
|||
const width = useEventDetailsWidthContext();
|
||||
const compact = useMemo(() => isCompactFooter(width), [width]);
|
||||
|
||||
return (
|
||||
return updatedAt > 0 ? (
|
||||
<FixedWidthLastUpdated data-test-subj="fixed-width-last-updated" compact={compact}>
|
||||
{timelines.getLastUpdated({ updatedAt, compact })}
|
||||
</FixedWidthLastUpdated>
|
||||
);
|
||||
) : null;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue