mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Fix: success message and scroll after adding panel from library (#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: #188775 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
e528a30fa8
commit
e7e8d2f13b
9 changed files with 71 additions and 44 deletions
|
@ -16,12 +16,15 @@ const APP_ICON = 'logoKibana';
|
|||
export const registerMyEmbeddableSavedObject = (embeddableSetup: EmbeddableSetup) =>
|
||||
embeddableSetup.registerAddFromLibraryType({
|
||||
onAdd: (container, savedObject) => {
|
||||
container.addNewPanel({
|
||||
panelType: MY_EMBEDDABLE_TYPE,
|
||||
serializedState: {
|
||||
rawState: savedObject.attributes,
|
||||
container.addNewPanel(
|
||||
{
|
||||
panelType: MY_EMBEDDABLE_TYPE,
|
||||
serializedState: {
|
||||
rawState: savedObject.attributes,
|
||||
},
|
||||
},
|
||||
});
|
||||
true // shows a toast and scrolls to panel
|
||||
);
|
||||
},
|
||||
savedObjectType: MY_SAVED_OBJECT_TYPE,
|
||||
savedObjectName: 'Some saved object',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue