This commit is contained in:
Martin McKeaveney 2020-10-05 14:43:34 +01:00
parent 3a460429a0
commit c3a5d964bc
4 changed files with 10 additions and 10 deletions

View File

@ -69,7 +69,7 @@
<span>{$backendUiStore.selectedModel.name}</span> <span>{$backendUiStore.selectedModel.name}</span>
{#if loading} {#if loading}
<div transition:fade> <div transition:fade>
<Spinner size="15" /> <Spinner size="10" />
</div> </div>
{/if} {/if}
</h2> </h2>

View File

@ -4,14 +4,15 @@
import { notifier } from "builderStore/store/notifications" import { notifier } from "builderStore/store/notifications"
import Spinner from "components/common/Spinner.svelte" import Spinner from "components/common/Spinner.svelte"
import { import {
Body,
DropdownMenu, DropdownMenu,
Button, Button,
Label,
Heading, Heading,
Icon, Icon,
Input, Input,
Select, Select,
Dropzone, Dropzone,
Spacer,
} from "@budibase/bbui" } from "@budibase/bbui"
import TableDataImport from "./TableDataImport.svelte" import TableDataImport from "./TableDataImport.svelte"
import api from "builderStore/api" import api from "builderStore/api"
@ -50,14 +51,14 @@
<DropdownMenu bind:this={dropdown} {anchor} align="left"> <DropdownMenu bind:this={dropdown} {anchor} align="left">
<div class="container"> <div class="container">
<h5>Create Table</h5> <h5>Create Table</h5>
<Body grey small>Table Name</Body> <Label grey extraSmall>Name</Label>
<Input <Input
data-cy="table-name-input" data-cy="table-name-input"
placeholder="Table Name" placeholder="Table Name"
thin thin
bind:value={name} /> bind:value={name} />
<Spacer medium />
<Body grey small>Create Table from CSV (Optional)</Body> <Label grey extraSmall>Create Table from CSV (Optional)</Label>
<TableDataImport bind:dataImport /> <TableDataImport bind:dataImport />
</div> </div>
<footer> <footer>
@ -66,7 +67,7 @@
</div> </div>
<div class="button-margin-4"> <div class="button-margin-4">
<Button <Button
disabled={!name || !dataImport.valid} disabled={!name || (dataImport && !dataImport.valid)}
primary primary
on:click={saveTable}> on:click={saveTable}>
<span>Save</span> <span>Save</span>

View File

@ -18,7 +18,7 @@
$: schema = parseResult && parseResult.schema $: schema = parseResult && parseResult.schema
$: valid = $: valid =
schema && Object.keys(schema).every(column => schema[column].success) !schema || Object.keys(schema).every(column => schema[column].success)
$: dataImport = { $: dataImport = {
valid, valid,
schema: buildModelSchema(schema), schema: buildModelSchema(schema),
@ -149,7 +149,7 @@
label { label {
font-family: var(--font-sans); font-family: var(--font-sans);
cursor: pointer; cursor: pointer;
font-weight: 600; font-weight: 500;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
border-radius: var(--border-radius-s); border-radius: var(--border-radius-s);
@ -166,7 +166,6 @@
flex-shrink: 0; flex-shrink: 0;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 10px;
width: 100%; width: 100%;
background-color: var(--grey-2); background-color: var(--grey-2);
} }

View File

@ -11,7 +11,7 @@ const PARSERS = {
} }
function parse(path, parsers) { function parse(path, parsers) {
const result = csv({ parsers }).fromFile(path) const result = csv().fromFile(path)
const schema = {} const schema = {}