Rename backend components file structure and standardise no table empty state

This commit is contained in:
Andrew Kingston 2020-09-25 13:11:57 +01:00
parent 6320a85bc2
commit ab1ddd8006
31 changed files with 42 additions and 59 deletions

View File

@ -52,7 +52,7 @@
} }
</script> </script>
<div class="container"> <div class="actions">
<Input placeholder="Name" thin bind:value={field.name} /> <Input placeholder="Name" thin bind:value={field.name} />
<Select <Select
@ -110,7 +110,7 @@
</div> </div>
<style> <style>
.container { .actions {
padding: var(--spacing-xl); padding: var(--spacing-xl);
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);

View File

@ -40,7 +40,7 @@
} }
</script> </script>
<div class="container"> <div class="actions">
<ErrorsBox {errors} /> <ErrorsBox {errors} />
<form on:submit|preventDefault> <form on:submit|preventDefault>
{#each modelSchema as [key, meta]} {#each modelSchema as [key, meta]}
@ -63,7 +63,7 @@
</div> </div>
<style> <style>
.container { .actions {
padding: var(--spacing-xl); padding: var(--spacing-xl);
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);

View File

@ -46,7 +46,7 @@
</TextButton> </TextButton>
</div> </div>
<Popover bind:this={dropdown} {anchor} align="left"> <Popover bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="actions">
<h5>Calculate</h5> <h5>Calculate</h5>
<div class="input-group-row"> <div class="input-group-row">
<p>The</p> <p>The</p>
@ -72,7 +72,7 @@
</Popover> </Popover>
<style> <style>
.container { .actions {
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);
} }

View File

@ -95,7 +95,7 @@
</TextButton> </TextButton>
</div> </div>
<Popover bind:this={dropdown} {anchor} align="left"> <Popover bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="actions">
<h5>Filter</h5> <h5>Filter</h5>
{#if view.filters.length} {#if view.filters.length}
<div class="input-group-row"> <div class="input-group-row">
@ -150,7 +150,7 @@
</Popover> </Popover>
<style> <style>
.container { .actions {
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);
} }

View File

@ -42,7 +42,7 @@
</TextButton> </TextButton>
</div> </div>
<Popover bind:this={dropdown} {anchor} align="left"> <Popover bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="actions">
<h5>Group By</h5> <h5>Group By</h5>
<div class="input-group-row"> <div class="input-group-row">
<p>Group By</p> <p>Group By</p>
@ -61,7 +61,7 @@
</Popover> </Popover>
<style> <style>
.container { .actions {
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);
} }

View File

@ -48,7 +48,7 @@
</TextButton> </TextButton>
</div> </div>
<Popover bind:this={dropdown} {anchor} align="left"> <Popover bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="actions">
<h5>Create View</h5> <h5>Create View</h5>
<Input placeholder="View Name" thin bind:value={name} /> <Input placeholder="View Name" thin bind:value={name} />
<div class="footer"> <div class="footer">
@ -64,7 +64,7 @@
font-weight: 500; font-weight: 500;
} }
.container { .actions {
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);
} }

View File

