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

[7.x] bring back KQL autocomplete in timeline + fix last updated (#105380) #105438

Merged
merged 1 commit into from
Jul 13, 2021
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 @@ -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