-
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
Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid #92442
Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid #92442
Conversation
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.
Thx for this migration! Is there an option to remove the line numbers here? Since I think they are not necessary in this case, and it would save a bit of screen space here. Also I'd like to have an opinion of our valued @elastic/kibana-design team about this change
I guess it would depend on the specific use case on whether or not the line numbers are helpful. Not sure that this is what we want to do, but to at least know what the possibilities are: is it possible to add a toggle in this popover to show/hide the line numbers? |
@kertal what do you think about the toggle for displaying line numbers? |
I do agree that there might be situations when this is useful, but generally for me it's a quick preview and shouldn't have to much additional UI, dear @snide & @ryankeairns, wdyt? |
I side with @kertal . This is a rather small preview capability whereas a user can access a larger view of the JSON in the flyout by clicking on the expand icon at the front of each row. Generally speaking, I wonder about the value for this small preview. Perhaps we should consider opening the flyout with the JSON tab opened. |
This is not just a small preview for the all of |
Ah, ok. For the non |
The popover is the only way to expand a single value, except of course they are part of the doc view table and JSON view. |
Thanks for the context @kertal . My line of thought here is to either include the line number or not (I lean towards not), but not invest much more in adding additional UI/options until we have a chance to think this through further. I sense there may be a path of leveraging the flyout in more cases, but that will take us running through a few use cases to verify that assumption. PS - oops, I closed this on accident... speaking of tricky UX ;) |
I also lead towards no line numbers, so I suggest going forward here (Think your unconsciousness wants also a close button in the popover, that might explain your choice of button ... suggesting a different issue for that ;) |
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
@@ -108,8 +109,7 @@ export const getRenderCellValueFn = ( | |||
|
|||
if (field && field.type === '_source') { | |||
if (isDetails) { | |||
// nicely formatted JSON for the expanded view | |||
return <span>{JSON.stringify(row, null, 2)}</span>; | |||
return <JsonCodeEditor hit={row} hasLineNumbers={false} width={370} />; |
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.
Could you please provide some details why 370
and maybe create constant for this?
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.
maps changes LGTM
code review
@elasticmachine merge upstream |
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.
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
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 LGTM, tested locally in Chrome, Firefox, Safari, MacOS, works as expected, thx for the functional and the code simplification 🙏
@elasticmachine run elasticsearch-ci/docs |
* Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid * Add optional "hasLineNumbers" property to JsonCodeEditor and removed line numbers from the popover * Update json_code_editor snapshot * Add functional test for cell expanded content popover * Remove unused code * Fix geo point case and refactor some code Co-authored-by: Kibana Machine <[email protected]>
…4780) * Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid * Add optional "hasLineNumbers" property to JsonCodeEditor and removed line numbers from the popover * Update json_code_editor snapshot * Add functional test for cell expanded content popover * Remove unused code * Fix geo point case and refactor some code Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
…-action * 'master' of github.com:elastic/kibana: (44 commits) Migrate the optimizer mixin to core (#94272) Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid (#92442) [ML] Anomaly Detection: Migrate validation messages links to use docLinks. (#94568) [Lists][Exceptions] - Adding basic linting, i18n and storybook support (#94772) [Fleet] Add test/fix for invalid/missing ids in bulk agent reassign (#94632) [Security Solution] [Cases] Move create page components and dependencies to Cases (#94444) [ML] Data Frame Analytics accessibility tests: fix flaky outlier creation test (#94735) [Security Solutions] Remove commented out old linter rules (#94753) [App Search] Role mappings migration part 2 (#94461) [CI] Update Backport action inputs to match updated ones (#94721) [chore] Remove the infra team from CODEOWNERS (#94740) [Connectors UI] Make UI use new connector APIs (#94180) [ML] Use indices options in anomaly detection job wizards (#91830) Remove `string` as a valid registry var type value (#94174) [Alerts] Replaces legacy es client with the ElasticsearchClient for alerts and triggers_actions_ui plugins. (#93364) [Reporting-CSV Export] Re-write CSV Export using SearchSource (#88303) chore(NA): upgrade bazel rules nodejs to v3.2.2 (#94726) [APM] Settings: Update layout and update/add descriptions (#94398) skip flaky suite (#94666) [XY axis] Integrates legend color picker with the eui palette (#90589) ... # Conflicts: # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared_fields/searchable_snapshot_field/searchable_snapshot_field.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/constants.ts # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx # x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/form/configuration_context.tsx # x-pack/plugins/index_lifecycle_management/public/shared_imports.ts
Closes #59949
Summary
Replaced
EuiCodeBlock
withJsonCodeEditor
in DiscoverGrid cell popoverTo test:
In Advanced settings set the value of
doc_table:legacy
property tofalse
Open Discover
Click expand button on any cell in Document column
Checklist
Delete any items that are not applicable to this PR.
For maintainers