Skip to content

Commit

Permalink
bring back KQL autocomplete in timeline + fix last updated (#105380)
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierM authored Jul 13, 2021
1 parent 32e6b1e commit 1c5d548
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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> = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
);

Expand Down

0 comments on commit 1c5d548

Please sign in to comment.