Add scaffolding for new role editor modal

This commit is contained in:
Andrew Kingston 2024-09-10 09:11:52 +01:00
parent eb20686de8
commit 9da84b19f9
No known key found for this signature in database
3 changed files with 46 additions and 11 deletions

View File

@ -5,11 +5,9 @@
let modal let modal
</script> </script>
<div>
<Button secondary icon="UsersLock" on:click on:click={modal.show}> <Button secondary icon="UsersLock" on:click on:click={modal.show}>
Edit roles Edit roles
</Button> </Button>
</div>
<Modal bind:this={modal} on:show on:hide> <Modal bind:this={modal} on:show on:hide>
<EditRolesModal /> <EditRolesModal />
</Modal> </Modal>

View File

@ -1,8 +1,6 @@
<script> <script>
import { import {
ActionButton, ActionButton,
Icon,
Body,
Input, Input,
Select, Select,
Label, Label,
@ -17,6 +15,7 @@
import { capitalise } from "helpers" import { capitalise } from "helpers"
import InfoDisplay from "pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/InfoDisplay.svelte" import InfoDisplay from "pages/builder/app/[application]/design/[screenId]/[componentId]/_components/Component/InfoDisplay.svelte"
import { Roles } from "constants/backend" import { Roles } from "constants/backend"
import RoleEditor from "./RoleEditor.svelte"
export let resourceId export let resourceId
@ -193,10 +192,16 @@
<InfoDisplay info body={dependantsInfoMessage} /> <InfoDisplay info body={dependantsInfoMessage} />
{/if} {/if}
<div class="buttons">
<EditRolesButton <EditRolesButton
on:show={() => (showPopover = false)} on:show={() => (showPopover = false)}
on:hide={() => (showPopover = true)} on:hide={() => (showPopover = true)}
/> />
<RoleEditor
on:drawerShow={() => (showPopover = false)}
on:drawerHide={() => (showPopover = true)}
/>
</div>
</DetailPopover> </DetailPopover>
<style> <style>

View File

@ -0,0 +1,32 @@
<script>
import {
Button,
Modal,
ModalContent,
Drawer,
DrawerContent,
} from "@budibase/bbui"
let drawer
$: invalid = false
const save = async () => {
drawer.hide()
}
</script>
<Button secondary icon="UsersLock" on:click on:click={drawer.show}>
Role editor
</Button>
<Drawer
bind:this={drawer}
title="Role editor"
on:drawerHide
on:drawerShow
forceModal
>
<Button disabled={invalid} cta slot="buttons" on:click={save}>Save</Button>
<DrawerContent slot="body">asdasdasd</DrawerContent>
</Drawer>