-
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] Fix toggling multi fields from doc view table #91121
[Discover] Fix toggling multi fields from doc view table #91121
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
Tested in Chrome on Mac OSX, works as expected 👍
@@ -54,6 +54,19 @@ export function DocViewTable({ | |||
setFieldsWithParents(arr); | |||
}, [indexPattern, hit]); | |||
|
|||
const toggleColumn = useCallback( | |||
(field: string) => { | |||
if (onRemoveColumn && onAddColumn && Array.isArray(columns)) { |
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.
nit: we could just return early here if one of the conditions is not satisfied, so not the entire function would need to be inside an if-statement
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.
yes, agreed, it's really 🙈 , will improve
@@ -142,10 +146,12 @@ export function DocViewTable({ | |||
displayUnderscoreWarning={displayUnderscoreWarning} | |||
isCollapsed={isCollapsed} | |||
isCollapsible={isCollapsible} | |||
isColumnActive={Array.isArray(columns) && columns.includes(field)} | |||
isColumnActive={Array.isArray(columns) && columns.includes(multiField)} |
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.
why do we need this check if columns is an array? it will always be at least an empty array, won't it?
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.
no, it can be undefined
in the doc view, however, no need to check for an array here, since it's an array or undefined, good catch!
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Page load bundle
History
To update your PR or re-run it, just comment with: |
…ndition-for-hiding-recommded-allocation * 'master' of github.com:elastic/kibana: [Discover] Fix toggling multi fields from doc view table (elastic#91121) [ML] Data Frame Analytics: ROC Curve Chart (elastic#89991) skip flaky suite (elastic#86948) skip flaky suite (elastic#91191) Fix date histogram time zone for rollup index (elastic#90632) [Search Source] Fix retrieval of unmapped fields; Add field filters (elastic#89837) [Logs UI] Use useMlHref hook for ML links (elastic#90935) Fix values of `products.min_price` field in Kibana sample ecommerce data set (elastic#90428) [APM] Darker shade for Error group details labels (elastic#91349) [Lens] Adjust new copy for 7.12 (elastic#90413) [ML] Unskip test. Fix modelMemoryLimit value. (elastic#91280) [Lens] Fix empty display name issue in XY chart (elastic#91132) [Lens] Improves error messages when in Dashboard (elastic#90668) [Lens] Keyboard-selected items follow user traversal of drop zones (elastic#90546) [Lens] Improves ranking feature in Top values (elastic#90749) [ILM] Rollover min age tooltip and copy fixes (elastic#91110) # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts
Summary
This PR fixes issue with adding multi fields from the doc viewer table (the parent field was added), and improves the rendering of the Multi field header (just by spanning it's container cell). So it no longer should look like this: