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

[Unified Search] Display dataviews in the EuiCombobox as a text and not pills #189474

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import { Required } from '@kbn/utility-types';
import { EuiComboBox, EuiComboBoxProps } from '@elastic/eui';
import { calculateWidthFromEntries } from '@kbn/calculate-width-from-char-count';
import type { DataViewsContract } from '@kbn/data-views-plugin/public';
import { MIDDLE_TRUNCATION_PROPS } from '../filter_bar/filter_editor/lib/helpers';
import {
MIDDLE_TRUNCATION_PROPS,
SINGLE_SELECTION_AS_TEXT_PROPS,
} from '../filter_bar/filter_editor/lib/helpers';

export type IndexPatternSelectProps = Required<
Omit<EuiComboBoxProps<any>, 'onSearchChange' | 'options' | 'selectedOptions' | 'onChange'>,
Expand Down Expand Up @@ -117,7 +120,7 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte

this.setState({
isLoading: false,
options,
options: options.sort((a, b) => a.label.localeCompare(b.label)),
});

if (this.props.onNoIndexPatterns && searchValue === '' && options.length === 0) {
Expand Down Expand Up @@ -155,7 +158,7 @@ export default class IndexPatternSelect extends Component<IndexPatternSelectInte
<EuiComboBox
{...rest}
placeholder={placeholder}
singleSelection={true}
singleSelection={SINGLE_SELECTION_AS_TEXT_PROPS}
isLoading={this.state.isLoading || this.props.isLoading}
onSearchChange={this.fetchOptions}
options={this.state.options}
Expand Down