-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[8.x] [Console] Fix load_from param (#196836) #197131
Merged
kibanamachine
merged 1 commit into
elastic:8.x
from
kibanamachine:backport/8.x/pr-196836
Oct 21, 2024
Merged
[8.x] [Console] Fix load_from param (#196836) #197131
kibanamachine
merged 1 commit into
elastic:8.x
from
kibanamachine:backport/8.x/pr-196836
Oct 21, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)
💚 Build Succeeded
Metrics [docs]Async chunks
cc @ElenaStoeva |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
main
to8.x
:Questions ?
Please refer to the Backport tool documentation