merge with master

This commit is contained in:
Martin McKeaveney 2021-12-08 17:20:14 +00:00
commit 57fa1cb7c3
15 changed files with 84 additions and 63 deletions

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/auth", "name": "@budibase/auth",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"description": "Authentication middlewares for budibase builder and apps", "description": "Authentication middlewares for budibase builder and apps",
"main": "src/index.js", "main": "src/index.js",
"author": "Budibase", "author": "Budibase",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",

View File

@ -63,9 +63,9 @@
const getFilteredOptions = (options, term, getLabel) => { const getFilteredOptions = (options, term, getLabel) => {
if (autocomplete && term) { if (autocomplete && term) {
const lowerCaseTerm = term.toLowerCase() const lowerCaseTerm = term.toLowerCase()
return options.filter(option => return options.filter(option => {
getLabel(option)?.toLowerCase().includes(lowerCaseTerm) return `${getLabel(option)}`.toLowerCase().includes(lowerCaseTerm)
) })
} }
return options return options
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -65,10 +65,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.8-alpha.0", "@budibase/bbui": "^1.0.8",
"@budibase/client": "^1.0.8-alpha.0", "@budibase/client": "^1.0.8",
"@budibase/colorpicker": "1.1.2", "@budibase/colorpicker": "1.1.2",
"@budibase/string-templates": "^1.0.8-alpha.0", "@budibase/string-templates": "^1.0.8",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View File

@ -96,13 +96,16 @@
allSteps[idx].schema?.outputs?.properties ?? {} allSteps[idx].schema?.outputs?.properties ?? {}
) )
bindings = bindings.concat( bindings = bindings.concat(
outputs.map(([name, value]) => ({ outputs.map(([name, value]) => {
label: name, const runtime = idx === 0 ? `trigger.${name}` : `steps.${idx}.${name}`
type: value.type, return {
description: value.description, label: runtime,
category: idx === 0 ? "Trigger outputs" : `Step ${idx} outputs`, type: value.type,
path: idx === 0 ? `trigger.${name}` : `steps.${idx}.${name}`, description: value.description,
})) category: idx === 0 ? "Trigger outputs" : `Step ${idx} outputs`,
path: runtime,
}
})
) )
} }
return bindings return bindings
@ -261,7 +264,6 @@
value={inputData[key]} value={inputData[key]}
on:change={e => onChange(e, key)} on:change={e => onChange(e, key)}
{bindings} {bindings}
allowJS={false}
/> />
</div> </div>
{/if} {/if}

View File

