Allow deleting apps without being a global builder

This commit is contained in:
Andrew Kingston 2023-11-23 17:34:06 +00:00
parent d217053e87
commit 8f47eab2b6
1 changed files with 16 additions and 20 deletions

View File

@ -4,8 +4,6 @@
import { url, isActive } from "@roxi/routify" import { url, isActive } from "@roxi/routify"
import DeleteModal from "components/deploy/DeleteModal.svelte" import DeleteModal from "components/deploy/DeleteModal.svelte"
import { isOnlyUser } from "builderStore" import { isOnlyUser } from "builderStore"
import { auth } from "stores/portal"
import { sdk } from "@budibase/shared-core"
let deleteModal let deleteModal
</script> </script>
@ -46,24 +44,22 @@
url={$url("./version")} url={$url("./version")}
active={$isActive("./version")} active={$isActive("./version")}
/> />
{#if sdk.users.isGlobalBuilder($auth.user)} <div class="delete-action">
<div class="delete-action"> <AbsTooltip
<AbsTooltip position={TooltipPosition.Bottom}
position={TooltipPosition.Bottom} text={$isOnlyUser
text={$isOnlyUser ? null
? null : "Unavailable - another user is editing this app"}
: "Unavailable - another user is editing this app"} >
> <SideNavItem
<SideNavItem text="Delete app"
text="Delete app" disabled={!$isOnlyUser}
disabled={!$isOnlyUser} on:click={() => {
on:click={() => { deleteModal.show()
deleteModal.show() }}
}} />
/> </AbsTooltip>
</AbsTooltip> </div>
</div>
{/if}
</SideNav> </SideNav>
<slot /> <slot />
</Content> </Content>