Skip to content

[PresentationUtil] Fix Canvas expression autocomplete#146425

Merged
nickpeihl merged 1 commit intoelastic:mainfrom
nickpeihl:fix-canvas-intellisense
Nov 28, 2022
Merged

[PresentationUtil] Fix Canvas expression autocomplete#146425
nickpeihl merged 1 commit intoelastic:mainfrom
nickpeihl:fix-canvas-intellisense

Conversation

@nickpeihl
Copy link
Contributor

@nickpeihl nickpeihl commented Nov 28, 2022

Fixes #146243

Summary

Fixes Canvas expression autocomplete

#143739 upgraded the monaco-editor dependency which uses a callback to the onLanguage method to initialize the expressions. The PR moved the monaco.languages.register command inside this callback and which was never triggered.

Moving the monaco.languages.register command outside the callback appears to fix the issue.

@nickpeihl nickpeihl added Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// release_note:skip Skip the PR/issue when compiling release notes v8.6.0 v8.7.0 labels Nov 28, 2022
@nickpeihl nickpeihl requested a review from a team as a code owner November 28, 2022 16:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nickpeihl nickpeihl requested a review from dokmic November 28, 2022 16:07
@bhavyarm
Copy link
Contributor

@nickpeihl is it possible to add a test too? or would you like to us to own it? Thank you very much.

@nickpeihl
Copy link
Contributor Author

@nickpeihl is it possible to add a test too? or would you like to us to own it? Thank you very much.

Maybe. But I'd like to explore that in a different PR due to the urgency of this fix.

@bhavyarm
Copy link
Contributor

I created a tracking issue here - #146427 You can also assign it to me. Will get to it after release QA is in a good place. Thanks!

@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

ESLint disabled in files

id before after diff
osquery 1 2 +1

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
fleet 59 65 +6
osquery 109 115 +6
securitySolution 442 448 +6
total +20

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
fleet 68 74 +6
osquery 110 117 +7
securitySolution 519 525 +6
total +21

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@cqliu1 cqliu1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Tested it out locally, and autocomplete is back to normal.

Screen Shot 2022-11-28 at 11 26 51 AM

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 28, 2022
Fixes elastic#146243

## Summary

Fixes Canvas expression autocomplete

elastic#143739 upgraded the monaco-editor
dependency which uses a callback to the `onLanguage` method to
initialize the expressions. The PR moved the `monaco.languages.register`
command inside this callback and which was never triggered.

Moving the `monaco.languages.register` command outside the callback
appears to fix the issue.

(cherry picked from commit 19413b7)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.6

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 28, 2022
…#146465)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[PresentationUtil] Fix Canvas expression autocomplete
(#146425)](#146425)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Nick
Peihl","email":"nick.peihl@elastic.co"},"sourceCommit":{"committedDate":"2022-11-28T19:30:37Z","message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Presentation","release_note:skip","backport:prev-minor","v8.6.0","v8.7.0"],"number":146425,"url":"https://github.com/elastic/kibana/pull/146425","mergeCommit":{"message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa"}},"sourceBranch":"main","suggestedTargetBranches":["8.6"],"targetPullRequestStates":[{"branch":"8.6","label":"v8.6.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/146425","number":146425,"mergeCommit":{"message":"[PresentationUtil]
Fix Canvas expression autocomplete (#146425)\n\nFixes #146243 \r\n\r\n##
Summary\r\n\r\nFixes Canvas expression
autocomplete\r\n\r\nhttps://github.com//pull/143739
upgraded the monaco-editor\r\ndependency which uses a callback to the
`onLanguage` method to\r\ninitialize the expressions. The PR moved the
`monaco.languages.register`\r\ncommand inside this callback and which
was never triggered.\r\n\r\nMoving the `monaco.languages.register`
command outside the callback\r\nappears to fix the
issue.","sha":"19413b7daae983b95dbb9f5c7b39cb8f3578ebfa"}}]}]
BACKPORT-->

Co-authored-by: Nick Peihl <nick.peihl@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release_note:skip Skip the PR/issue when compiling release notes Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.6.0 v8.7.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Canvas autocomplete is broken in expression editor

6 participants