prevent editing of headers in params
This commit is contained in:
parent
40e7fbd8ab
commit
50eabc82d0
|
@ -109,6 +109,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="drawer-contents" slot="body">
|
<div class="drawer-contents" slot="body">
|
||||||
<IntegrationQueryEditor
|
<IntegrationQueryEditor
|
||||||
|
datasource={$backendUiStore.datasources.find(ds => ds._id === value.datasourceId)}
|
||||||
query={value}
|
query={value}
|
||||||
schema={fetchDatasourceSchema(value)}
|
schema={fetchDatasourceSchema(value)}
|
||||||
editable={false} />
|
editable={false} />
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
import { Button, Input } from "@budibase/bbui"
|
import { Button, Input } from "@budibase/bbui"
|
||||||
|
|
||||||
export let object = {}
|
export let object = {}
|
||||||
|
export let readOnly
|
||||||
|
|
||||||
let fields = Object.entries(object).map(([name, value]) => ({ name, value }))
|
let fields = Object.entries(object).map(([name, value]) => ({ name, value }))
|
||||||
|
|
||||||
|
@ -21,14 +22,18 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Builds Objects with Key Value Pairs. Useful for building things like Request Headers. -->
|
<!-- Builds Objects with Key Value Pairs. Useful for building things like Request Headers. -->
|
||||||
<div class="container">
|
<div class="container" class:readOnly>
|
||||||
{#each fields as field, idx}
|
{#each fields as field, idx}
|
||||||
<Input placeholder="Key" thin outline bind:value={field.name} />
|
<Input placeholder="Key" thin outline bind:value={field.name} />
|
||||||
<Input placeholder="Value" thin outline bind:value={field.value} />
|
<Input placeholder="Value" thin outline bind:value={field.value} />
|
||||||
<i class="ri-close-circle-fill" on:click={() => deleteEntry(idx)} />
|
{#if !readOnly}
|
||||||
|
<i class="ri-close-circle-fill" on:click={() => deleteEntry(idx)} />
|
||||||
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
<Button secondary thin outline on:click={addEntry}>Add</Button>
|
{#if !readOnly}
|
||||||
|
<Button secondary thin outline on:click={addEntry}>Add</Button>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.container {
|
.container {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import CodeMirror from "./codemirror"
|
import CodeMirror from "./codemirror"
|
||||||
|
import { Label, Spacer } from "@budibase/bbui"
|
||||||
import { onMount, createEventDispatcher } from "svelte"
|
import { onMount, createEventDispatcher } from "svelte"
|
||||||
import { themeStore } from "builderStore"
|
import { themeStore } from "builderStore"
|
||||||
import { handlebarsCompletions } from "constants/completions"
|
import { handlebarsCompletions } from "constants/completions"
|
||||||
|
@ -11,6 +12,7 @@
|
||||||
LIGHT: "default",
|
LIGHT: "default",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export let label
|
||||||
export let value = ""
|
export let value = ""
|
||||||
export let readOnly = false
|
export let readOnly = false
|
||||||
export let lineNumbers = true
|
export let lineNumbers = true
|
||||||
|
@ -169,6 +171,8 @@
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<Label small>{label}</Label>
|
||||||
|
<Spacer medium />
|
||||||
<textarea tabindex="0" bind:this={refs.editor} readonly {value} />
|
<textarea tabindex="0" bind:this={refs.editor} readonly {value} />
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<div>
|
<div>
|
||||||
<Label small>{field}</Label>
|
<Label small>{field}</Label>
|
||||||
<Spacer small />
|
<Spacer small />
|
||||||
<KeyValueBuilder bind:object={fields[field]} />
|
<KeyValueBuilder readOnly={!editable} bind:object={fields[field]} />
|
||||||
</div>
|
</div>
|
||||||
{:else if schema.fields[field]?.type === 'json'}
|
{:else if schema.fields[field]?.type === 'json'}
|
||||||
<div>
|
<div>
|
||||||
|
@ -59,8 +59,6 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{#if schema.customisable}
|
{#if schema.customisable}
|
||||||
<Label small>Query</Label>
|
|
||||||
<Spacer small />
|
|
||||||
<Editor
|
<Editor
|
||||||
label="Query"
|
label="Query"
|
||||||
mode="json"
|
mode="json"
|
||||||
|
|
|
@ -156,30 +156,7 @@
|
||||||
<ParameterBuilder bind:parameters={query.parameters} bindable={false} />
|
<ParameterBuilder bind:parameters={query.parameters} bindable={false} />
|
||||||
<hr />
|
<hr />
|
||||||
{/if}
|
{/if}
|
||||||
<!-- <div class="input">
|
|
||||||
<div class="label">Enter query name:</div>
|
|
||||||
<Input outline border bind:value={query.name} />
|
|
||||||
</div> -->
|
|
||||||
<!-- {#if config} -->
|
|
||||||
<!-- <div class="props"> -->
|
|
||||||
<!-- <div class="query-type">
|
|
||||||
Query type:
|
|
||||||
<span class="query-type-span">{config[query.queryVerb].type}</span>
|
|
||||||
</div> -->
|
|
||||||
<!-- <div class="select">
|
|
||||||
<Select primary thin bind:value={query.queryVerb}>
|
|
||||||
{#each Object.keys(config) as queryVerb}
|
|
||||||
<option value={queryVerb}>{queryVerb}</option>
|
|
||||||
{/each}
|
|
||||||
</Select>
|
|
||||||
</div> -->
|
|
||||||
<!-- </div>
|
|
||||||
<EditQueryParamsPopover
|
|
||||||
bind:parameters={query.parameters}
|
|
||||||
bindable={false} /> -->
|
|
||||||
<!-- {/if} -->
|
|
||||||
</section>
|
</section>
|
||||||
<Spacer large />
|
|
||||||
|
|
||||||
{#if shouldShowQueryConfig}
|
{#if shouldShowQueryConfig}
|
||||||
<section>
|
<section>
|
||||||
|
@ -196,7 +173,7 @@
|
||||||
|
|
||||||
<div class="viewer-controls">
|
<div class="viewer-controls">
|
||||||
<Heading small>Query Results</Heading>
|
<Heading small>Query Results</Heading>
|
||||||
<div>
|
<div class="button-container">
|
||||||
<Button
|
<Button
|
||||||
secondary
|
secondary
|
||||||
thin
|
thin
|
||||||
|
@ -204,7 +181,8 @@
|
||||||
on:click={saveQuery}>
|
on:click={saveQuery}>
|
||||||
Save Query
|
Save Query
|
||||||
</Button>
|
</Button>
|
||||||
<Button thin primary on:click={previewQuery}>Run Query</Button>
|
<Spacer medium />
|
||||||
|
<Button thin primary on:click={previewQuery}>Run Query</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Body small grey>
|
<Body small grey>
|
||||||
|
@ -212,7 +190,7 @@
|
||||||
schema.
|
schema.
|
||||||
</Body>
|
</Body>
|
||||||
|
|
||||||
<Spacer medium />
|
<Spacer large />
|
||||||
|
|
||||||
<section class="viewer">
|
<section class="viewer">
|
||||||
{#if data}
|
{#if data}
|
||||||
|
@ -274,8 +252,8 @@
|
||||||
gap: var(--spacing-l);
|
gap: var(--spacing-l);
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
.button-container {
|
||||||
font-size: var(--font-size-s);
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
|
|
|
@ -60,10 +60,4 @@
|
||||||
grid-gap: var(--spacing-l);
|
grid-gap: var(--spacing-l);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
pre {
|
|
||||||
background: var(--background);
|
|
||||||
border-radius: var(--border-radius-s);
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -27,9 +27,10 @@
|
||||||
<div class="nav">
|
<div class="nav">
|
||||||
<Switcher headings={tabs} bind:value={tab}>
|
<Switcher headings={tabs} bind:value={tab}>
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<Button blue data-cy={`new-${tab}`} on:click={modal.show}>
|
<i
|
||||||
<i class="ri-add-fill" />
|
data-cy={`new-${tab}`}
|
||||||
</Button>
|
class="ri-add-circle-fill"
|
||||||
|
on:click={modal.show} />
|
||||||
</div>
|
</div>
|
||||||
{#if tab === 'table'}
|
{#if tab === 'table'}
|
||||||
<TableNavigator />
|
<TableNavigator />
|
||||||
|
@ -81,7 +82,7 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
i {
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: var(--spacing-l);
|
top: var(--spacing-l);
|
||||||
|
|
Loading…
Reference in New Issue