This commit is contained in:
Martin McKeaveney 2022-09-18 13:30:16 +01:00
commit 915405275d
16 changed files with 204 additions and 103 deletions

View File

@ -1,5 +1,5 @@
{
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -20,7 +20,7 @@
"test:watch": "jest --watchAll"
},
"dependencies": {
"@budibase/types": "1.3.21-alpha.2",
"@budibase/types": "^1.3.21",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/string-templates": "^1.3.21",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -71,10 +71,10 @@
}
},
"dependencies": {
"@budibase/bbui": "1.3.21-alpha.2",
"@budibase/client": "1.3.21-alpha.2",
"@budibase/frontend-core": "1.3.21-alpha.2",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/bbui": "^1.3.21",
"@budibase/client": "^1.3.21",
"@budibase/frontend-core": "^1.3.21",
"@budibase/string-templates": "^1.3.21",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -1,20 +1,31 @@
<script>
import { Body, Button, Heading, Layout } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builderStore/dataBinding"
import { Body, Button, Heading, Icon, Input, Layout } from "@budibase/bbui"
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builderStore/dataBinding"
import DrawerBindableInput from "components/common/bindings/DrawerBindableInput.svelte"
export let bindable = true
export let queryBindings = []
const userBindings = getUserBindings()
let internalBindings = queryBindings.reduce((acc, binding) => {
acc[binding.name] = binding.default
return acc
}, {})
export let bindings = []
export let customParams = {}
function newQueryBinding() {
queryBindings = [...queryBindings, {}]
}
function deleteQueryBinding(idx) {
queryBindings.splice(idx, 1)
queryBindings = queryBindings
}
// This is necessary due to the way readable and writable bindings are stored.
// The readable binding in the UI gets converted to a UUID value that the client understands
// for parsing, then converted back so we can display it the readable form in the UI
function onBindingChange(param, valueToParse) {
customParams[param] = readableToRuntimeBinding(bindings, valueToParse)
}
</script>
<Layout noPadding={bindable} gap="S">
@ -35,34 +46,57 @@
{/if}
</Body>
<div class="bindings" class:bindable>
<KeyValueBuilder
bind:object={internalBindings}
tooltip="Set the name of the binding which can be used in Handlebars statements throughout your query"
name="binding"
headings
keyPlaceholder="Binding name"
valuePlaceholder="Default"
bindings={[...userBindings]}
bindingDrawerLeft="260px"
on:change={e => {
queryBindings = e.detail.map(binding => {
return {
name: binding.name,
default: binding.value,
}
})
}}
{#each queryBindings as binding, idx}
<Input
placeholder="Binding Name"
thin
disabled={bindable}
bind:value={binding.name}
/>
<Input
placeholder="Default"
thin
disabled={bindable}
on:change={evt => onBindingChange(binding.name, evt.detail)}
bind:value={binding.default}
/>
{#if bindable}
<DrawerBindableInput
title={`Query binding "${binding.name}"`}
placeholder="Value"
thin
on:change={evt => onBindingChange(binding.name, evt.detail)}
value={runtimeToReadableBinding(
bindings,
customParams?.[binding.name]
)}
{bindings}
/>
{:else}
<Icon hoverable name="Close" on:click={() => deleteQueryBinding(idx)} />
{/if}
{/each}
</div>
</Layout>
<style>
.bindings.bindable {
grid-template-columns: 1fr 1fr 1fr;
}
.controls {
display: flex;
align-items: center;
justify-content: space-between;
}
.bindings {
display: grid;
grid-template-columns: 1fr 1fr 5%;
grid-gap: 10px;
align-items: center;
}
.height {
height: 40px;
}

View File

@ -17,7 +17,7 @@
import ExtraQueryConfig from "./ExtraQueryConfig.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte"
import ExternalDataSourceTable from "components/backend/DataTable/ExternalDataSourceTable.svelte"
import BindingBuilder from "components/integration/QueryBindingBuilder.svelte"
import BindingBuilder from "components/integration/QueryViewerBindingBuilder.svelte"
import { datasources, integrations, queries } from "stores/backend"
import { capitalise } from "../../helpers"
import CodeMirrorEditor from "components/common/CodeMirrorEditor.svelte"

View File

@ -0,0 +1,69 @@
<script>
import { Body, Button, Heading, Layout } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builderStore/dataBinding"
export let bindable = true
export let queryBindings = []
const userBindings = getUserBindings()
let internalBindings = queryBindings.reduce((acc, binding) => {
acc[binding.name] = binding.default
return acc
}, {})
function newQueryBinding() {
queryBindings = [...queryBindings, {}]
}
</script>
<Layout noPadding={bindable} gap="S">
<div class="controls" class:height={!bindable}>
<Heading size="XS">Bindings</Heading>
{#if !bindable}
<Button secondary on:click={newQueryBinding}>Add Binding</Button>
{/if}
</div>
<Body size="S">
{#if !bindable}
Bindings come in two parts: the binding name, and a default/fallback
value. These bindings can be used as Handlebars expressions throughout the
query.
{:else}
Enter a value for each binding. The default values will be used for any
values left blank.
{/if}
</Body>
<div class="bindings" class:bindable>
<KeyValueBuilder
bind:object={internalBindings}
tooltip="Set the name of the binding which can be used in Handlebars statements throughout your query"
name="binding"
headings
keyPlaceholder="Binding name"
valuePlaceholder="Default"
bindings={[...userBindings]}
bindingDrawerLeft="260px"
on:change={e => {
queryBindings = e.detail.map(binding => {
return {
name: binding.name,
default: binding.value,
}
})
}}
/>
</div>
</Layout>
<style>
.controls {
display: flex;
align-items: center;
justify-content: space-between;
}
.height {
height: 40px;
}
</style>

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
@ -26,9 +26,7 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "1.3.21-alpha.2",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/types": "1.3.21-alpha.2",
"@budibase/backend-core": "^1.3.21",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "1.3.21-alpha.2",
"@budibase/frontend-core": "1.3.21-alpha.2",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/bbui": "^1.3.21",
"@budibase/frontend-core": "^1.3.21",
"@budibase/string-templates": "^1.3.21",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "1.3.21-alpha.2",
"@budibase/bbui": "^1.3.21",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -77,11 +77,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "1.3.21-alpha.2",
"@budibase/client": "1.3.21-alpha.2",
"@budibase/pro": "1.3.21-alpha.2",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/types": "1.3.21-alpha.2",
"@budibase/backend-core": "^1.3.21",
"@budibase/client": "^1.3.21",
"@budibase/pro": "1.3.21",
"@budibase/string-templates": "^1.3.21",
"@budibase/types": "^1.3.21",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View File

@ -1094,12 +1094,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.21-alpha.2.tgz#5587d6df6e85549faadb8c44cba523b495cca8ce"
integrity sha512-ofUgKViGc738+9waRs7RnIadbOz/BsNZ21U9wEcpYeO9w9U0UXVY2E8PhYN30xZrK+gsy/8JLhst3GcnpHIGIg==
"@budibase/backend-core@1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.21.tgz#a23d2e50bc938257284ac531eaf24d6c37539234"
integrity sha512-myZbVLc2bOJaOeRzxUxojd/Z4BvKN3nce//xDFoc1g7YcVpsc5oiW8/i4DWpgrE9ITmSCDXTb+kQMV2lcE8/6Q==
dependencies:
"@budibase/types" "1.3.21-alpha.2"
"@budibase/types" "^1.3.21"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -1180,13 +1180,13 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.21-alpha.2.tgz#d3e61802029688d87942612b5d80adb79ed69fd7"
integrity sha512-HGmZ7WutsiUCLdEFbYYlaQG150UbLPNFtyeVgCwCRYa8saXuo3p/hYqCxL1OLMJWuSZovJpkDy80NaRW6FIGew==
"@budibase/pro@1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.21.tgz#2be86caecdc812339225d9f450df96993aa3e982"
integrity sha512-kjFg/Hi+8MF/Q2CmnD+Dz0o1sRiQq68K4TUazdo+EXqH0dAuaaAVvtqWE71karrfMs3pEB7QcYa9AJBF+nuhkg==
dependencies:
"@budibase/backend-core" "1.3.21-alpha.2"
"@budibase/types" "1.3.21-alpha.2"
"@budibase/backend-core" "1.3.21"
"@budibase/types" "1.3.21"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
@ -1209,10 +1209,10 @@
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
"@budibase/types@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.21-alpha.2.tgz#595f67b6b736206c8d19b9167ca22b2b2291e3be"
integrity sha512-OE2Pi5MRo/nZSygeqozqu+OGSNZHRr8za6ArZA0ZKYOHV0uIh0vDhuqTvd3eLgOcEuasteNW74Ye/3KrGOpD8A==
"@budibase/types@1.3.21", "@budibase/types@^1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.21.tgz#02467dc661454e73747e28f9687837d712950228"
integrity sha512-fW/CjiwA7Fyl6X/e3/TZ1qYacQoYTHIlsHgqoyhf76E3dO3AsnYLxk7YTt3FC6nAUgpegr/9Oyle7Wi9b1EEJg==
"@bull-board/api@3.7.0":
version "3.7.0"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "1.3.21-alpha.2",
"version": "1.3.21",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "1.3.21-alpha.2",
"@budibase/pro": "1.3.21-alpha.2",
"@budibase/string-templates": "1.3.21-alpha.2",
"@budibase/types": "1.3.21-alpha.2",
"@budibase/backend-core": "^1.3.21",
"@budibase/pro": "1.3.21",
"@budibase/string-templates": "^1.3.21",
"@budibase/types": "^1.3.21",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View File

@ -291,12 +291,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.21-alpha.2.tgz#5587d6df6e85549faadb8c44cba523b495cca8ce"
integrity sha512-ofUgKViGc738+9waRs7RnIadbOz/BsNZ21U9wEcpYeO9w9U0UXVY2E8PhYN30xZrK+gsy/8JLhst3GcnpHIGIg==
"@budibase/backend-core@1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.3.21.tgz#a23d2e50bc938257284ac531eaf24d6c37539234"
integrity sha512-myZbVLc2bOJaOeRzxUxojd/Z4BvKN3nce//xDFoc1g7YcVpsc5oiW8/i4DWpgrE9ITmSCDXTb+kQMV2lcE8/6Q==
dependencies:
"@budibase/types" "1.3.21-alpha.2"
"@budibase/types" "^1.3.21"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -327,21 +327,21 @@
uuid "8.3.2"
zlib "1.0.5"
"@budibase/pro@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.21-alpha.2.tgz#d3e61802029688d87942612b5d80adb79ed69fd7"
integrity sha512-HGmZ7WutsiUCLdEFbYYlaQG150UbLPNFtyeVgCwCRYa8saXuo3p/hYqCxL1OLMJWuSZovJpkDy80NaRW6FIGew==
"@budibase/pro@1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.3.21.tgz#2be86caecdc812339225d9f450df96993aa3e982"
integrity sha512-kjFg/Hi+8MF/Q2CmnD+Dz0o1sRiQq68K4TUazdo+EXqH0dAuaaAVvtqWE71karrfMs3pEB7QcYa9AJBF+nuhkg==
dependencies:
"@budibase/backend-core" "1.3.21-alpha.2"
"@budibase/types" "1.3.21-alpha.2"
"@budibase/backend-core" "1.3.21"
"@budibase/types" "1.3.21"
"@koa/router" "8.0.8"
joi "17.6.0"
node-fetch "^2.6.1"
"@budibase/types@1.3.21-alpha.2":
version "1.3.21-alpha.2"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.21-alpha.2.tgz#595f67b6b736206c8d19b9167ca22b2b2291e3be"
integrity sha512-OE2Pi5MRo/nZSygeqozqu+OGSNZHRr8za6ArZA0ZKYOHV0uIh0vDhuqTvd3eLgOcEuasteNW74Ye/3KrGOpD8A==
"@budibase/types@1.3.21", "@budibase/types@^1.3.21":
version "1.3.21"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.21.tgz#02467dc661454e73747e28f9687837d712950228"
integrity sha512-fW/CjiwA7Fyl6X/e3/TZ1qYacQoYTHIlsHgqoyhf76E3dO3AsnYLxk7YTt3FC6nAUgpegr/9Oyle7Wi9b1EEJg==
"@cspotcode/source-map-consumer@0.8.0":
version "0.8.0"