Tim - Hello 👋 I'm embedding a liveboard, and I...
Hello 👋 I'm embedding a liveboard, and I want to allow my users to add a new visualization. I'm currently doing it with an "Add Chart" button on the host that redirects to a new page with Search embedded. The user can use that to build a viz and add it to the liveboard with the Pin button. I would prefer to have this "Add Chart" button live within the liveboard's "More" menu though. Is there a way to make this happen? I was thinking custom actions, but those appear to only work on a visualization level and not the liveboard level.
4 Replies
Hi @Valhalla Supporting custom actions for liveboard is in our roadmap but currently we do not support this and you will have to create a button in your host application to support your usecase.
cc : @utsav.kapoor @Nicolas
Thanks @Aditya! I will go ahead and implement it this way then. The only problem is I have to deal with multiple toolbars. The TS toolbar has edit, and the more menu, etc, and my host app has the Add chart button. I would like to conslidate them into a single toolbar. Since I cannot use custom actions in TS, I must move the Edit button (and others) into my host application's toolbar. I see you provide host events to do this.
I have begun implementing this for Edit. I added an edit button to my host app that calls
embedRef?.current?.trigger(HostEvent.Edit)
. The problem I'm running into is sometimes clicking edit will cause the visualizations inside the liveboard to disappear. I have also added a save button so the user can save their changes. Clicking save calls embedRef?.current?.trigger(HostEvent.Save)
. This successfully saves the changes, but similarly also causes the visualizations to disappear until I refresh the page.
Have you run into this before? Am I missing something obvious? Do you have any code examples I could view?That's weird that should not happen let me check.
https://codesandbox.io/p/sandbox/c59tvd?file=%2Fsrc%2FApp.tsx%3A11%2C71
I tried it out here and it is working fine. Can you please check this?
Please enter your own TS cluster and liveboardId
Ok thanks it may have been an issue on my side. I'll try again with more simplified code in the next couple days. I'll let you know if I encounter any more issues