Skip to content

Commit

Permalink
[Unified Search] Display dataviews in the EuiCombobox as a text and n…
Browse files Browse the repository at this point in the history
…ot pills (elastic#189474)

Doesn't display dataviews as pills but as a plain text. Before:

<img width="409" alt="Screenshot 2024-07-30 at 10 47 25"
src="https://github.com/user-attachments/assets/067f362d-8c5f-4895-8354-132e973fb2b3">

After:
<img width="403" alt="Screenshot 2024-07-30 at 10 46 52"
src="https://github.com/user-attachments/assets/1c67988f-0259-4345-bab2-f66f7efe194e">
  • Loading branch information
mbondyra authored Jul 31, 2024
1 parent 94dca8d commit 06c18d9
Showing 1 changed file with 6 additions and 3 deletions.
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

0 comments on commit 06c18d9

Please sign in to comment.