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] Do not allow saving in library action on text based panels #167111

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

stratoula
Copy link
Contributor

Summary

Save to library action should not be present in ES|QL panels. For now we only allow by value embeddables and we don't want them to be edited/created in Lens editor

image

Checklist

@stratoula stratoula added release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting Feature:ES|QL ES|QL related features in Kibana v8.11.0 labels Sep 25, 2023
@stratoula stratoula marked this pull request as ready for review September 25, 2023 06:34
@stratoula stratoula requested a review from a team as a code owner September 25, 2023 06:34
@stratoula stratoula added the Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas label Sep 25, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 25, 2023
@elasticmachine
Copy link
Contributor

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

const { isOfAggregateQueryType } = await import('@kbn/es-query');
const query = isFilterableEmbeddable(embeddable) && (await embeddable.getQuery());
// Textbased panels (i.e. ES|QL, SQL) should not save to library
const isTextBasedEmbeddable = isOfAggregateQueryType(query as AggregateQuery);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a test to packages/kbn-es-query/src/es_query/es_aggregate_query.test.ts that verifies isOfAggregateQueryType returns false when query is undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done d1df81f


const { isOfAggregateQueryType } = await import('@kbn/es-query');
const query = isFilterableEmbeddable(embeddable) && (await embeddable.getQuery());
// Textbased panels (i.e. ES|QL, SQL) should not save to library
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this always be true? Why can't text based panels be saved to library? Would it be better to put an explicit flag on embeddable interface?

Copy link
Contributor Author

@stratoula stratoula Sep 27, 2023

Choose a reason for hiding this comment

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

This is a business decision we made for ES|QL. We don' t want them to be saved in library or being edited in Lens. The visualizations created with ESQL will always be by value ones.

@stratoula stratoula requested a review from a team as a code owner September 27, 2023 13:44
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
code review only

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

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

Data Discovery changes LGTM 👍

@stratoula stratoula enabled auto-merge (squash) September 27, 2023 14:48
@stratoula stratoula merged commit 93fc807 into elastic:main Sep 27, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
dashboard 358.2KB 358.3KB +142.0B

History

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

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:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants