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 load_from param #196836

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

ElenaStoeva
Copy link
Contributor

@ElenaStoeva ElenaStoeva commented Oct 18, 2024

Fixes #195877
Addresses #179658

Summary

This PR fixes the bug in Console where using the load_from param in the URL made Console uneditable because every re-render reset the initial value in the editor. This is fixed by restricting the hook to only set the initial value once. This PR also adds some unit tests for the hook, as I realized that this was a long-standing improvement.

How to test:

Try loading the following URL (making the necessary replacement in the URL) and verify that the data is correctly loaded into the editor and value can be edited:

http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA

http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console

@ElenaStoeva ElenaStoeva added 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 labels Oct 18, 2024
@ElenaStoeva ElenaStoeva self-assigned this Oct 18, 2024
@ElenaStoeva ElenaStoeva requested a review from a team as a code owner October 18, 2024 10:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@ElenaStoeva ElenaStoeva added the backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) label Oct 18, 2024
@mattkime
Copy link
Contributor

/ci

Copy link
Contributor

@mattkime mattkime left a comment

Choose a reason for hiding this comment

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

changes look good and work well, thanks!

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #6 / When on the package policy create page Submit page With agentless Cloud available should create agent policy and package policy when in cloud and agentless API url is set
  • [job] [logs] Jest Tests #6 / When on the package policy create page Submit page With agentless Cloud available should create agentless agent policy and package policy when in cloud and agentless API url is set

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 205.6KB 205.6KB +49.0B

History

cc @ElenaStoeva

@ElenaStoeva ElenaStoeva merged commit e6e4e34 into elastic:main Oct 21, 2024
22 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/11447118081

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Oct 21, 2024
Fixes elastic#195877
Addresses elastic#179658

## Summary

This PR fixes the bug in Console where using the `load_from` param in
the URL made Console uneditable because every re-render reset the
initial value in the editor. This is fixed by restricting the hook to
only set the initial value once. This PR also adds some unit tests for
the hook, as I realized that this was a long-standing improvement.

### How to test:

Try loading the following URL (making the necessary replacement in the
URL) and verify that the data is correctly loaded into the editor and
value can be edited:

`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`

`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`

Co-authored-by: Matthew Kime <[email protected]>
(cherry picked from commit e6e4e34)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

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 Oct 21, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[Console] Fix load_from param
(#196836)](#196836)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-21T19:20:30Z","message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana
Management","release_note:skip","v9.0.0","backport:prev-minor"],"title":"[Console]
Fix load_from
param","number":196836,"url":"https://github.com/elastic/kibana/pull/196836","mergeCommit":{"message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196836","number":196836,"mergeCommit":{"message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058"}}]}]
BACKPORT-->

Co-authored-by: Elena Stoeva <[email protected]>
@ElenaStoeva
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
8.16

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

Questions ?

Please refer to the Backport tool documentation

ElenaStoeva added a commit to ElenaStoeva/kibana that referenced this pull request Oct 22, 2024
Fixes elastic#195877
Addresses elastic#179658

## Summary

This PR fixes the bug in Console where using the `load_from` param in
the URL made Console uneditable because every re-render reset the
initial value in the editor. This is fixed by restricting the hook to
only set the initial value once. This PR also adds some unit tests for
the hook, as I realized that this was a long-standing improvement.

### How to test:

Try loading the following URL (making the necessary replacement in the
URL) and verify that the data is correctly loaded into the editor and
value can be edited:

`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`

`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`

Co-authored-by: Matthew Kime <[email protected]>
(cherry picked from commit e6e4e34)
ElenaStoeva added a commit that referenced this pull request Oct 22, 2024
# Backport

This will backport the following commits from `main` to `8.16`:
- [[Console] Fix load_from param
(#196836)](#196836)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-10-21T19:20:30Z","message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana
Management","release_note:skip","v9.0.0","backport:prev-minor","v8.16.0","v8.17.0"],"number":196836,"url":"https://github.com/elastic/kibana/pull/196836","mergeCommit":{"message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058"}},"sourceBranch":"main","suggestedTargetBranches":["8.16"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196836","number":196836,"mergeCommit":{"message":"[Console]
Fix load_from param (#196836)\n\nFixes
https://github.com/elastic/kibana/issues/195877\r\nAddresses
https://github.com/elastic/kibana/issues/179658\r\n\r\n##
Summary\r\n\r\nThis PR fixes the bug in Console where using the
`load_from` param in\r\nthe URL made Console uneditable because every
re-render reset the\r\ninitial value in the editor. This is fixed by
restricting the hook to\r\nonly set the initial value once. This PR also
adds some unit tests for\r\nthe hook, as I realized that this was a
long-standing improvement.\r\n\r\n### How to test:\r\n\r\nTry loading
the following URL (making the necessary replacement in the\r\nURL) and
verify that the data is correctly loaded into the editor and\r\nvalue
can be
edited:\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\r\n\r\n\r\n\r\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\r\n\r\nCo-authored-by:
Matthew Kime
<[email protected]>","sha":"e6e4e343aa700f1b489915f8df233a0abf2ea058"}},{"branch":"8.16","label":"v8.16.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/197131","number":197131,"state":"MERGED","mergeCommit":{"sha":"a5ad3e5d937ee5cfed4e78dfb10e2e40aad4e075","message":"[8.x]
[Console] Fix load_from param (#196836) (#197131)\n\n# Backport\n\nThis
will backport the following commits from `main` to `8.x`:\n- [[Console]
Fix load_from
param\n(#196836)](https://github.com/elastic/kibana/pull/196836)\n\n<!---
Backport version: 9.4.3 -->\n\n### Questions ?\nPlease refer to the
[Backport
tool\ndocumentation](https://github.com/sqren/backport)\n\n<!--BACKPORT
[{\"author\":{\"name\":\"Elena\nStoeva\",\"email\":\"[email protected]\"},\"sourceCommit\":{\"committedDate\":\"2024-10-21T19:20:30Z\",\"message\":\"[Console]\nFix
load_from param
(#196836)\\n\\nFixes\nhttps://github.com//issues/195877\\r\\nAddresses\nhttps://github.com//issues/179658\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes the bug in Console where using the\n`load_from` param
in\\r\\nthe URL made Console uneditable because every\nre-render reset
the\\r\\ninitial value in the editor. This is fixed by\nrestricting the
hook to\\r\\nonly set the initial value once. This PR also\nadds some
unit tests for\\r\\nthe hook, as I realized that this was
a\nlong-standing improvement.\\r\\n\\r\\n### How to test:\\r\\n\\r\\nTry
loading\nthe following URL (making the necessary replacement in
the\\r\\nURL) and\nverify that the data is correctly loaded into the
editor and\\r\\nvalue\ncan
be\nedited:\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\\r\\n\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\\r\\n\\r\\nCo-authored-by:\nMatthew
Kime\n<[email protected]>\",\"sha\":\"e6e4e343aa700f1b489915f8df233a0abf2ea058\",\"branchLabelMapping\":{\"^v9.0.0$\":\"main\",\"^v8.17.0$\":\"8.x\",\"^v(\\\\d+).(\\\\d+).\\\\d+$\":\"$1.$2\"}},\"sourcePullRequest\":{\"labels\":[\"Feature:Console\",\"Team:Kibana\nManagement\",\"release_note:skip\",\"v9.0.0\",\"backport:prev-minor\"],\"title\":\"[Console]\nFix
load_from\nparam\",\"number\":196836,\"url\":\"https://github.com/elastic/kibana/pull/196836\",\"mergeCommit\":{\"message\":\"[Console]\nFix
load_from param
(#196836)\\n\\nFixes\nhttps://github.com//issues/195877\\r\\nAddresses\nhttps://github.com//issues/179658\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes the bug in Console where using the\n`load_from` param
in\\r\\nthe URL made Console uneditable because every\nre-render reset
the\\r\\ninitial value in the editor. This is fixed by\nrestricting the
hook to\\r\\nonly set the initial value once. This PR also\nadds some
unit tests for\\r\\nthe hook, as I realized that this was
a\nlong-standing improvement.\\r\\n\\r\\n### How to test:\\r\\n\\r\\nTry
loading\nthe following URL (making the necessary replacement in
the\\r\\nURL) and\nverify that the data is correctly loaded into the
editor and\\r\\nvalue\ncan
be\nedited:\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\\r\\n\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\\r\\n\\r\\nCo-authored-by:\nMatthew
Kime\n<[email protected]>\",\"sha\":\"e6e4e343aa700f1b489915f8df233a0abf2ea058\"}},\"sourceBranch\":\"main\",\"suggestedTargetBranches\":[],\"targetPullRequestStates\":[{\"branch\":\"main\",\"label\":\"v9.0.0\",\"branchLabelMappingKey\":\"^v9.0.0$\",\"isSourceBranch\":true,\"state\":\"MERGED\",\"url\":\"https://github.com/elastic/kibana/pull/196836\",\"number\":196836,\"mergeCommit\":{\"message\":\"[Console]\nFix
load_from param
(#196836)\\n\\nFixes\nhttps://github.com//issues/195877\\r\\nAddresses\nhttps://github.com//issues/179658\\r\\n\\r\\n##\nSummary\\r\\n\\r\\nThis
PR fixes the bug in Console where using the\n`load_from` param
in\\r\\nthe URL made Console uneditable because every\nre-render reset
the\\r\\ninitial value in the editor. This is fixed by\nrestricting the
hook to\\r\\nonly set the initial value once. This PR also\nadds some
unit tests for\\r\\nthe hook, as I realized that this was
a\nlong-standing improvement.\\r\\n\\r\\n### How to test:\\r\\n\\r\\nTry
loading\nthe following URL (making the necessary replacement in
the\\r\\nURL) and\nverify that the data is correctly loaded into the
editor and\\r\\nvalue\ncan
be\nedited:\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=data:text/plain,AoeQygKgBA9A+gRwK4FMBOBPGBDAzhgOwGMB+AEzQHsAHOApAGwbiMoaQFsDcAoAbx5QoAImToMwgFwiAZgCVKAWShoUHSgBcUAWgBUkgJYEyKAB4pcwgDSCRDSkWwMUUkSgLXbwmQYZa0rgJCQsIARpRsgbbBIhxIuBquANoAujYxIT5+6Mlp0cHCuAAWlIxkuekZwnEJdJq5+QC+ts2NQA`\\r\\n\\r\\n\\r\\n\\r\\n`http://localhost:5601/<REPLACE-THIS>/app/dev_tools#/console?load_from=https://www.elastic.co/guide/en/elasticsearch/reference/current/snippets/86.console`\\r\\n\\r\\nCo-authored-by:\nMatthew
Kime\n<[email protected]>\",\"sha\":\"e6e4e343aa700f1b489915f8df233a0abf2ea058\"}}]}]\nBACKPORT-->\n\nCo-authored-by:
Elena Stoeva <[email protected]>"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (8.x) the previous minor version (i.e. one version back from main) 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.16.0 v8.17.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Console] A console url that contains load_from query para doesnt allow editing
4 participants