-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover][ES|QL] No legacy table for ES|QL mode #180370
Conversation
/ci |
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @jughosta |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good and it works well! Thanks for addressing it so quickly, LGTM 👍
@@ -140,15 +140,19 @@ function DiscoverDocumentsComponent({ | |||
|
|||
const expandedDoc = useInternalStateSelector((state) => state.expandedDoc); | |||
|
|||
const isTextBasedQuery = useMemo(() => getRawRecordType(query) === RecordRawType.PLAIN, [query]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const isTextBasedQuery = useMemo(() => getRawRecordType(query) === RecordRawType.PLAIN, [query]); | |
const isTextBasedQueryMode = useMemo(() => isTextBasedQuery(query), [query]); |
Nit: I know this was just moved up a couple of lines, but it might be a good opportunity to switch to the isTextBasedQuery
util from src/plugins/discover/public/application/main/utils/is_text_based_query.ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tbh I think we should delete isTextBasedQuery
discover wrapper and use isOfAggregateQueryType
directly instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- forgot to add the mention in the comment above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would work for me too, my main concern is really just around consistency in the utils we use. Personally I find isOfAggregateQueryType
harder to grok than isTextBasedQuery
since aggregate query
is an unclear term to me, but that's more of a nit than anything as long as we're consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something for a later cleanup. I would like minimize extra refactoring shortly before FF as it's unrelated to the current ticket.
savedSearch.rowsPerPage = uiSettings.get(DOC_TABLE_LEGACY) | ||
savedSearch.rowsPerPage = isLegacyTableEnabled({ | ||
uiSettings, | ||
isTextBasedQueryMode: isOfAggregateQueryType(savedSearch.searchSource.getField('query')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isTextBasedQueryMode: isOfAggregateQueryType(savedSearch.searchSource.getField('query')), | |
isTextBasedQueryMode: isTextBasedQuery(savedSearch.searchSource.getField('query')), |
Nit: similar suggestion here
# Backport This will backport the following commits from `main` to `8.14`: - [[Discover] Fix JSON view height in DocViewer (#183468)](#183468) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Julia Rechkunova","email":"julia.rechkunova@elastic.co"},"sourceCommit":{"committedDate":"2024-05-15T11:06:24Z","message":"[Discover] Fix JSON view height in DocViewer (#183468)\n\n- A fix after\r\nhttps://github.com//pull/180370/files#diff-ed350967c6564d64f0123a2d55700b1ddc7f5d6fcb3786384fb7ae25334fe9eaL672\r\n\r\n## Summary\r\n\r\nThis PR fixes the height of JSON block in DocViewer. ~Also it reduces\r\nthe available height as the flyout now has a footer with Close button.~","sha":"994b8c2beab211e15facff3eec3676d8e96bcbea","branchLabelMapping":{"^v8.15.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Discover","release_note:skip","Team:DataDiscovery","backport:prev-minor","Feature:UnifiedDocViewer","v8.15.0"],"title":"[Discover] Fix JSON view height in DocViewer","number":183468,"url":"https://github.com/elastic/kibana/pull/183468","mergeCommit":{"message":"[Discover] Fix JSON view height in DocViewer (#183468)\n\n- A fix after\r\nhttps://github.com//pull/180370/files#diff-ed350967c6564d64f0123a2d55700b1ddc7f5d6fcb3786384fb7ae25334fe9eaL672\r\n\r\n## Summary\r\n\r\nThis PR fixes the height of JSON block in DocViewer. ~Also it reduces\r\nthe available height as the flyout now has a footer with Close button.~","sha":"994b8c2beab211e15facff3eec3676d8e96bcbea"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.15.0","branchLabelMappingKey":"^v8.15.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/183468","number":183468,"mergeCommit":{"message":"[Discover] Fix JSON view height in DocViewer (#183468)\n\n- A fix after\r\nhttps://github.com//pull/180370/files#diff-ed350967c6564d64f0123a2d55700b1ddc7f5d6fcb3786384fb7ae25334fe9eaL672\r\n\r\n## Summary\r\n\r\nThis PR fixes the height of JSON block in DocViewer. ~Also it reduces\r\nthe available height as the flyout now has a footer with Close button.~","sha":"994b8c2beab211e15facff3eec3676d8e96bcbea"}}]}] BACKPORT--> Co-authored-by: Julia Rechkunova <julia.rechkunova@elastic.co>
Summary
Even if
doc_table:legacy
is enabled this PR makes sure that we render the new grid for ES|QL mode.Checklist