@ -31,7 +31,7 @@
<Button primary wide on:click={dropdown.show}>Create New Table</Button> <Button primary wide on:click={dropdown.show}>Create New Table</Button>
</div> </div>
<DropdownMenu bind:this={dropdown} {anchor} align="left"> <DropdownMenu bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="actions">
<h5>Create Table</h5> <h5>Create Table</h5>
<Input <Input
data-cy="table-name-input" data-cy="table-name-input"
@ -46,7 +46,7 @@
</DropdownMenu> </DropdownMenu>
<style> <style>
.container { .actions {
padding: var(--spacing-xl); padding: var(--spacing-xl);
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);

View File

@ -40,7 +40,7 @@
</div> </div>
<DropdownMenu align="left" {anchor} bind:this={dropdown}> <DropdownMenu align="left" {anchor} bind:this={dropdown}>
{#if editing} {#if editing}
<div class="container"> <div class="actions">
<h5>Edit Table</h5> <h5>Edit Table</h5>
<Input placeholder="Table Name" thin bind:value={table.name} /> <Input placeholder="Table Name" thin bind:value={table.name} />
<footer> <footer>
@ -80,7 +80,7 @@
font-size: 16px; font-size: 16px;
} }
.container { .actions {
padding: var(--spacing-xl); padding: var(--spacing-xl);
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);

View File

@ -48,7 +48,7 @@
</div> </div>
<DropdownMenu align="left" {anchor} bind:this={dropdown}> <DropdownMenu align="left" {anchor} bind:this={dropdown}>
{#if editing} {#if editing}
<div class="container"> <div class="actions">
<h5>Edit View</h5> <h5>Edit View</h5>
<Input placeholder="View Name" thin bind:value={view.name} /> <Input placeholder="View Name" thin bind:value={view.name} />
<footer> <footer>
@ -88,7 +88,7 @@
font-size: 16px; font-size: 16px;
} }
.container { .actions {
padding: var(--spacing-xl); padding: var(--spacing-xl);
display: grid; display: grid;
grid-gap: var(--spacing-xl); grid-gap: var(--spacing-xl);

View File

@ -30,7 +30,7 @@
{#if $backendUiStore.selectedDatabase && $backendUiStore.selectedDatabase._id} {#if $backendUiStore.selectedDatabase && $backendUiStore.selectedDatabase._id}
<div class="hierarchy"> <div class="hierarchy">
<div class="components-list-container"> <div class="components-list-container">
<div class="title">Tables</div> <h5>Tables</h5>
<CreateTablePopover /> <CreateTablePopover />
<div class="hierarchy-items-container"> <div class="hierarchy-items-container">
{#each $backendUiStore.models as model} {#each $backendUiStore.models as model}
@ -63,9 +63,10 @@
</div> </div>
<style> <style>
.title { h5 {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
margin-top: 0;
margin-bottom: var(--spacing-xl); margin-bottom: var(--spacing-xl);
} }

View File

@ -1,20 +0,0 @@
<script>
import { isActive, url, goto } from "@sveltech/routify"
export let label = ""
export let href
</script>
<div
on:click={() => $goto(href)}
class="budibase__nav-item backend-nav-item"
class:selected={$isActive(href)}>
{label}
</div>
<style>
.backend-nav-item {
padding-left: 25px;
cursor: pointer;
}
</style>

View File

@ -1,8 +1,8 @@
<script> <script>
import { getContext } from "svelte" import { getContext } from "svelte"
import { store, backendUiStore } from "builderStore" import { store, backendUiStore } from "builderStore"
import * as api from "components/database/DataTable/api" import * as api from "components/backend/DataTable/api"
import ModelNavigator from "components/nav/ModelNavigator/ModelNavigator.svelte" import ModelNavigator from "components/backend/ModelNavigator/ModelNavigator.svelte"
</script> </script>
<!-- routify:options index=1 --> <!-- routify:options index=1 -->

View File

@ -1,11 +1,11 @@
<script> <script>
import { getContext } from "svelte" import { getContext } from "svelte"
import { Button } from "@budibase/bbui" import { Button } from "@budibase/bbui"
import ModelDataTable from "components/database/DataTable" import ModelDataTable from "components/backend/DataTable"
import { backendUiStore } from "builderStore" import { backendUiStore } from "builderStore"
import ActionButton from "components/common/ActionButton.svelte" import ActionButton from "components/common/ActionButton.svelte"
import * as api from "components/database/DataTable/api" import * as api from "components/backend/DataTable/api"
import { CreateEditRecordModal } from "components/database/DataTable/modals" import { CreateEditRecordModal } from "components/backend/DataTable/modals"
const { open, close } = getContext("simple-modal") const { open, close } = getContext("simple-modal")
@ -15,12 +15,13 @@
{#if $backendUiStore.selectedDatabase._id && selectedModel.name} {#if $backendUiStore.selectedDatabase._id && selectedModel.name}
<ModelDataTable /> <ModelDataTable />
{:else} {:else}
<i style="color: var(--grey-4)">create your first table to start building</i> <i>Create your first table to start building</i>
{/if} {/if}
<style> <style>
i { i {
font-size: 20px; font-size: 20px;
margin-right: 10px; padding-bottom: 10px;
color: var(--grey-4);
} }
</style> </style>

View File

@ -21,9 +21,7 @@
</script> </script>
<div class="root"> <div class="root">
<div class="node-view">
<slot /> <slot />
</div>
</div> </div>
<style> <style>
@ -31,9 +29,4 @@
height: 100%; height: 100%;
position: relative; position: relative;
} }
.node-view {
overflow-y: auto;
flex: 1 1 auto;
}
</style> </style>

View File

@ -22,5 +22,13 @@
</script> </script>
{#if $backendUiStore.models.length === 0} {#if $backendUiStore.models.length === 0}
Please create a table <i>Create your first table to start building</i>
{:else}Please select a table{/if} {:else}Please select a table{/if}
<style>
i {
font-size: 20px;
padding-bottom: 10px;
color: var(--grey-4);
}
</style>

View File

@ -1,11 +1,11 @@
<script> <script>
import { getContext } from "svelte" import { getContext } from "svelte"
import { Button } from "@budibase/bbui" import { Button } from "@budibase/bbui"
import ViewDataTable from "components/database/DataTable/ViewDataTable" import ViewDataTable from "components/backend/DataTable/ViewDataTable"
import { backendUiStore } from "builderStore" import { backendUiStore } from "builderStore"
import ActionButton from "components/common/ActionButton.svelte" import ActionButton from "components/common/ActionButton.svelte"
import * as api from "components/database/DataTable/api" import * as api from "components/backend/DataTable/api"
import { CreateEditRecordModal } from "components/database/DataTable/modals" import { CreateEditRecordModal } from "components/backend/DataTable/modals"
const { open, close } = getContext("simple-modal") const { open, close } = getContext("simple-modal")