This commit is contained in:
Andrew Kingston 2024-09-16 12:17:12 +01:00
parent c634cfdeac
commit d23d4156c3
No known key found for this signature in database
2 changed files with 8 additions and 11 deletions

View File

@ -8,10 +8,6 @@
const { nodes, edges, createRole } = getContext("flow")
const flow = useSvelteFlow()
const addRole = async () => {
await createRole()
}
const doAutoLayout = async () => {
const layout = autoLayout({ nodes: $nodes, edges: $edges })
nodes.set(layout.nodes)
@ -47,7 +43,7 @@
<Button secondary on:click={doAutoLayout}>Auto layout</Button>
</div>
<div class="control bottom-right">
<Button icon="Add" cta on:click={addRole}>Add role</Button>
<Button icon="Add" cta on:click={createRole}>Add role</Button>
</div>
<style>

View File

@ -10,7 +10,7 @@
} from "@budibase/bbui"
import { Roles } from "constants/backend"
import { NodeWidth, NodeHeight, MaxAutoZoom, ZoomDuration } from "./constants"
import { getContext, tick } from "svelte"
import { getContext } from "svelte"
import { autoLayout } from "./layout"
import { roles } from "stores/builder"
@ -48,10 +48,6 @@
return null
}
const deleteNode = async () => {
await deleteRole(id)
}
const openPopover = () => {
tempDisplayName = data.displayName
tempDescription = data.description
@ -92,7 +88,12 @@
{#if data.custom}
<div class="buttons">
<Icon size="S" name="Edit" hoverable on:click={openPopover} />
<Icon size="S" name="Delete" hoverable on:click={deleteNode} />
<Icon
size="S"
name="Delete"
hoverable
on:click={() => deleteRole(id)}
/>
</div>
{/if}
</div>