Skip to content

[ES|QL][Lens] Keeps the chart configuration when possible#210780

Merged
stratoula merged 12 commits intoelastic:mainfrom
stratoula:lens-keep-conf-if-possible
Feb 21, 2025
Merged

[ES|QL][Lens] Keeps the chart configuration when possible#210780
stratoula merged 12 commits intoelastic:mainfrom
stratoula:lens-keep-conf-if-possible

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Feb 12, 2025

Summary

Closes #186366

meow

It keeps the chart configuration when the user is doing actions compatible with the current query such as:

  • Adding a where filter
  • Changing to a compatible chart type (from example from bar to line or pie to treemap)
  • In general changing the query that doesnt affect the generated columns mapped to a chart.

Release notes

Keeps the chart configuration changes done by the user when changing the query whenever it is possible.

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • Flaky Test Runner was used on any tests changed
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
};

export const injectESQLQueryIntoLensLayers = (
attributes: TypedLensSerializedState['attributes'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ I would love to move this to the visualizations-utils package but the TypedLensSerializedState must move first and is a tricky one.

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7878

[✅] x-pack/test/functional/apps/lens/group7/config.ts: 25/25 tests passed.

see run history

@kibanamachine
Copy link
Contributor

Flaky Test Runner Stats

🎉 All tests passed! - kibana-flaky-test-suite-runner#7880

[✅] x-pack/test/functional/apps/lens/group7/config.ts: 25/25 tests passed.

see run history

@stratoula stratoula added v9.1.0 v8.19.0 Feature:Lens Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// labels Feb 14, 2025
@stratoula stratoula marked this pull request as ready for review February 14, 2025 16:32
@stratoula stratoula requested a review from a team as a code owner February 14, 2025 16:32
@elasticmachine
Copy link
Contributor

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

@stratoula stratoula added the backport:version Backport to applied version labels label Feb 14, 2025
@stratoula stratoula requested a review from a team as a code owner February 20, 2025 08:41
wordWrap: 'on',
wrappingIndent: 'none',
};
const codeEditorOptions: CodeEditorProps['options'] = useMemo(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ℹ️ Irrelevant with the PR, just saw that we do an extra rerender here

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
lens 1785 1786 +1

Async chunks

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

id before after diff
esql 237.1KB 237.2KB +37.0B
lens 1.6MB 1.6MB +1.5KB
total +1.6KB

History

wordWrap: 'on',
wrappingIndent: 'none',
};
const codeEditorOptions: CodeEditorProps['options'] = useMemo(
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice catch

@stratoula stratoula merged commit cb77b97 into elastic:main Feb 21, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/13452854711

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 210780

Questions ?

Please refer to the Backport tool documentation

@stratoula
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

stratoula added a commit to stratoula/kibana that referenced this pull request Feb 21, 2025
…0780)

## Summary

Closes elastic#186366

![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)

It keeps the chart configuration when the user is doing actions
compatible with the current query such as:

- Adding a where filter
- Changing to a compatible chart type (from example from bar to line or
pie to treemap)
- In general changing the query that doesnt affect the generated columns
mapped to a chart.

### Release notes

Keeps the chart configuration changes done by the user when changing the
query whenever it is possible.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit cb77b97)

# Conflicts:
#	src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx
stratoula added a commit that referenced this pull request Feb 21, 2025
) (#212013)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL][Lens] Keeps the chart configuration when possible
(#210780)](#210780)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Stratoula
Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-02-21T08:24:00Z","message":"[ES|QL][Lens]
Keeps the chart configuration when possible (#210780)\n\n##
Summary\n\nCloses
https://github.com/elastic/kibana/issues/186366\n\n\n![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)\n\nIt
keeps the chart configuration when the user is doing actions\ncompatible
with the current query such as:\n\n- Adding a where filter\n- Changing
to a compatible chart type (from example from bar to line or\npie to
treemap)\n- In general changing the query that doesnt affect the
generated columns\nmapped to a chart.\n\n### Release notes\n\nKeeps the
chart configuration changes done by the user when changing the\nquery
whenever it is possible.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"cb77b978877443cdce12f00a42e54609c0b36dbc","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:Visualizations","Feature:Lens","Feature:ES|QL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL][Lens]
Keeps the chart configuration when
possible","number":210780,"url":"https://github.com/elastic/kibana/pull/210780","mergeCommit":{"message":"[ES|QL][Lens]
Keeps the chart configuration when possible (#210780)\n\n##
Summary\n\nCloses
https://github.com/elastic/kibana/issues/186366\n\n\n![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)\n\nIt
keeps the chart configuration when the user is doing actions\ncompatible
with the current query such as:\n\n- Adding a where filter\n- Changing
to a compatible chart type (from example from bar to line or\npie to
treemap)\n- In general changing the query that doesnt affect the
generated columns\nmapped to a chart.\n\n### Release notes\n\nKeeps the
chart configuration changes done by the user when changing the\nquery
whenever it is possible.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"cb77b978877443cdce12f00a42e54609c0b36dbc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/210780","number":210780,"mergeCommit":{"message":"[ES|QL][Lens]
Keeps the chart configuration when possible (#210780)\n\n##
Summary\n\nCloses
https://github.com/elastic/kibana/issues/186366\n\n\n![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)\n\nIt
keeps the chart configuration when the user is doing actions\ncompatible
with the current query such as:\n\n- Adding a where filter\n- Changing
to a compatible chart type (from example from bar to line or\npie to
treemap)\n- In general changing the query that doesnt affect the
generated columns\nmapped to a chart.\n\n### Release notes\n\nKeeps the
chart configuration changes done by the user when changing the\nquery
whenever it is possible.\n\n### Checklist\n\n- [ ] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [ ] [Flaky
Test\nRunner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1)
was\nused on any tests changed\n- [ ] The PR description includes the
appropriate Release Notes section,\nand the correct `release_note:*`
label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)","sha":"cb77b978877443cdce12f00a42e54609c0b36dbc"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Mar 22, 2025
…0780)

## Summary

Closes elastic#186366


![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)

It keeps the chart configuration when the user is doing actions
compatible with the current query such as:

- Adding a where filter
- Changing to a compatible chart type (from example from bar to line or
pie to treemap)
- In general changing the query that doesnt affect the generated columns
mapped to a chart.

### Release notes

Keeps the chart configuration changes done by the user when changing the
query whenever it is possible.

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
florent-leborgne added a commit to elastic/docs-content that referenced this pull request Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:ES|QL ES|QL related features in Kibana Feature:Lens release_note:enhancement Team:Visualizations Team label for Lens, elastic-charts, Graph, legacy editors (TSVB, Visualize, Timelion) t// v8.19.0 v9.1.0

5 participants