@ -17,7 +17,6 @@
queries as queriesStore, queries as queriesStore,
} from "stores/backend" } from "stores/backend"
import { datasources, integrations } from "stores/backend" import { datasources, integrations } from "stores/backend"
import { notifications } from "@budibase/bbui"
import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte" import ParameterBuilder from "components/integration/QueryParameterBuilder.svelte"
import IntegrationQueryEditor from "components/integration/index.svelte" import IntegrationQueryEditor from "components/integration/index.svelte"
import { makePropSafe as safe } from "@budibase/string-templates" import { makePropSafe as safe } from "@budibase/string-templates"
@ -31,6 +30,7 @@
const arrayTypes = ["attachment", "array"] const arrayTypes = ["attachment", "array"]
let anchorRight, dropdownRight let anchorRight, dropdownRight
let drawer let drawer
let tmpQueryParams
$: text = value?.label ?? "Choose an option" $: text = value?.label ?? "Choose an option"
$: tables = $tablesStore.list.map(m => ({ $: tables = $tablesStore.list.map(m => ({
@ -105,12 +105,12 @@
} }
}) })
function handleSelected(selected) { const handleSelected = selected => {
dispatch("change", selected) dispatch("change", selected)
dropdownRight.hide() dropdownRight.hide()
} }
function fetchQueryDefinition(query) { const fetchQueryDefinition = query => {
const source = $datasources.list.find( const source = $datasources.list.find(
ds => ds._id === query.datasourceId ds => ds._id === query.datasourceId
).source ).source
@ -124,6 +124,19 @@
const getQueryDatasource = query => { const getQueryDatasource = query => {
return $datasources.list.find(ds => ds._id === query?.datasourceId) return $datasources.list.find(ds => ds._id === query?.datasourceId)
} }
const openQueryParamsDrawer = () => {
tmpQueryParams = value.queryParams
drawer.show()
}
const saveQueryParams = () => {
handleSelected({
...value,
queryParams: tmpQueryParams,
})
drawer.hide()
}
</script> </script>
<div class="container" bind:this={anchorRight}> <div class="container" bind:this={anchorRight}>
@ -134,24 +147,14 @@
on:click={dropdownRight.show} on:click={dropdownRight.show}
/> />
{#if value?.type === "query"} {#if value?.type === "query"}
<i class="ri-settings-5-line" on:click={drawer.show} /> <i class="ri-settings-5-line" on:click={openQueryParamsDrawer} />
<Drawer title={"Query Parameters"} bind:this={drawer}> <Drawer title={"Query Parameters"} bind:this={drawer}>
<Button <Button slot="buttons" cta on:click={saveQueryParams}>Save</Button>
slot="buttons"
cta
on:click={() => {
notifications.success("Query parameters saved.")
handleSelected(value)
drawer.hide()
}}
>
Save
</Button>
<DrawerContent slot="body"> <DrawerContent slot="body">
<Layout noPadding> <Layout noPadding>
{#if getQueryParams(value).length > 0} {#if getQueryParams(value).length > 0}
<ParameterBuilder <ParameterBuilder
bind:customParams={value.queryParams} bind:customParams={tmpQueryParams}
parameters={getQueryParams(value)} parameters={getQueryParams(value)}
{bindings} {bindings}
/> />

View File

@ -6,7 +6,7 @@
export let value = [] export let value = []
let drawer let drawer
let links = cloneDeep(value) let links = cloneDeep(value || [])
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
const save = () => { const save = () => {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {

View File

@ -393,13 +393,13 @@
{ {
"label": "Column", "label": "Column",
"value": "column", "value": "column",
"barIcon": "ViewRow", "barIcon": "ViewColumn",
"barTitle": "Column layout" "barTitle": "Column layout"
}, },
{ {
"label": "Row", "label": "Row",
"value": "row", "value": "row",
"barIcon": "ViewColumn", "barIcon": "ViewRow",
"barTitle": "Row layout" "barTitle": "Row layout"
} }
], ],

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.8-alpha.0", "@budibase/bbui": "^1.0.8",
"@budibase/standard-components": "^0.9.139", "@budibase/standard-components": "^0.9.139",
"@budibase/string-templates": "^1.0.8-alpha.0", "@budibase/string-templates": "^1.0.8",
"regexparam": "^1.3.0", "regexparam": "^1.3.0",
"shortid": "^2.2.15", "shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5" "svelte-spa-router": "^3.0.5"

View File

@ -21,11 +21,25 @@
$: target = openInNewTab ? "_blank" : "_self" $: target = openInNewTab ? "_blank" : "_self"
$: placeholder = $builderStore.inBuilder && !text $: placeholder = $builderStore.inBuilder && !text
$: componentText = getComponentText(text, $builderStore, $component) $: componentText = getComponentText(text, $builderStore, $component)
$: sanitizedUrl = getSanitizedUrl(url, externalLink, openInNewTab)
// Add color styles to main styles object, otherwise the styleable helper // Add color styles to main styles object, otherwise the styleable helper
// overrides the color when it's passed as inline style. // overrides the color when it's passed as inline style.
$: styles = enrichStyles($component.styles, color) $: styles = enrichStyles($component.styles, color)
const getSanitizedUrl = (url, externalLink, newTab) => {
if (!url) {
return externalLink || newTab ? "#/" : "/"
}
if (externalLink) {
return url
}
if (openInNewTab) {
return `#${url}`
}
return url
}
const getComponentText = (text, builderState, componentState) => { const getComponentText = (text, builderState, componentState) => {
if (!builderState.inBuilder || componentState.editing) { if (!builderState.inBuilder || componentState.editing) {
return text || "" return text || ""
@ -65,10 +79,10 @@
{componentText} {componentText}
</div> </div>
{:else if $builderStore.inBuilder || componentText} {:else if $builderStore.inBuilder || componentText}
{#if externalLink} {#if externalLink || openInNewTab}
<a <a
{target} {target}
href={url || "/"} href={sanitizedUrl}
use:styleable={styles} use:styleable={styles}
class:placeholder class:placeholder
class:bold class:bold
@ -79,18 +93,20 @@
{componentText} {componentText}
</a> </a>
{:else} {:else}
<a {#key sanitizedUrl}
use:linkable <a
href={url || "/"} use:linkable
use:styleable={styles} href={sanitizedUrl}
class:placeholder use:styleable={styles}
class:bold class:placeholder
class:italic class:bold
class:underline class:italic
class="align--{align || 'left'} size--{size || 'M'}" class:underline
> class="align--{align || 'left'} size--{size || 'M'}"
{componentText} >
</a> {componentText}
</a>
{/key}
{/if} {/if}
{/if} {/if}

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -69,9 +69,9 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/auth": "^1.0.8-alpha.0", "@budibase/auth": "^1.0.8",
"@budibase/client": "^1.0.8-alpha.0", "@budibase/client": "^1.0.8",
"@budibase/string-templates": "^1.0.8-alpha.0", "@budibase/string-templates": "^1.0.8",
"@bull-board/api": "^3.7.0", "@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0", "@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",

View File

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

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "1.0.8-alpha.0", "version": "1.0.8",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -29,8 +29,8 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/auth": "^1.0.8-alpha.0", "@budibase/auth": "^1.0.8",
"@budibase/string-templates": "^1.0.8-alpha.0", "@budibase/string-templates": "^1.0.8",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0", "@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",