1
0
Fork 0
mirror of synced 2024-07-16 19:56:10 +12:00

Add ability for buttons to link to external URLs

This commit is contained in:
Andrew Kingston 2021-06-25 16:07:25 +01:00
parent b6a62de0d3
commit 7b876b2b42

View file

@ -31,10 +31,16 @@ const triggerAutomationHandler = async action => {
} }
const navigationHandler = action => { const navigationHandler = action => {
if (action.parameters.url) { const { url } = action.parameters
if (url) {
const external = !url.startsWith("/")
if (external) {
window.location.href = url
} else {
routeStore.actions.navigate(action.parameters.url) routeStore.actions.navigate(action.parameters.url)
} }
} }
}
const queryExecutionHandler = async action => { const queryExecutionHandler = async action => {
const { datasourceId, queryId, queryParams } = action.parameters const { datasourceId, queryId, queryParams } = action.parameters