[Console] Fix an error with folds in the editor#152366
[Console] Fix an error with folds in the editor#152366yuliacech merged 3 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
ElenaStoeva
left a comment
There was a problem hiding this comment.
Thanks for fixing this @yuliacech! I tested the scenario locally and the editor works fine with the given local storage items. The only thing that I noticed is that a list of all request method options shows up. Is this behaviour expected?

Apart from this, changes look good to me. I only have one small suggestion on the test.
| await PageObjects.header.waitUntilLoadingHasFinished(); | ||
| await PageObjects.console.closeHelpIfExists(); | ||
| const request = await PageObjects.console.getRequest(); | ||
| expect(request.length).to.be.greaterThan(0); |
There was a problem hiding this comment.
Would it be a good idea to also check if request is equal to "GET _cat/indices"?
|
Thanks a lot for the review, @ElenaStoeva! |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
## Summary Fixes elastic#151563 There is a combination of the folds in the editor (collapsed lines) and the text that can cause the editor to fail. This PR adds a try/catch clause to the editor, so that the UI can still be used. ### How to use 1. Open Kibana and in your browser's Dev Tools, delete everything from local storage. 2. Add following 2 items back to the local storage: ``` sense:folds [{"start":{"row":1,"column":1},"end":{"row":82,"column":4}}] sense:console_local_text-object_e69f508c-3342-45cf-ae7c-2753548ce8e7 {"id":"e69f508c-3342-45cf-ae7c-2753548ce8e7","createdAt":1675332935410,"updatedAt":1676630754720,"text":"GET _cat/indices"} ``` 3. Navigate to Console in Kibana, make sure the editor works. ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
Summary
Fixes #151563
There is a combination of the folds in the editor (collapsed lines) and the text that can cause the editor to fail. This PR adds a try/catch clause to the editor, so that the UI can still be used.
How to use
Checklist