bring back KQL autocomplete in timeline + fix last updated (#105380)

This commit is contained in:
Xavier Mouligneau 2021-07-13 09:34:44 -04:00 committed by GitHub
parent 32e6b1edb6
commit 1c5d548893
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 3 deletions

View file

@ -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> = ({

View file

@ -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', () => {

View file

@ -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;
}
);