actions fix

This commit is contained in:
Martin McKeaveney 2021-01-27 17:29:30 +00:00
parent ed5d0f4e53
commit 1939c1e000
10 changed files with 113 additions and 100 deletions

View File

@ -20,10 +20,7 @@
</script> </script>
<div on:click|stopPropagation bind:this={anchor}> <div on:click|stopPropagation bind:this={anchor}>
<TextButton <TextButton text on:click={dropdown.show} active={false}>
text
on:click={dropdown.show}
active={false}>
<Icon name="add" /> <Icon name="add" />
Add Parameters Add Parameters
</TextButton> </TextButton>

View File

@ -1,6 +1,6 @@
<script> <script>
import { notificationStore } from "builderStore/store/notifications" import { notificationStore } from "builderStore/store/notifications"
import { flip } from 'svelte/animate'; import { flip } from "svelte/animate"
import { fly } from "svelte/transition" import { fly } from "svelte/transition"
export let themes = { export let themes = {

View File

@ -33,6 +33,9 @@
parameters: {}, parameters: {},
[EVENT_TYPE_KEY]: actionType.name, [EVENT_TYPE_KEY]: actionType.name,
} }
if (!actions) {
actions = []
}
actions.push(newAction) actions.push(newAction)
selectedAction = newAction selectedAction = newAction
actions = actions actions = actions
@ -73,7 +76,8 @@
<div class="action-container"> <div class="action-container">
<div class="action-header" on:click={selectAction(action)}> <div class="action-header" on:click={selectAction(action)}>
<span class:selected={action === selectedAction}> <span class:selected={action === selectedAction}>
{index + 1}. {action[EVENT_TYPE_KEY]} {index + 1}.
{action[EVENT_TYPE_KEY]}
</span> </span>
</div> </div>
<i <i

View File

@ -34,7 +34,9 @@
})) }))
return [...acc, ...viewsArr] return [...acc, ...viewsArr]
}, []) }, [])
$: queries = $backendUiStore.queries.filter(query => query.queryVerb === "read").map(query => ({ $: queries = $backendUiStore.queries
.filter(query => query.queryVerb === "read")
.map(query => ({
label: query.name, label: query.name,
name: query.name, name: query.name,
tableId: query._id, tableId: query._id,

View File

@ -136,7 +136,10 @@
</div> </div>
{#if config} {#if config}
<div class="props"> <div class="props">
<div class="query-type">Query type: <span class="query-type-span">{config[query.queryVerb].type}</span></div> <div class="query-type">
Query type:
<span class="query-type-span">{config[query.queryVerb].type}</span>
</div>
<div class="select"> <div class="select">
<Select primary thin bind:value={query.queryVerb}> <Select primary thin bind:value={query.queryVerb}>
{#each Object.keys(config) as queryVerb} {#each Object.keys(config) as queryVerb}
@ -145,7 +148,9 @@
</Select> </Select>
</div> </div>
</div> </div>
<EditQueryParamsPopover bind:parameters={query.parameters} bindable={false} /> <EditQueryParamsPopover
bind:parameters={query.parameters}
bindable={false} />
{/if} {/if}
</header> </header>
<Spacer extraLarge /> <Spacer extraLarge />
@ -182,7 +187,11 @@
{#each fields as field, idx} {#each fields as field, idx}
<Spacer small /> <Spacer small />
<div class="field"> <div class="field">
<Input outline placeholder="Field Name" type={'text'} bind:value={field.name} /> <Input
outline
placeholder="Field Name"
type={'text'}
bind:value={field.name} />
<Select thin border bind:value={field.type}> <Select thin border bind:value={field.type}>
<option value={''}>Select a field type</option> <option value={''}>Select a field type</option>
<option value={'STRING'}>Text</option> <option value={'STRING'}>Text</option>
@ -206,7 +215,6 @@
{/if} {/if}
<style> <style>
.input { .input {
width: 300px; width: 300px;
} }

View File

@ -20,7 +20,6 @@
} }
</script> </script>
{#if schema} {#if schema}
{#key query._id} {#key query._id}
{#if schema.type === QueryTypes.SQL} {#if schema.type === QueryTypes.SQL}

View File

@ -58,7 +58,6 @@
</div> </div>
</div> </div>
</section> </section>
{/if} {/if}
<style> <style>

View File

@ -2,9 +2,14 @@
import { writable } from "svelte/store" import { writable } from "svelte/store"
import { setContext, onMount } from "svelte" import { setContext, onMount } from "svelte"
import Component from "./Component.svelte" import Component from "./Component.svelte"
import NotificationDisplay from './NotificationDisplay.svelte' import NotificationDisplay from "./NotificationDisplay.svelte"
import SDK from "../sdk" import SDK from "../sdk"
import { createDataStore, initialise, screenStore, notificationStore } from "../store" import {
createDataStore,
initialise,
screenStore,
notificationStore,
} from "../store"
// Provide contexts // Provide contexts
setContext("sdk", SDK) setContext("sdk", SDK)

View File

@ -1,5 +1,5 @@
<script> <script>
import { flip } from 'svelte/animate'; import { flip } from "svelte/animate"
import { fly } from "svelte/transition" import { fly } from "svelte/transition"
import { getContext } from "svelte" import { getContext } from "svelte"
const { notifications } = getContext("sdk") const { notifications } = getContext("sdk")
@ -57,4 +57,3 @@
font-weight: 500; font-weight: 500;
} }
</style> </style>