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

[lens] Fix usage of EUI after typescript upgrade #45404

Merged
merged 2 commits into from
Sep 11, 2019
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