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
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import { debouncedComponent } from '../../debounced_component';

const MAX_SUGGESTIONS_DISPLAYED = 5;

// TODO: Remove this <any> when upstream fix is merged https://github.com/elastic/eui/issues/2329
// eslint-disable-next-line
const EuiPanelFixed = EuiPanel as React.ComponentType<any>;

export interface SuggestionPanelProps {
activeDatasourceId: string | null;
datasourceMap: Record<string, Datasource>;
Expand Down Expand Up @@ -55,15 +59,17 @@ const SuggestionPreview = ({
setExpressionError(false);
}, [previewExpression]);

const clickHandler = () => {
switchToSuggestion(frame, dispatch, suggestion);
};

return (
<EuiToolTip content={suggestion.title}>
<EuiPanel
<EuiPanelFixed
className="lnsSuggestionPanel__button"
paddingSize="none"
data-test-subj="lnsSuggestion"
onClick={() => {
switchToSuggestion(frame, dispatch, suggestion);
}}
onClick={clickHandler}
>
{expressionError ? (
<div className="lnsSidebar__suggestionIcon">
Expand Down Expand Up @@ -94,7 +100,7 @@ const SuggestionPreview = ({
<EuiIcon size="xxl" type={suggestion.previewIcon} />
</div>
)}
</EuiPanel>
</EuiPanelFixed>
</EuiToolTip>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ describe('XYConfigPanel', () => {
.first()
.prop('options') as EuiButtonGroupProps['options'];

expect(options.map(({ id }) => id)).toEqual([
expect(options!.map(({ id }) => id)).toEqual([
'bar',
'bar_stacked',
'line',
'area',
'area_stacked',
]);

expect(options.filter(({ isDisabled }) => isDisabled).map(({ id }) => id)).toEqual([]);
expect(options!.filter(({ isDisabled }) => isDisabled).map(({ id }) => id)).toEqual([]);
});

test('the x dimension panel accepts only bucketed operations', () => {
Expand Down