Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@8.9.1-canary.1",
"@elastic/ems-client": "8.4.0",
"@elastic/eui": "88.5.0",
"@elastic/eui": "88.5.4",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ describe('FieldComponent', () => {
);
const fieldAutocompleteComboBox = wrapper.getByTestId('comboBoxSearchInput');
fireEvent.change(fieldAutocompleteComboBox, { target: { value: '_source' } });
await waitFor(() =>
expect(wrapper.getByTestId('fieldAutocompleteComboBox')).toHaveTextContent('_source')
);
expect(fieldAutocompleteComboBox).toHaveValue('_source');
});

it('it allows custom user input if "acceptsCustomOptions" is "true"', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import React, { FC, useEffect, useState } from 'react';
import {
EuiCollapsibleNavItem,
EuiCollapsibleNavItemProps,
EuiCollapsibleNavSubItemGroupTitle,
EuiCollapsibleNavSubItemProps,
EuiTitle,
} from '@elastic/eui';
import { ChromeProjectNavigationNode } from '@kbn/core-chrome-browser';
import classnames from 'classnames';
Expand All @@ -22,7 +23,7 @@ import { isAbsoluteLink } from '../../utils';
const navigationNodeToEuiItem = (
item: ChromeProjectNavigationNode,
{ navigateToUrl, basePath }: { navigateToUrl: NavigateToUrlFn; basePath: BasePathService }
): EuiCollapsibleNavSubItemGroupTitle | EuiCollapsibleNavItemProps => {
): EuiCollapsibleNavSubItemProps => {
const href = item.deepLink?.url ?? item.href;
const id = item.path ? item.path.join('.') : item.id;
const isExternal = Boolean(href) && isAbsoluteLink(href!);
Expand All @@ -33,9 +34,30 @@ const navigationNodeToEuiItem = (
[`nav-item-isActive`]: isSelected,
});

// Note: this can be replaced with an `isGroup` API or whatever you prefer
// Could also probably be pulled out to a separate component vs inlined
if (item.isGroupTitle) {
return {
renderItem: () => (
<EuiTitle
size="xxxs"
className="eui-textTruncate"
css={({ euiTheme }: any) => ({
marginTop: euiTheme.size.base,
paddingBlock: euiTheme.size.xs,
paddingInline: euiTheme.size.s,
})}
>
<div id={id} data-test-subj={dataTestSubj}>
{item.title}
</div>
</EuiTitle>
),
};
}

return {
id,
isGroupTitle: item.isGroupTitle,
title: item.title,
isSelected,
accordionProps: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import { EuiFlyoutBody, EuiFlyoutFooter } from '@elastic/eui';
import { EuiCollapsibleNavBeta } from '@elastic/eui';
import React, { FC } from 'react';

interface Props {
Expand All @@ -22,10 +22,12 @@ export const NavigationUI: FC<Props> = ({ children, unstyled, footerChildren, da
<>{children}</>
) : (
<>
<EuiFlyoutBody scrollableTabIndex={-1} data-test-subj={dataTestSubj}>
<EuiCollapsibleNavBeta.Body data-test-subj={dataTestSubj}>
{children}
</EuiFlyoutBody>
{footerChildren && <EuiFlyoutFooter>{footerChildren}</EuiFlyoutFooter>}
</EuiCollapsibleNavBeta.Body>
{footerChildren && (
<EuiCollapsibleNavBeta.Footer>{footerChildren}</EuiCollapsibleNavBeta.Footer>
)}
</>
)}
</>
Expand Down
Loading