-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Textbased languages] Render Lens suggestions in Discover #151581
Conversation
return ( | ||
query && | ||
isOfAggregateQueryType(query) && | ||
(getAggregateQueryMode(query) === 'sql' || getAggregateQueryMode(query) === 'esql') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ I am adding this additional check as this will be needed for esql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: at least it will make it easier to add a new one :D
(getAggregateQueryMode(query) === 'sql' || getAggregateQueryMode(query) === 'esql') | |
(['sql', 'esql'].some( mode === getAggregateQueryMode(query))) |
@@ -120,7 +120,7 @@ export function suggestions({ | |||
const newShape = getNewShape(groups, subVisualizationId as PieVisualizationState['shape']); | |||
const baseSuggestion: VisualizationSuggestion<PieVisualizationState> = { | |||
title: i18n.translate('xpack.lens.pie.suggestionLabel', { | |||
defaultMessage: 'As {chartName}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Some charts were using the As ...
format and other just the visualization name. I decided to keep the latter for consistency (the title is depicted on the suggestions dropdown)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a code review on the Lens side: proposed some changes to align the new API with the existing Lens API.
…ified Histogram components, as well as reducing async issues by making lensSuggestionsApi a layout prop and delaying rendering until it's available
…based column updates are handled
Text-based Discover Lens cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for letting me work with you on getting this over the finish line, and as promised my stamp of approval ✅! LGTM, and I'm excited to get this into main
-- a great step forward to a DiscoLens future 🪩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I've found a bug on the unified search introduced with this PR while testing it with Safari:
The feature is super cool @stratoula ! 🎉
On a side note it is not obvious discovering this awesome DiscoLens 🪩 as there's nothing that hints the user the presence of a visualization in SQL mode. Perhaps a basic histogram can be visualized for the simple SELECT * FROM <dataView>
query?
On the code review side I've left mostly minor improvements and nitpicks. The only change I would recommend is to rename the stateHelperApi.suggestionsApi
into stateHelperApi.suggestions
to be in style sync with the other 2 apis.
src/plugins/unified_histogram/public/chart/hooks/use_chart_panels.ts
Outdated
Show resolved
Hide resolved
src/plugins/unified_histogram/public/chart/hooks/use_chart_panels.ts
Outdated
Show resolved
Hide resolved
return ( | ||
query && | ||
isOfAggregateQueryType(query) && | ||
(getAggregateQueryMode(query) === 'sql' || getAggregateQueryMode(query) === 'esql') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: at least it will make it easier to add a new one :D
(getAggregateQueryMode(query) === 'sql' || getAggregateQueryMode(query) === 'esql') | |
(['sql', 'esql'].some( mode === getAggregateQueryMode(query))) |
src/plugins/unified_histogram/public/layout/hooks/use_lens_suggestions.ts
Show resolved
Hide resolved
src/plugins/unified_histogram/public/layout/hooks/use_lens_suggestions.ts
Show resolved
Hide resolved
@dej611 thanx for the nits. We discussed it with the ESQL WG and we decided against it |
💔 Build FailedFailed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
Part of #147472
This PR adds the unified histogram on the text based mode in Discover and depicts Lens suggestions to the users. The users can navigate from it to Lens for further exploration and adding the viz into a dashboard.
Some notes:
Flaky test runner: https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/1972
Checklist