Fix editor

This commit is contained in:
Keviin Åberg Kultalahti 2021-04-28 15:46:11 +02:00
parent 0be7cb55b2
commit c1af7a7d93
2 changed files with 29 additions and 28 deletions

View File

@ -166,6 +166,7 @@
{#if label}
<Label small>{label}</Label>
<Spacer medium />
{/if}
<div style={`--code-mirror-height: ${editorHeight}px`}>
<textarea tabindex="0" bind:this={refs.editor} readonly {value} />

View File

@ -4,6 +4,7 @@
Icon,
Select,
Button,
ButtonGroup,
Body,
Label,
Layout,
@ -149,22 +150,19 @@
</div>
<div class="viewer-controls">
<Heading s>Results</Heading>
<div class="button-container">
<ButtonGroup>
<Button
secondary
thin
cta
disabled={data.length === 0 || !query.name}
on:click={saveQuery}
>
Save Query
</Button>
<Spacer medium />
<Button thin secondary on:click={previewQuery}>Run Query</Button>
</div>
<Button secondary on:click={previewQuery}>Run Query</Button>
</ButtonGroup>
</div>
<Body s>
Below, you can preview the results from your query and change the
schema.
Below, you can preview the results from your query and change the schema.
</Body>
<section class="viewer">
{#if data}
@ -181,16 +179,18 @@
</pre>
</Tab>
<Tab title="Schema">
<Layout gap="S">
{#each fields as field, idx}
<Spacer small />
<div class="field">
<Input placeholder="Field Name" bind:value={field.name} />
<Select bind:value={field.type} options={typeOptions} />
<Icon name="bleClose" on:click={() => deleteField(idx)} />
</div>
{/each}
<Spacer extraLarge />
<Button thin secondary on:click={newField}>Add Field</Button>
<div>
<Button secondary on:click={newField}>Add Field</Button>
</div>
</Layout>
</Tab>
<Tab title="Preview">
<ExternalDataSourceTable {query} {data} />