Hello Sai,
UUX doesn't support a method to close the modal via javascript. There are some weird ways to potentially accomplish this, but currently there is no easy or clean way to do this.
You could use an overpanel which has close overpanel, but unfortunately modal doesn't have this ability.
Thank you,
Trey Teter
Software Engineer
The modal is meant to be a blocking UI element that requires user interaction to bypass. It isn't currently designed for auto-closure. For that, we have showAlert which can show a non-blocking "toast" style notification to the end user. showAlert can be configured for closure or to auto-close after a set duration.
Here is an example of how you would call that today:
tecton.actions.showAlert({
toastHeader: 'Verify Action',
message: 'You have 10 seconds to cancel. Would you like to continue?',
styleType: 'warning',
closable: false,
durationInMs: 10000,
clickActionName: 'CONTINUE',
hideActionName: 'CONTINUE',
hasTimestamp: true,
toastActions: [
{
label: 'Cancel',
actionName: 'CANCEL',
},
{
label: 'Continue',
actionName: 'CONTINUE',
},
],
})
.then((actionName) => {
console.log(actionName);
});
Another option would be to create your own overlay with a route in your application and a overpanel. With the size and height options, you can create a modal-style overpanel that gives you full control of content in the overlay and the ability to call the closeOverpanel method on a timer.
https://tecton.q2developer.com/guides/overpanel-entrypoint/
https://tecton.q2developer.com/capabilities/showOverpanel/
https://tecton.q2developer.com/capabilities/closeOverpanel/