Convert EventPanel to Layout component

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-28 15:04:30 +02:00
parent a1220cf048
commit 02c7ec71c5
4 changed files with 48 additions and 79 deletions

View File

@ -4,7 +4,6 @@
Label, Label,
Input, Input,
Select, Select,
Spacer,
notifications, notifications,
Body, Body,
ModalContent, ModalContent,
@ -39,10 +38,11 @@
<Input value={capitalise(level)} disabled /> <Input value={capitalise(level)} disabled />
<Select <Select
value={permissions[level]} value={permissions[level]}
on:change={e => changePermission(level, e.detail)} on:change={(e) => changePermission(level, e.detail)}
options={$roles} options={$roles}
getOptionLabel={x => x.name} getOptionLabel={(x) => x.name}
getOptionValue={x => x._id} /> getOptionValue={(x) => x._id}
/>
{/each} {/each}
</div> </div>
</ModalContent> </ModalContent>

View File

@ -5,8 +5,6 @@
Popover, Popover,
Divider, Divider,
Select, Select,
Layout,
Spacer,
Heading, Heading,
Drawer, Drawer,
} from "@budibase/bbui" } from "@budibase/bbui"

View File

@ -1,7 +1,7 @@
<script> <script>
import { flip } from "svelte/animate" import { flip } from "svelte/animate"
import { dndzone } from "svelte-dnd-action" import { dndzone } from "svelte-dnd-action"
import { Icon, Button, Popover, Spacer, DrawerContent } from "@budibase/bbui" import { Icon, Button, Popover, Layout, DrawerContent } from "@budibase/bbui"
import actionTypes from "./actions" import actionTypes from "./actions"
import { generate } from "shortid" import { generate } from "shortid"
@ -70,12 +70,11 @@
<DrawerContent> <DrawerContent>
<div class="actions-list" slot="sidebar"> <div class="actions-list" slot="sidebar">
<div> <Layout>
<div bind:this={addActionButton}> <div bind:this={addActionButton}>
<Button wide secondary on:click={addActionDropdown.show}> <Button wide secondary on:click={addActionDropdown.show}>
Add Action Add Action
</Button> </Button>
<Spacer small />
</div> </div>
<Popover <Popover
bind:this={addActionDropdown} bind:this={addActionDropdown}
@ -90,7 +89,6 @@
{/each} {/each}
</div> </div>
</Popover> </Popover>
</div>
{#if actions && actions.length > 0} {#if actions && actions.length > 0}
<div <div
@ -126,9 +124,9 @@
{/each} {/each}
</div> </div>
{/if} {/if}
</Layout>
</div> </div>
<div class="actions-container"> <Layout>
<div class="action-config">
{#if selectedAction} {#if selectedAction}
<div class="selected-action-container"> <div class="selected-action-container">
<svelte:component <svelte:component
@ -137,8 +135,7 @@
/> />
</div> </div>
{/if} {/if}
</div> </Layout>
</div>
</DrawerContent> </DrawerContent>
<style> <style>
@ -146,7 +143,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
margin-top: var(--spacing-m); margin-top: var(--spacing-s);
} }
.action-header { .action-header {
@ -162,11 +159,6 @@
color: var(--ink); color: var(--ink);
} }
.actions-list {
border-right: var(--border-light);
padding: var(--spacing-l);
}
.available-action { .available-action {
padding: var(--spacing-s); padding: var(--spacing-s);
font-size: var(--font-size-xs); font-size: var(--font-size-xs);
@ -177,16 +169,6 @@
background: var(--grey-2); background: var(--grey-2);
} }
.actions-container {
height: 40vh;
display: grid;
grid-template-columns: 260px 1fr;
grid-auto-flow: column;
min-height: 0;
padding-top: 0;
overflow-y: auto;
}
.action-container { .action-container {
border-bottom: 1px solid var(--grey-1); border-bottom: 1px solid var(--grey-1);
display: flex; display: flex;
@ -196,10 +178,6 @@
border-bottom: none; border-bottom: none;
} }
.selected-action-container {
padding: var(--spacing-l);
}
i:hover { i:hover {
color: var(--red); color: var(--red);
cursor: pointer; cursor: pointer;

View File

@ -1,12 +1,5 @@
<script> <script>
import { import { Button, Drawer, Body, DrawerContent, Layout } from "@budibase/bbui"
Button,
Drawer,
Spacer,
Body,
DrawerContent,
Layout,
} from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { notifications } from "@budibase/bbui" import { notifications } from "@budibase/bbui"
import { import {