Hello team!

Hello team! Is there a way to bypass this "Delete Answer" Modal confirmation for the delete operation? Context: If some error happens, I want to delete the created resource on ThoughSpot without prompting anything to the user.
No description
12 Replies
shikharTS
shikharTS8mo ago
I don't think we have any config to bypass this. Maybe @ashish/ @Justin Mathew can help if we can do something to achieve this. Also I am guessing this might supress all the delete confirmation modals..
Geovane
GeovaneOP8mo ago
I am also open to other approaches that you may be aware of achieving this. Ideally, a flag or config to bypass the confirmation would be great.
ashish
ashish8mo ago
Where is the delete operation invoked from ? From within an answer OR from the answer list page ?
Geovane
GeovaneOP8mo ago
Thanks for replying @ashish 🙌
Where is the delete operation invoked from ? From within an answer OR from the answer list page ?
Right now from my searchEmbed component. When I capture an error, I am triggering the delete doing: embedRef.current.trigger(HostEvent.Delete);. Then this trigger, opens the Confirmation Modal. Tried to manipulate something before opening the Dialog, but without success too. 😦
embedRef.current.on(
EmbedEvent.DialogOpen,
async (response) => {
debugger;
},
{ start: true }
);
embedRef.current.on(
EmbedEvent.DialogOpen,
async (response) => {
debugger;
},
{ start: true }
);
ashish
ashish8mo ago
yeah, so an alternate approach would be to hide the Delete action using hiddenActions and then create a new callback Custom action, this will call a callback to the host application (with the id of the answer in the payload). Thats where you could call our metadata APIs to delete the answer.
Geovane
GeovaneOP8mo ago
so an alternate approach would be to hide the Delete action using hiddenActions
This is already done.
and then create a new callback Custom action, this will call a callback to the host application (with the id of the answer in the payload). Thats where you could call our metadata APIs to delete the answer
I never used this CustomAction because I never understood that well. But in case you were referring to delete the resource using the ThoughtSpot API instead of the embedRef, this was my backup plan that I was trying to now use 😅 . But if this is the only option, ok =). Thanks for replying @ashish !
ashish
ashish8mo ago
So custom actions will give you a new item in that 3 dot menu, which when clicked will call a callback function in your host application. In that callback you can call the delete API. Here are the docs for more information https://developers.thoughtspot.com/docs/custom-action-callback
Callback custom actions
Set up a callback function to the host application and trigger a response payload from the embedded ThoughtSpot component.
Geovane
GeovaneOP8mo ago
Hmmmm interesting @ashish , I didn't know that. I think it doesn't match to our current business criteria. At this point we would need to literally call the embed.delete in the ideal scenario (just delete without dialog opening to the user). But if it is not the case I will try to use the TS API in the backend.
ashish
ashish8mo ago
I feel with Custom action you can achieve exactly what you want. You are just replacing the thoughtspot delete action with your own, and then doing what you want in that.
Geovane
GeovaneOP8mo ago
I feel with Custom action you can achieve exactly what you want. You are just replacing the thoughtspot delete action with your own, and then doing what you want in that.
I think it sounds almost right, but I don't want to literally replace everything by my own action. I want to use the TS built-in delete feature without the Confirmation Modal. Is there a way to call the delete action without the confirmation dialog? Let me know if I am missing something @ashish . As always I appreciate the assistance 🙌
No description
shikharTS
shikharTS8mo ago
I do not think at the moment we can use the built-in delete feature without the Confirmation Modal. We might add this feature to our pipeline for upcoming releases. But as Ashish suggested above, you can use the custom Action to achieve this.
Geovane
GeovaneOP8mo ago
We might add this feature to our pipeline for upcoming releases.
That would awesome. I will work on something else in meantime but will keep an eye on upcoming releases 🙏

Did you find this page helpful?