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

[ES|QL] Creates charts from the dashboard #171973

Merged
merged 29 commits into from
Dec 20, 2023

Conversation

stratoula
Copy link
Contributor

@stratoula stratoula commented Nov 27, 2023

Summary

Closes #165928

Enables the creation of ES|QL charts from the dashboard.

esql

The implementation is using UIActions which I think is the correct way to register a new panel action to a dashboard. Lens is responsible to register the ESQL panel action and owns the code.

How it works

  • A new ES|QL panel has been added to the dashboard toolbar registered by a ui action
  • A new panel is been created with a default esql query from <default_dataview_index_pattern> | limit 10
  • This results to a datatable and opens the flyout
  • If a user clicks cancel then the embeddable is being removed

Checklist

@stratoula stratoula changed the title Create the UiActions logic [ES|QL] Create charts from the dashboard Nov 28, 2023
@stratoula stratoula added release_note:feature Makes this part of the condensed release notes v8.13.0 backport:skip This commit does not require backporting Feature:ES|QL ES|QL related features in Kibana labels Dec 1, 2023
@stratoula stratoula changed the title [ES|QL] Create charts from the dashboard [ES|QL] Creates charts from the dashboard Dec 4, 2023
@stratoula
Copy link
Contributor Author

/ci

@stratoula
Copy link
Contributor Author

/ci

@stratoula
Copy link
Contributor Author

/ci

@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Dec 13, 2023
@stratoula stratoula marked this pull request as ready for review December 13, 2023 13:21
@stratoula stratoula requested review from a team as code owners December 13, 2023 13:21
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@stratoula
Copy link
Contributor Author

/ci

@stratoula
Copy link
Contributor Author

/ci

@nreese nreese self-requested a review December 19, 2023 15:09
@nreese
Copy link
Contributor

nreese commented Dec 19, 2023

Hitting cancel still adds table panel. Steps:

  1. Create new dashboard
  2. Click "Add panel" and then "ES|QL". This adds a table panel
  3. Edit ES|QL statement by adding "stats var0 = avg(bytes)", click "Run query". This adds a metric panel on top of table panel
  4. Click "cancel" in flyout footer.
  5. Notice how metric panel is deleted, but underneath is the original table panel, which does not get deleted.

Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well and Lens code LGTM

@stratoula
Copy link
Contributor Author

@nreese yes as long as the user does a change in the flyout, the Cancel button doesnt remove the panel. In my head, as long as the user starts editing things, they want to keep the panel. But as long as you find it confusing, I removed this logic and now the panel is removed whenever the user hits cancel

@stratoula
Copy link
Contributor Author

/ci

@stratoula
Copy link
Contributor Author

/ci

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Investigations - Security Solution Cypress Tests #6 / Correlation tab should update timeline after removing eql should update timeline after removing eql

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
dashboard 388 391 +3
lens 1152 1154 +2
total +5

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
lens 543 545 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 376.4KB 377.6KB +1.2KB
lens 1.4MB 1.4MB +1.7KB
total +3.0KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
dashboard 36.0KB 36.5KB +437.0B
lens 38.8KB 39.8KB +940.0B
total +1.3KB
Unknown metric groups

API count

id before after diff
lens 642 644 +2

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kibana-presentation changes LGTM - Allowing users to create charts without leaving dashboard is a huge step forward and such a great feature.
code review, tested in chrome

@stratoula stratoula merged commit 0503b82 into elastic:main Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:feature Makes this part of the condensed release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ES|QL] Create and edit visualizations from the dashboard
7 participants