Merge branch 'develop' of github.com:Budibase/budibase into side-panel

This commit is contained in:
Andrew Kingston 2022-11-28 09:57:12 +00:00
commit 6521587db3
21 changed files with 120 additions and 87 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"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": "2.1.32-alpha.9",
"@budibase/types": "2.1.32-alpha.11",
"@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": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"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": "2.1.32-alpha.9",
"@budibase/string-templates": "2.1.32-alpha.11",
"@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": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -71,10 +71,10 @@
}
},
"dependencies": {
"@budibase/bbui": "2.1.32-alpha.9",
"@budibase/client": "2.1.32-alpha.9",
"@budibase/frontend-core": "2.1.32-alpha.9",
"@budibase/string-templates": "2.1.32-alpha.9",
"@budibase/bbui": "2.1.32-alpha.11",
"@budibase/client": "2.1.32-alpha.11",
"@budibase/frontend-core": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

@ -20,6 +20,11 @@ import {
} from "../componentUtils"
import { Helpers } from "@budibase/bbui"
import { Utils } from "@budibase/frontend-core"
import {
BUDIBASE_INTERNAL_DB_ID,
DB_TYPE_INTERNAL,
DB_TYPE_EXTERNAL,
} from "constants/backend"
const INITIAL_FRONTEND_STATE = {
apps: [],
@ -482,8 +487,41 @@ export const getFrontendStore = () => {
return null
}
// Generate default props
// Flattened settings
const settings = getComponentSettings(componentName)
let dataSourceField = settings.find(
setting => setting.type == "dataSource" || setting.type == "table"
)
let defaultDatasource
if (dataSourceField) {
const _tables = get(tables)
const filteredTables = _tables.list.filter(
table => table._id != "ta_users"
)
const internalTable = filteredTables.find(
table =>
table.sourceId === BUDIBASE_INTERNAL_DB_ID &&
table.type == DB_TYPE_INTERNAL
)
const defaultSourceTable = filteredTables.find(
table =>
table.sourceId !== BUDIBASE_INTERNAL_DB_ID &&
table.type == DB_TYPE_INTERNAL
)
const defaultExternalTable = filteredTables.find(
table => table.type == DB_TYPE_EXTERNAL
)
defaultDatasource =
defaultSourceTable || internalTable || defaultExternalTable
}
// Generate default props
let props = { ...presetProps }
settings.forEach(setting => {
if (setting.defaultValue !== undefined) {
@ -491,6 +529,15 @@ export const getFrontendStore = () => {
}
})
// Set a default datasource
if (dataSourceField && defaultDatasource) {
props[dataSourceField.key] = {
label: defaultDatasource.name,
tableId: defaultDatasource._id,
type: "table",
}
}
// Add any extra properties the component needs
let extras = {}
if (definition.hasChildren) {

View File

@ -1,5 +1,5 @@
<script>
import { Body, Button, Heading, Icon, Input, Layout } from "@budibase/bbui"
import { Body, Heading, Icon, Input, Layout } from "@budibase/bbui"
import {
readableToRuntimeBinding,
runtimeToReadableBinding,
@ -11,10 +11,6 @@
export let bindings = []
export let customParams = {}
function newQueryBinding() {
queryBindings = [...queryBindings, {}]
}
function deleteQueryBinding(idx) {
queryBindings.splice(idx, 1)
queryBindings = queryBindings
@ -31,9 +27,6 @@
<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}

View File

@ -1,5 +1,5 @@
<script>
import { Body, Button, Heading, Layout } from "@budibase/bbui"
import { Body, Heading, Layout } from "@budibase/bbui"
import KeyValueBuilder from "components/integration/KeyValueBuilder.svelte"
import { getUserBindings } from "builderStore/dataBinding"
export let bindable = true
@ -11,18 +11,11 @@
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}

View File

@ -175,6 +175,8 @@ export const SWITCHABLE_TYPES = [
export const BUDIBASE_INTERNAL_DB_ID = "bb_internal"
export const BUDIBASE_DATASOURCE_TYPE = "budibase"
export const DB_TYPE_INTERNAL = "internal"
export const DB_TYPE_EXTERNAL = "external"
export const IntegrationTypes = {
POSTGRES: "POSTGRES",

View File

@ -1,7 +1,6 @@
<script>
import { store, automationStore } from "builderStore"
import { roles, flags } from "stores/backend"
import { apps } from "stores/portal"
import {
ActionMenu,
MenuItem,
@ -63,9 +62,6 @@
})
}
$: isPublished =
$apps.find(app => app.devId === application)?.status === "published"
onMount(async () => {
if (!hasSynced && application) {
try {

View File

@ -93,6 +93,7 @@ export function createDatasourcesStore() {
return { list: sources, selected: null }
})
await queries.fetch()
await tables.fetch()
},
removeSchemaError: () => {
update(state => {

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"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": "2.1.32-alpha.9",
"@budibase/frontend-core": "2.1.32-alpha.9",
"@budibase/string-templates": "2.1.32-alpha.9",
"@budibase/bbui": "2.1.32-alpha.11",
"@budibase/frontend-core": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@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": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "2.1.32-alpha.9",
"@budibase/bbui": "2.1.32-alpha.11",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
"version": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",

View File

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

View File

@ -1273,12 +1273,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.9.tgz#847dc57740824f25cfa4ad97657bd590636c567a"
integrity sha512-VTwkHzGjhrdlbX2X/6++mXKNfJyAg7v5fUhoJ+Zpg/o8V9SRosoSFIFYmXRRFdHxgTdFaFSu8lz8hPu93fnIug==
"@budibase/backend-core@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.11.tgz#bbf49464c95d3bc10e58d478d53fb88012c7bc35"
integrity sha512-JPlJIDkN6Id2K++MysV0Wx05KS8qFmdyhE1OTt1e7EVYrYdCHubWPmJynEfd0ceMEkMTqdssN7nUuQfMXBP4dA==
dependencies:
"@budibase/types" "2.1.32-alpha.9"
"@budibase/types" "2.1.32-alpha.11"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -1361,13 +1361,13 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
"@budibase/pro@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.9.tgz#689f70e7c7eea1dc2f7e1ea598b042fb3e9731be"
integrity sha512-17ZYWHZgPWJGj/fkGAFkN4VFd/evGok8W8kQQowe5ijIxXu0iP8iSXGs0fqOk8UDsSTORHT2N8HWmHiLMUUmCg==
"@budibase/pro@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.11.tgz#40e57623403133eeef1e3e1f5b6f9226dabd9b39"
integrity sha512-/XW5BDP7IueDSeAhDw6/Lp1kIQBxCTgjk9GLmpCuvSv4HEN1mu1bobebASaaqiZ7YVx8dPZXQV8bfzSKl6eHOg==
dependencies:
"@budibase/backend-core" "2.1.32-alpha.9"
"@budibase/types" "2.1.32-alpha.9"
"@budibase/backend-core" "2.1.32-alpha.11"
"@budibase/types" "2.1.32-alpha.11"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
@ -1391,10 +1391,10 @@
svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0"
"@budibase/types@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.9.tgz#880633164df0d737e16894e4f21f3a227f4b0f35"
integrity sha512-ClaAgoFkS6CnG37E5mhWDT5DCym0GY72taWyIFcuiCBzMYzAr3/EpM8Mt4g3cccFr+DFDpdMI7dTHWDaxqDpmA==
"@budibase/types@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.11.tgz#a69b002ab80fd7a97b1204b12ef867a16d48122a"
integrity sha512-lyN7EZQAe2I815z9IEQ1kZS1eDrWxsvyyGMM6tLucm/49d+FutqAqTuMvU0OatjEzaxBflEQLhv98EGX4vDVuw==
"@bull-board/api@3.7.0":
version "3.7.0"

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"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": "2.1.32-alpha.9",
"version": "2.1.32-alpha.11",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "2.1.32-alpha.9",
"@budibase/pro": "2.1.32-alpha.9",
"@budibase/string-templates": "2.1.32-alpha.9",
"@budibase/types": "2.1.32-alpha.9",
"@budibase/backend-core": "2.1.32-alpha.11",
"@budibase/pro": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/types": "2.1.32-alpha.11",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",

View File

@ -67,7 +67,8 @@ const env = {
ENCRYPTED_TEST_PUBLIC_API_KEY: process.env.ENCRYPTED_TEST_PUBLIC_API_KEY,
_set(key: any, value: any) {
process.env[key] = value
module.exports[key] = value
// @ts-ignore
env[key] = value
},
isDev,
isTest,
@ -82,7 +83,7 @@ if (!env.APPS_URL) {
}
// clean up any environment variable edge cases
for (let [key, value] of Object.entries(module.exports)) {
for (let [key, value] of Object.entries(env)) {
// handle the edge case of "0" to disable an environment variable
if (value === "0") {
// @ts-ignore

View File

@ -470,12 +470,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.9.tgz#847dc57740824f25cfa4ad97657bd590636c567a"
integrity sha512-VTwkHzGjhrdlbX2X/6++mXKNfJyAg7v5fUhoJ+Zpg/o8V9SRosoSFIFYmXRRFdHxgTdFaFSu8lz8hPu93fnIug==
"@budibase/backend-core@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.32-alpha.11.tgz#bbf49464c95d3bc10e58d478d53fb88012c7bc35"
integrity sha512-JPlJIDkN6Id2K++MysV0Wx05KS8qFmdyhE1OTt1e7EVYrYdCHubWPmJynEfd0ceMEkMTqdssN7nUuQfMXBP4dA==
dependencies:
"@budibase/types" "2.1.32-alpha.9"
"@budibase/types" "2.1.32-alpha.11"
"@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0"
@ -508,22 +508,22 @@
uuid "8.3.2"
zlib "1.0.5"
"@budibase/pro@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.9.tgz#689f70e7c7eea1dc2f7e1ea598b042fb3e9731be"
integrity sha512-17ZYWHZgPWJGj/fkGAFkN4VFd/evGok8W8kQQowe5ijIxXu0iP8iSXGs0fqOk8UDsSTORHT2N8HWmHiLMUUmCg==
"@budibase/pro@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.32-alpha.11.tgz#40e57623403133eeef1e3e1f5b6f9226dabd9b39"
integrity sha512-/XW5BDP7IueDSeAhDw6/Lp1kIQBxCTgjk9GLmpCuvSv4HEN1mu1bobebASaaqiZ7YVx8dPZXQV8bfzSKl6eHOg==
dependencies:
"@budibase/backend-core" "2.1.32-alpha.9"
"@budibase/types" "2.1.32-alpha.9"
"@budibase/backend-core" "2.1.32-alpha.11"
"@budibase/types" "2.1.32-alpha.11"
"@koa/router" "8.0.8"
bull "4.10.1"
joi "17.6.0"
node-fetch "^2.6.1"
"@budibase/types@2.1.32-alpha.9":
version "2.1.32-alpha.9"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.9.tgz#880633164df0d737e16894e4f21f3a227f4b0f35"
integrity sha512-ClaAgoFkS6CnG37E5mhWDT5DCym0GY72taWyIFcuiCBzMYzAr3/EpM8Mt4g3cccFr+DFDpdMI7dTHWDaxqDpmA==
"@budibase/types@2.1.32-alpha.11":
version "2.1.32-alpha.11"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.32-alpha.11.tgz#a69b002ab80fd7a97b1204b12ef867a16d48122a"
integrity sha512-lyN7EZQAe2I815z9IEQ1kZS1eDrWxsvyyGMM6tLucm/49d+FutqAqTuMvU0OatjEzaxBflEQLhv98EGX4vDVuw==
"@cspotcode/source-map-support@^0.8.0":
version "0.8.1"