Add log out button action

This commit is contained in:
Andrew Kingston 2021-02-26 14:04:12 +00:00
parent 5ea2ad9010
commit a67a8fb957
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<script>
import { getBindableProperties } from "builderStore/dataBinding"
import { currentAsset, store } from "builderStore"
export let parameters
let bindingDrawer
$: bindings = getBindableProperties($currentAsset, $store.selectedComponentId)
</script>
<div class="root">This action doesn't require any additional settings.</div>
<style>
.root {
font-size: var(--font-size-s);
}
</style>

View File

@ -5,6 +5,7 @@ import ExecuteQuery from "./ExecuteQuery.svelte"
import TriggerAutomation from "./TriggerAutomation.svelte"
import ValidateForm from "./ValidateForm.svelte"
import LogIn from "./LogIn.svelte"
import LogOut from "./LogOut.svelte"
// defines what actions are available, when adding a new one
// the component is the setup panel for the action
@ -40,4 +41,8 @@ export default [
name: "Log In",
component: LogIn,
},
{
name: "Log Out",
component: LogOut,
},
]

View File

@ -73,6 +73,10 @@ const loginHandler = async action => {
await authStore.actions.logIn({ email, password })
}
const logoutHandler = async () => {
await authStore.actions.logOut()
}
const handlerMap = {
["Save Row"]: saveRowHandler,
["Delete Row"]: deleteRowHandler,
@ -82,6 +86,7 @@ const handlerMap = {
["Validate Form"]: validateFormHandler,
["Refresh Datasource"]: refreshDatasourceHandler,
["Log In"]: loginHandler,
["Log Out"]: logoutHandler,
}
/**