Skip to content

[9.0] [Discover] Fix formatting and sorting for custom ES|QL vars (#209360)#210519

Merged
kibanamachine merged 1 commit intoelastic:9.0from
kibanamachine:backport/9.0/pr-209360
Feb 11, 2025
Merged

[9.0] [Discover] Fix formatting and sorting for custom ES|QL vars (#209360)#210519
kibanamachine merged 1 commit intoelastic:9.0from
kibanamachine:backport/9.0/pr-209360

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.0:

Questions ?

Please refer to the Backport tool documentation

…209360)

- Closes elastic#208020

## Summary

By default the data view (which is used in ES|QL mode) has only mapped
fields as per field caps for the current index pattern. This PR
dynamically extends with additional fields based on ES|QL meta
information.

This change helps to fix the formatting for ES|QL var values and fixes
sorting on them.

<img width="1673" alt="Screenshot 2025-02-03 at 18 42 14"
src="https://github.com/user-attachments/assets/3647a375-f0f5-43e6-815d-d5a4292c637a"
/>
<img width="643" alt="Screenshot 2025-02-03 at 18 42 50"
src="https://github.com/user-attachments/assets/9d84bc23-7665-43c1-8ac2-d67174b68c31"
/>

### Checklist

- [x] [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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
(cherry picked from commit 9635cfa)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Feb 11, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) February 11, 2025 10:04
@kibanamachine kibanamachine merged commit 3f49fd9 into elastic:9.0 Feb 11, 2025
4 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 604 605 +1
apm 1700 1701 +1
canvas 1227 1228 +1
cloudSecurityPosture 790 791 +1
dashboard 728 729 +1
data 608 609 +1
datasetQuality 280 281 +1
dataViewManagement 221 222 +1
dataVisualizer 852 853 +1
discover 1095 1096 +1
esql 211 212 +1
esqlDataGrid 515 516 +1
eventAnnotationListing 742 743 +1
infra 1302 1303 +1
investigateApp 354 355 +1
lens 1814 1815 +1
lists 431 432 +1
logsExplorer 574 575 +1
logsShared 362 363 +1
maps 1335 1336 +1
ml 2215 2216 +1
observability 1345 1346 +1
observabilityAIAssistantApp 507 508 +1
presentationUtil 146 147 +1
searchPlayground 289 290 +1
securitySolution 6699 6700 +1
slo 990 991 +1
stackAlerts 271 272 +1
unifiedDocViewer 278 279 +1
unifiedHistogram 284 285 +1
unifiedSearch 393 394 +1
total +31

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
@kbn/data-view-utils 6 11 +5

Async chunks

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

id before after diff
cloudSecurityPosture 537.6KB 537.9KB +257.0B
discover 847.1KB 847.2KB +169.0B
esqlDataGrid 190.4KB 190.7KB +256.0B
securitySolution 21.6MB 21.6MB +1.5KB
slo 892.8KB 893.0KB +260.0B
unifiedDocViewer 148.5KB 148.8KB +254.0B
total +2.7KB

Page load bundle

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

id before after diff
cloudSecurityPosture 18.9KB 18.8KB -139.0B
dataViews 62.9KB 62.9KB +39.0B
esqlDataGrid 9.4KB 9.3KB -139.0B
total -239.0B
Unknown metric groups

API count

id before after diff
@kbn/data-view-utils 8 13 +5
dataViews 1229 1233 +4
total +9

cc @jughosta

jughosta added a commit that referenced this pull request May 5, 2025
…209360) (#220069)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Discover] Fix formatting and sorting for custom ES|QL vars
(#209360)](#209360)

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

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

<!--BACKPORT [{"author":{"name":"Julia
Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2025-02-11T09:58:51Z","message":"[Discover]
Fix formatting and sorting for custom ES|QL vars (#209360)\n\n- Closes
https://github.com/elastic/kibana/issues/208020\r\n\r\n##
Summary\r\n\r\nBy default the data view (which is used in ES|QL mode)
has only mapped\r\nfields as per field caps for the current index
pattern. This PR\r\ndynamically extends with additional fields based on
ES|QL meta\r\ninformation.\r\n\r\nThis change helps to fix the
formatting for ES|QL var values and fixes\r\nsorting on
them.\r\n\r\n<img width=\"1673\" alt=\"Screenshot 2025-02-03 at 18 42
14\"\r\nsrc=\"https://github.com/user-attachments/assets/3647a375-f0f5-43e6-815d-d5a4292c637a\"\r\n/>\r\n<img
width=\"643\" alt=\"Screenshot 2025-02-03 at 18 42
50\"\r\nsrc=\"https://github.com/user-attachments/assets/9d84bc23-7665-43c1-8ac2-d67174b68c31\"\r\n/>\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"9635cfa5268c6250111f8eb5edcd693311a47193","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","v9.0.0","Team:DataDiscovery","Feature:ES|QL","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Discover]
Fix formatting and sorting for custom ES|QL
vars","number":209360,"url":"https://github.com/elastic/kibana/pull/209360","mergeCommit":{"message":"[Discover]
Fix formatting and sorting for custom ES|QL vars (#209360)\n\n- Closes
https://github.com/elastic/kibana/issues/208020\r\n\r\n##
Summary\r\n\r\nBy default the data view (which is used in ES|QL mode)
has only mapped\r\nfields as per field caps for the current index
pattern. This PR\r\ndynamically extends with additional fields based on
ES|QL meta\r\ninformation.\r\n\r\nThis change helps to fix the
formatting for ES|QL var values and fixes\r\nsorting on
them.\r\n\r\n<img width=\"1673\" alt=\"Screenshot 2025-02-03 at 18 42
14\"\r\nsrc=\"https://github.com/user-attachments/assets/3647a375-f0f5-43e6-815d-d5a4292c637a\"\r\n/>\r\n<img
width=\"643\" alt=\"Screenshot 2025-02-03 at 18 42
50\"\r\nsrc=\"https://github.com/user-attachments/assets/9d84bc23-7665-43c1-8ac2-d67174b68c31\"\r\n/>\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"9635cfa5268c6250111f8eb5edcd693311a47193"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","8.19"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/210519","number":210519,"state":"MERGED","mergeCommit":{"sha":"3f49fd963f5d9386dcf47381d053d0e00cc8c37e","message":"[9.0]
[Discover] Fix formatting and sorting for custom ES|QL vars (#209360)
(#210519)\n\n# Backport\n\nThis will backport the following commits from
`main` to `9.0`:\n- [[Discover] Fix formatting and sorting for custom
ES|QL
vars\n(#209360)](https://github.com/elastic/kibana/pull/209360)\n\n\n\n###
Questions ?\nPlease refer to the [Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by:
Julia Rechkunova
<julia.rechkunova@elastic.co>"}},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/209360","number":209360,"mergeCommit":{"message":"[Discover]
Fix formatting and sorting for custom ES|QL vars (#209360)\n\n- Closes
https://github.com/elastic/kibana/issues/208020\r\n\r\n##
Summary\r\n\r\nBy default the data view (which is used in ES|QL mode)
has only mapped\r\nfields as per field caps for the current index
pattern. This PR\r\ndynamically extends with additional fields based on
ES|QL meta\r\ninformation.\r\n\r\nThis change helps to fix the
formatting for ES|QL var values and fixes\r\nsorting on
them.\r\n\r\n<img width=\"1673\" alt=\"Screenshot 2025-02-03 at 18 42
14\"\r\nsrc=\"https://github.com/user-attachments/assets/3647a375-f0f5-43e6-815d-d5a4292c637a\"\r\n/>\r\n<img
width=\"643\" alt=\"Screenshot 2025-02-03 at 18 42
50\"\r\nsrc=\"https://github.com/user-attachments/assets/9d84bc23-7665-43c1-8ac2-d67174b68c31\"\r\n/>\r\n\r\n\r\n###
Checklist\r\n\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by:
Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"9635cfa5268c6250111f8eb5edcd693311a47193"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants