Fix: success message and scroll after adding panel from library#220122
Fix: success message and scroll after adding panel from library#220122olapawlus merged 15 commits intoelastic:mainfrom
Conversation
There was a problem hiding this comment.
I think there's a way to make this simpler. The container prop has the type CanAddNewPanel. This type exposes an optional displaySuccessMessage boolean.
Looking at the original issue, I see
If you add a saved object of type Links or maps using Add from Library on dashboards. Kibana doesn't display action successful message. But it does for visualizations, lens and saved searches.
As Ola pointed out to me offline, Lens and visualizations no longer display the message.
I believe this is an issue with how the saved object types for Maps and Links are registered. All plugins such as Lens, Maps, Links that expect to appear in the Add from Library flyout must register an onAdd function with the registerAddFromLibrary function that is exposed to each plugin in their public/plugin.ts module. Those onAdd functions call container.addNewPanel, but I think they are missing the displaySuccessMessage option.
Regarding scrolling to the newly added panel, our dashboardsApi has a scrollToPanel method. But I think we would need to provide a new typeguard in panels_management similar to CanExpandPanels and apiCanExpandPanels. This is a bit more complex. If we want to fix in this PR, maybe we should chat on zoom with you, me, and @ThomThomson?
|
Happy to jump on a call to discuss any time! It might be best to do the scroll to panel inside the |
|
@nickpeihl @ThomThomson Thank you for the insights! I'd be happy to join the zoom discussion today. |
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
| @@ -0,0 +1,8 @@ | |||
| /* | |||
There was a problem hiding this comment.
Is this file valid? I just pulled it from the remote branch before pushing my latest changes, but I see that this file has been deleted in the serialized state PR @nickpeihl @nreese https://github.com/elastic/kibana/pull/215947/files#diff-12a0c8cb522398dd4d5ef0d1f87638d069f51ac76a7c971e714ae0f4ad9fb487
There was a problem hiding this comment.
get_on_add_search_embeddable.ts no longe exist on main.
There was a problem hiding this comment.
Yup we can go ahead and delete it from this branch too.
nickofthyme
left a comment
There was a problem hiding this comment.
Vis code changes LGTM
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, Data Discover change LGTM 👍 Let's just make sure to delete get_on_add_search_embeddable.ts before merging.
| @@ -0,0 +1,8 @@ | |||
| /* | |||
There was a problem hiding this comment.
Yup we can go ahead and delete it from this branch too.
…add_search_embeddable.ts
|
Starting backport for target branches: 8.18, 8.19, 9.0 |
💚 Build Succeeded
Metrics [docs]Page load bundle
History
cc @olapawlus |
…tic#220122) Initially there was no success message for any type in the library and there was no scrolling to added panel. This change sets displaySuccessMessage to true for each plugin registered in the Add from Library flyout. It ensures that: - users see a success toast after adding a panel, - the newly added panel is automatically scrolled into view. Closes: elastic#188775 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit e7e8d2f)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
#220122) (#220703) # Backport This will backport the following commits from `main` to `8.19`: - [Fix: success message and scroll after adding panel from library (#220122)](#220122) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ola Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T17:24:49Z","message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Dashboard","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:version","v9.1.0","v8.19.0","v8.18.2","v9.0.2"],"title":"Fix: success message and scroll after adding panel from library","number":220122,"url":"https://github.com/elastic/kibana/pull/220122","mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220122","number":220122,"mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…#220122) (#220776) # Backport This will backport the following commits from `main` to `9.0`: - [Fix: success message and scroll after adding panel from library (#220122)](#220122) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ola Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T17:24:49Z","message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Dashboard","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:version","v9.1.0","v8.19.0","v8.18.2","v9.0.2"],"title":"Fix: success message and scroll after adding panel from library","number":220122,"url":"https://github.com/elastic/kibana/pull/220122","mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220122","number":220122,"mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220703","number":220703,"state":"MERGED","mergeCommit":{"sha":"7501611e3277d378ea00e1731b39be0ebeb7769b","message":"[8.19] Fix: success message and scroll after adding panel from library (#220122) (#220703)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [Fix: success message and scroll after adding panel from library\n(#220122)](https://github.com/elastic/kibana/pull/220122)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com>"}},{"branch":"8.18","label":"v8.18.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
#220122) (#220777) # Backport This will backport the following commits from `main` to `8.18`: - [Fix: success message and scroll after adding panel from library (#220122)](#220122) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Ola Pawlus","email":"98127445+olapawlus@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T17:24:49Z","message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","Feature:Dashboard","Feature:Embedding","regression","release_note:fix","Team:Presentation","loe:small","impact:high","backport:version","v9.1.0","v8.19.0","v8.18.2","v9.0.2"],"title":"Fix: success message and scroll after adding panel from library","number":220122,"url":"https://github.com/elastic/kibana/pull/220122","mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},"sourceBranch":"main","suggestedTargetBranches":["8.18","9.0"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220122","number":220122,"mergeCommit":{"message":"Fix: success message and scroll after adding panel from library (#220122)\n\nInitially there was no success message for any type in the library and\nthere was no scrolling to added panel.\n\nThis change sets displaySuccessMessage to true for each plugin\nregistered in the Add from Library flyout.\n\nIt ensures that:\n- users see a success toast after adding a panel,\n- the newly added panel is automatically scrolled into view.\n\nCloses: #188775\n\n---------\n\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>","sha":"e7e8d2f13b44ae78b33ada4a3904b17066c6fd37"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220703","number":220703,"state":"MERGED","mergeCommit":{"sha":"7501611e3277d378ea00e1731b39be0ebeb7769b","message":"[8.19] Fix: success message and scroll after adding panel from library (#220122) (#220703)\n\n# Backport\n\nThis will backport the following commits from `main` to `8.19`:\n- [Fix: success message and scroll after adding panel from library\n(#220122)](https://github.com/elastic/kibana/pull/220122)\n\n\n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sorenlouv/backport)\n\n\n\nCo-authored-by: Ola Pawlus <98127445+olapawlus@users.noreply.github.com>"}},{"branch":"8.18","label":"v8.18.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.2","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…tic#220122) Initially there was no success message for any type in the library and there was no scrolling to added panel. This change sets displaySuccessMessage to true for each plugin registered in the Add from Library flyout. It ensures that: - users see a success toast after adding a panel, - the newly added panel is automatically scrolled into view. Closes: elastic#188775 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…tic#220122) Initially there was no success message for any type in the library and there was no scrolling to added panel. This change sets displaySuccessMessage to true for each plugin registered in the Add from Library flyout. It ensures that: - users see a success toast after adding a panel, - the newly added panel is automatically scrolled into view. Closes: elastic#188775 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Initially there was no success message for any type in the library and there was no scrolling to added panel.
This change sets displaySuccessMessage to true for each plugin registered in the Add from Library flyout.
It ensures that:
Closes: #188775