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

[Vis editor] Triple quote for multiline script support in JSON input #107723

Closed
kiju98 opened this issue Aug 5, 2021 · 3 comments · Fixed by #112656
Closed

[Vis editor] Triple quote for multiline script support in JSON input #107723

kiju98 opened this issue Aug 5, 2021 · 3 comments · Fixed by #112656
Assignees
Labels
Feature:Vis Editor Visualization editor issues Team:Visualizations Visualization editors, elastic-charts and infrastructure :VisEditors:fix-it-week

Comments

@kiju98
Copy link

kiju98 commented Aug 5, 2021

Describe the feature:

It seems that the editor in Kibana 7.13.0+ supports the triple quote but Kibana Visualization doesn't support it.
It would be great if it's supported in Visualization so that we can use scripts easier.

Describe a specific use case for the feature:

Currently the normal quite works as below:

If we use unmatching quotes as below, we get a red bar on the right side:

The triple quote doesn't show the red bar in the right side but still the JSON input label turns red and the Update button shows Errors in the highlighted fields need to be resolved.

FYI, the triple quote is supported in Watcher and SearchProfiler (#57563)

@kiju98 kiju98 added the Feature:Vis Editor Visualization editor issues label Aug 5, 2021
@botelastic botelastic bot added the needs-team Issues missing a team label label Aug 5, 2021
@kiju98 kiju98 added the v7.14.0 label Aug 5, 2021
@stratoula stratoula added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Aug 5, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@botelastic botelastic bot removed the needs-team Issues missing a team label label Aug 5, 2021
@timroes
Copy link
Contributor

timroes commented Aug 5, 2021

@stratoula The problem here is that when we migrated to monaco, we used XJSON as a language instead of JSON, thus the editor thinks we can do triple quotes, while we technically can't because we never treat that value actually as xJSON, but only JSON.

I think this is currently especially confusing, since our monaco integration doesn't even have JSON as a language, why a lot of people might fall back to using XJson thinking it's the same and then run into this problem. I've opened #107733 to track supporting JSON highlighting.

So we basically have two options: a) switch to JSON highlighting ones available or b) treat that value actually as xJSON and thus allow triple quotes in visualize.

@stratoula
Copy link
Contributor

Yes I guessed so Tim, this is the reason I decided to open this issue. I think that we should try the second option first and if is not possible for any reason then switch to JSON highlighting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Vis Editor Visualization editor issues Team:Visualizations Visualization editors, elastic-charts and infrastructure :VisEditors:fix-it-week
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants