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

[Console] Fix an error with folds in the editor #152366

Merged
merged 3 commits into from
Mar 6, 2023

Conversation

yuliacech
Copy link
Contributor

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

  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"} 
  1. Navigate to Console in Kibana, make sure the editor works.

Checklist

@yuliacech yuliacech added bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more release_note:skip Skip the PR/issue when compiling release notes v8.8.0 labels Feb 28, 2023
@yuliacech yuliacech marked this pull request as ready for review February 28, 2023 17:28
@yuliacech yuliacech requested a review from a team as a code owner February 28, 2023 17:28
@elasticmachine
Copy link
Contributor

Pinging @elastic/platform-deployment-management (Team:Deployment Management)

Copy link
Contributor

@ElenaStoeva ElenaStoeva left a comment

Choose a reason for hiding this comment

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

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?
Screenshot 2023-03-02 at 14 03 45

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);
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be a good idea to also check if request is equal to "GET _cat/indices"?

@yuliacech
Copy link
Contributor Author

Thanks a lot for the review, @ElenaStoeva!
I think the methods list is displayed because the request is restored into the editor from the local storage.

@yuliacech yuliacech enabled auto-merge (squash) March 6, 2023 11:29
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
console 417.9KB 417.9KB +15.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 428 430 +2

Total ESLint disabled count

id before after diff
securitySolution 506 508 +2

History

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

@yuliacech yuliacech merged commit b3807ba into elastic:main Mar 6, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Mar 6, 2023
bmorelli25 pushed a commit to bmorelli25/kibana that referenced this pull request Mar 10, 2023
## 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)
@yuliacech yuliacech deleted the 8.8/fix_console_folds branch February 15, 2024 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience Feature:Console Dev Tools Console Feature release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more v8.8.0
Projects
None yet
5 participants