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>
{#if loading}
<div transition:fade>
<Spinner size="15" />
<Spinner size="10" />
</div>
{/if}
</h2>

View File

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

View File

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

View File

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