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

[kbn/flot-charts] Use jQuery methods to build legends #199871

Merged
merged 2 commits into from
Nov 13, 2024

Conversation

nickpeihl
Copy link
Member

@nickpeihl nickpeihl commented Nov 12, 2024

Summary

Updates the kbn/flot-charts package to use jQuery methods for legend construction.

Background:
In #195643 we attempted to replace our copy of the flot library with the changes in flot/flot#1184 which removes unsafe inline style templating among other updates. Even though Canvas charts continued to render, some stack monitoring charts failed. We reverted the PR in #198067 in favor of a more targeted approach.

The unsafe inline style templates (example) only exist in the insertLegend function of flot. These templates were fixed in the 0.9.0 version by using native jQuery methods to construct elements. So rather than updating the entire library, this PR only updates the insertLegend function from the https://github.com/flot/flot/tree/0.9-work branch.

The version of flot we use is 0.8.3 and the latest version of flot is 4.x. I don’t think it makes sense to try and jump four major versions just to maintain compatibility with legacy Canvas charts and stack monitoring charts. That is why we opted to use the latest 0.9 version of flot for this PR.

@nickpeihl nickpeihl added Team:Monitoring Stack Monitoring team Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas release_note:skip Skip the PR/issue when compiling release notes backport:all-open Backport to all branches that could still receive a release labels Nov 12, 2024
@nickpeihl nickpeihl requested review from a team as code owners November 12, 2024 19:36
@elasticmachine
Copy link
Contributor

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

@elasticmachine
Copy link
Contributor

💚 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
canvas 1.1MB 1.1MB -50.0B
monitoring 533.3KB 533.2KB -50.0B
total -100.0B

Copy link
Contributor

@consulthys consulthys left a comment

Choose a reason for hiding this comment

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

LGT Stack Monitoring

@nreese nreese self-requested a review November 13, 2024 18:54
@nickpeihl nickpeihl merged commit 1f5fe1d into elastic:main Nov 13, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 7.17, 8.15, 8.16, 8.x

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.

(cherry picked from commit 1f5fe1d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.

(cherry picked from commit 1f5fe1d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.

(cherry picked from commit 1f5fe1d)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 13, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.

(cherry picked from commit 1f5fe1d)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
7.17
8.15
8.16
8.x

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 13, 2024
#200076)

# Backport

This will backport the following commits from `main` to `8.15`:
- [[kbn/flot-charts] Use jQuery methods to build legends
(#199871)](#199871)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-13T19:15:18Z","message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Monitoring","Team:Presentation","release_note:skip","v9.0.0","backport:all-open"],"title":"[kbn/flot-charts]
Use jQuery methods to build
legends","number":199871,"url":"https://github.com/elastic/kibana/pull/199871","mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199871","number":199871,"mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 13, 2024
#200077)

# Backport

This will backport the following commits from `main` to `8.16`:
- [[kbn/flot-charts] Use jQuery methods to build legends
(#199871)](#199871)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-13T19:15:18Z","message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Monitoring","Team:Presentation","release_note:skip","v9.0.0","backport:all-open"],"title":"[kbn/flot-charts]
Use jQuery methods to build
legends","number":199871,"url":"https://github.com/elastic/kibana/pull/199871","mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199871","number":199871,"mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 13, 2024
…#200078)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[kbn/flot-charts] Use jQuery methods to build legends
(#199871)](#199871)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-13T19:15:18Z","message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Monitoring","Team:Presentation","release_note:skip","v9.0.0","backport:all-open"],"title":"[kbn/flot-charts]
Use jQuery methods to build
legends","number":199871,"url":"https://github.com/elastic/kibana/pull/199871","mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199871","number":199871,"mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <[email protected]>
kibanamachine added a commit that referenced this pull request Nov 13, 2024
#200075)

# Backport

This will backport the following commits from `main` to `7.17`:
- [[kbn/flot-charts] Use jQuery methods to build legends
(#199871)](#199871)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-13T19:15:18Z","message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Monitoring","Team:Presentation","release_note:skip","v9.0.0","backport:all-open"],"title":"[kbn/flot-charts]
Use jQuery methods to build
legends","number":199871,"url":"https://github.com/elastic/kibana/pull/199871","mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199871","number":199871,"mergeCommit":{"message":"[kbn/flot-charts]
Use jQuery methods to build legends (#199871)\n\n##
Summary\r\n\r\nUpdates the kbn/flot-charts package to use jQuery methods
for
legend\r\nconstruction.","sha":"1f5fe1d7ceee071dcfc361534d068cdaecb5b098"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <[email protected]>
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Nov 18, 2024
## Summary

Updates the kbn/flot-charts package to use jQuery methods for legend
construction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:all-open Backport to all branches that could still receive a release release_note:skip Skip the PR/issue when compiling release notes Team:Monitoring Stack Monitoring team Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas v7.17.26 v8.15.5 v8.16.1 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants