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

[FEATURE] Beautiful format of PPL JSON result page #1913

Open
zane-neo opened this issue Jun 14, 2024 · 1 comment
Open

[FEATURE] Beautiful format of PPL JSON result page #1913

zane-neo opened this issue Jun 14, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@zane-neo
Copy link

Is your feature request related to a problem?
Current PPL query results display JSON results in raw string format which is not consistent to how it's been displayed in discovery page like below:
PPL query result:
Screenshot 2024-06-14 at 11 02 06
Discovery page result:
image
It would be great that PPL page display json result in a better approach like in discovery page, this can reduce the misunderstanding on the field type and give customer better user experience.

What solution would you like?
A clear and concise description of what you want to happen.

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
Add any other context or screenshots about the feature request here.

@zane-neo zane-neo added enhancement New feature or request untriaged labels Jun 14, 2024
@Swiddis
Copy link
Collaborator

Swiddis commented Jun 14, 2024

Thanks for the issue!

Looks like the relevant part is the JsonCodeBlock referenced in the doc viewer, the rendering logic is here.

return (
  <EuiCodeBlock aria-label={label} language="json" isCopyable paddingSize="s">
    {JSON.stringify(hit, null, 2)}
  </EuiCodeBlock>
);

We could probably find a way to hack this to render nested objects correctly, but I wonder why the underlying API is returning strings instead of objects? Is there some difference in how the documents are being processed under the hood here?

Marking as a good first issue and leaving open for now. In the spirit of making the issue approachable for newcomers, it would be nice to get some more detailed reproduction steps. I can work them out later if needed.

@Swiddis Swiddis added good first issue Good for newcomers and removed untriaged labels Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants