diff --git a/.github/workflows/deploy-cloud.yaml b/.github/workflows/deploy-cloud.yaml
index db03165a91..a05f97f097 100644
--- a/.github/workflows/deploy-cloud.yaml
+++ b/.github/workflows/deploy-cloud.yaml
@@ -66,7 +66,7 @@ jobs:
config-files: values.production.yaml
chart-path: charts/budibase
namespace: budibase
- values: globals.appVersion=v${{ env.RELEASE_VERSION }}
+ values: globals.appVersion=v${{ env.RELEASE_VERSION }},services.couchdb.url=${{ secrets.PRODUCTION_COUCHDB_URL }},services.couchdb.password=${{ secrets.PRODUCTION_COUCHDB_PASSWORD }}
name: budibase-prod
- name: Discord Webhook Action
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b3b2b01316..3fe81dbcd1 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -53,8 +53,8 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
- git config user.name "Budibase Release Bot"
- git config user.email "<>"
+ git config --global user.name "Budibase Release Bot"
+ git config --global user.email "<>"
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} >> .npmrc
yarn release
diff --git a/charts/budibase/templates/minio-data-persistentvolumeclaim.yaml b/charts/budibase/templates/minio-data-persistentvolumeclaim.yaml
index 7a6e05a66a..abcf341bc5 100644
--- a/charts/budibase/templates/minio-data-persistentvolumeclaim.yaml
+++ b/charts/budibase/templates/minio-data-persistentvolumeclaim.yaml
@@ -12,10 +12,8 @@ spec:
resources:
requests:
storage: {{ .Values.services.objectStore.storage }}
- {{- if (eq "-" .Values.services.objectStore.storageClass) }}
- storageClassName: ""
- {{- else }}
- storageClassName: "{{ .Values.services.objectStore.storageClass }}"
+ {{ if .Values.services.objectStore.storageClass }}
+ storageClassName: {{ .Values.services.objectStore.storageClass }}
{{- end }}
status: {}
{{- end }}
diff --git a/charts/budibase/templates/redis-data-persistentvolumeclaim.yaml b/charts/budibase/templates/redis-data-persistentvolumeclaim.yaml
index 5f063dc664..6f11492b58 100644
--- a/charts/budibase/templates/redis-data-persistentvolumeclaim.yaml
+++ b/charts/budibase/templates/redis-data-persistentvolumeclaim.yaml
@@ -12,10 +12,8 @@ spec:
resources:
requests:
storage: {{ .Values.services.redis.storage }}
- {{- if (eq "-" .Values.services.redis.storageClass) }}
- storageClassName: ""
- {{- else }}
- storageClassName: "{{ .Values.services.redis.storageClass }}"
- {{- end }}
+ {{ if .Values.services.redis.storageClass }}
+ storageClassName: {{ .Values.services.redis.storageClass }}
+ {{ end }}
status: {}
{{- end }}
diff --git a/charts/budibase/values.yaml b/charts/budibase/values.yaml
index 5ada89de6c..116931a147 100644
--- a/charts/budibase/values.yaml
+++ b/charts/budibase/values.yaml
@@ -155,7 +155,7 @@ services:
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner.
- storageClass: "-"
+ storageClass: ""
objectStore:
minio: true
@@ -171,7 +171,7 @@ services:
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner.
- storageClass: "-"
+ storageClass: ""
# Override values in couchDB subchart
couchdb:
diff --git a/hosting/nginx.prod.conf.hbs b/hosting/nginx.prod.conf.hbs
index 7ef597051b..cd5f7b4d48 100644
--- a/hosting/nginx.prod.conf.hbs
+++ b/hosting/nginx.prod.conf.hbs
@@ -48,7 +48,7 @@ http {
set $csp_style "style-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://fonts.googleapis.com https://rsms.me https://maxcdn.bootstrapcdn.com";
set $csp_object "object-src 'none'";
set $csp_base_uri "base-uri 'self'";
- set $csp_connect "connect-src 'self' https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com";
+ set $csp_connect "connect-src 'self' https://api-iam.intercom.io https://api-iam.intercom.io https://api-ping.intercom.io https://app.posthog.com wss://nexus-websocket-a.intercom.io wss://nexus-websocket-b.intercom.io https://nexus-websocket-a.intercom.io https://nexus-websocket-b.intercom.io https://uploads.intercomcdn.com https://uploads.intercomusercontent.com https://*.s3.*.amazonaws.com";
set $csp_font "font-src 'self' data: https://cdn.jsdelivr.net https://fonts.gstatic.com https://rsms.me https://maxcdn.bootstrapcdn.com https://js.intercomcdn.com https://fonts.intercomcdn.com";
set $csp_frame "frame-src 'self' https:";
set $csp_img "img-src http: https: data: blob:";
diff --git a/lerna.json b/lerna.json
index 3f69ccefda..c9aeb85fbc 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"npmClient": "yarn",
"packages": [
"packages/*"
diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json
index b0ff91ab98..370f529ed7 100644
--- a/packages/backend-core/package.json
+++ b/packages/backend-core/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Budibase backend core libraries used in server and worker",
"main": "src/index.js",
"author": "Budibase",
diff --git a/packages/backend-core/src/db/index.js b/packages/backend-core/src/db/index.js
index 1a29c8c2b0..7d54b881b1 100644
--- a/packages/backend-core/src/db/index.js
+++ b/packages/backend-core/src/db/index.js
@@ -41,7 +41,8 @@ exports.closeDB = async db => {
return
}
try {
- return db.close()
+ // specifically await so that if there is an error, it can be ignored
+ return await db.close()
} catch (err) {
// ignore error, already closed
}
diff --git a/packages/backend-core/src/db/pouch.js b/packages/backend-core/src/db/pouch.js
index 722913aa67..9c1ada8d76 100644
--- a/packages/backend-core/src/db/pouch.js
+++ b/packages/backend-core/src/db/pouch.js
@@ -1,29 +1,19 @@
const PouchDB = require("pouchdb")
const env = require("../environment")
-exports.getCouchUrl = () => {
- if (!env.COUCH_DB_URL) return
-
- // username and password already exist in URL
- if (env.COUCH_DB_URL.includes("@")) {
- return env.COUCH_DB_URL
- }
-
- const [protocol, ...rest] = env.COUCH_DB_URL.split("://")
-
- if (!env.COUCH_DB_USERNAME || !env.COUCH_DB_PASSWORD) {
- throw new Error(
- "CouchDB configuration invalid. You must provide a fully qualified CouchDB url, or the COUCH_DB_USER and COUCH_DB_PASSWORD environment variables."
- )
- }
-
- return `${protocol}://${env.COUCH_DB_USERNAME}:${env.COUCH_DB_PASSWORD}@${rest}`
-}
-
-exports.splitCouchUrl = url => {
+function getUrlInfo() {
+ let url = env.COUCH_DB_URL
+ let username, password, host
const [protocol, rest] = url.split("://")
- const [auth, host] = rest.split("@")
- const [username, password] = auth.split(":")
+ if (url.includes("@")) {
+ const hostParts = rest.split("@")
+ host = hostParts[1]
+ const authParts = hostParts[0].split(":")
+ username = authParts[0]
+ password = authParts[1]
+ } else {
+ host = rest
+ }
return {
url: `${protocol}://${host}`,
auth: {
@@ -33,32 +23,51 @@ exports.splitCouchUrl = url => {
}
}
+exports.getCouchInfo = () => {
+ const urlInfo = getUrlInfo()
+ let username
+ let password
+ if (env.COUCH_DB_USERNAME) {
+ // set from env
+ username = env.COUCH_DB_USERNAME
+ } else if (urlInfo.auth.username) {
+ // set from url
+ username = urlInfo.auth.username
+ } else if (!env.isTest()) {
+ throw new Error("CouchDB username not set")
+ }
+ if (env.COUCH_DB_PASSWORD) {
+ // set from env
+ password = env.COUCH_DB_PASSWORD
+ } else if (urlInfo.auth.password) {
+ // set from url
+ password = urlInfo.auth.password
+ } else if (!env.isTest()) {
+ throw new Error("CouchDB password not set")
+ }
+ const authCookie = Buffer.from(`${username}:${password}`).toString("base64")
+ return {
+ url: urlInfo.url,
+ auth: {
+ username: username,
+ password: password,
+ },
+ cookie: `Basic ${authCookie}`,
+ }
+}
+
/**
* Return a constructor for PouchDB.
* This should be rarely used outside of the main application config.
* Exposed for exceptional cases such as in-memory views.
*/
exports.getPouch = (opts = {}) => {
- let auth = {
- username: env.COUCH_DB_USERNAME,
- password: env.COUCH_DB_PASSWORD,
- }
- let url = exports.getCouchUrl() || "http://localhost:4005"
- // need to update security settings
- if (!auth.username || !auth.password || url.includes("@")) {
- const split = exports.splitCouchUrl(url)
- url = split.url
- auth = split.auth
- }
-
- const authCookie = Buffer.from(`${auth.username}:${auth.password}`).toString(
- "base64"
- )
+ let { url, cookie } = exports.getCouchInfo()
let POUCH_DB_DEFAULTS = {
prefix: url,
fetch: (url, opts) => {
// use a specific authorization cookie - be very explicit about how we authenticate
- opts.headers.set("Authorization", `Basic ${authCookie}`)
+ opts.headers.set("Authorization", cookie)
return PouchDB.fetch(url, opts)
},
}
diff --git a/packages/backend-core/src/db/utils.js b/packages/backend-core/src/db/utils.js
index 9e2a06d065..1e2ba846de 100644
--- a/packages/backend-core/src/db/utils.js
+++ b/packages/backend-core/src/db/utils.js
@@ -12,7 +12,7 @@ const {
const { getTenantId, getGlobalDBName } = require("../tenancy")
const fetch = require("node-fetch")
const { doWithDB, allDbs } = require("./index")
-const { getCouchUrl } = require("./pouch")
+const { getCouchInfo } = require("./pouch")
const { getAppMetadata } = require("../cache/appMetadata")
const { checkSlashesInUrl } = require("../helpers")
const {
@@ -169,8 +169,14 @@ exports.getAllDbs = async (opts = { efficient: false }) => {
return allDbs()
}
let dbs = []
- async function addDbs(url) {
- const response = await fetch(checkSlashesInUrl(encodeURI(url)))
+ let { url, cookie } = getCouchInfo()
+ async function addDbs(couchUrl) {
+ const response = await fetch(checkSlashesInUrl(encodeURI(couchUrl)), {
+ method: "GET",
+ headers: {
+ Authorization: cookie,
+ },
+ })
if (response.status === 200) {
let json = await response.json()
dbs = dbs.concat(json)
@@ -178,7 +184,7 @@ exports.getAllDbs = async (opts = { efficient: false }) => {
throw "Cannot connect to CouchDB instance"
}
}
- let couchUrl = `${getCouchUrl()}/_all_dbs`
+ let couchUrl = `${url}/_all_dbs`
let tenantId = getTenantId()
if (!env.MULTI_TENANCY || (!efficient && tenantId === DEFAULT_TENANT_ID)) {
// just get all DBs when:
diff --git a/packages/backend-core/src/environment.js b/packages/backend-core/src/environment.js
index 8a92e39469..26e0d486f7 100644
--- a/packages/backend-core/src/environment.js
+++ b/packages/backend-core/src/environment.js
@@ -8,7 +8,7 @@ function isTest() {
module.exports = {
JWT_SECRET: process.env.JWT_SECRET,
- COUCH_DB_URL: process.env.COUCH_DB_URL,
+ COUCH_DB_URL: process.env.COUCH_DB_URL || "http://localhost:4005",
COUCH_DB_USERNAME: process.env.COUCH_DB_USER,
COUCH_DB_PASSWORD: process.env.COUCH_DB_PASSWORD,
GOOGLE_CLIENT_ID: process.env.GOOGLE_CLIENT_ID,
diff --git a/packages/bbui/package.json b/packages/bbui/package.json
index 8efe313394..162b75f86b 100644
--- a/packages/bbui/package.json
+++ b/packages/bbui/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"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.0.124-alpha.0",
+ "@budibase/string-templates": "^1.0.130-alpha.0",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",
diff --git a/packages/builder/package.json b/packages/builder/package.json
index a2b96e4601..71a6d85bda 100644
--- a/packages/builder/package.json
+++ b/packages/builder/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"license": "GPL-3.0",
"private": true,
"scripts": {
@@ -65,10 +65,10 @@
}
},
"dependencies": {
- "@budibase/bbui": "^1.0.124-alpha.0",
- "@budibase/client": "^1.0.124-alpha.0",
- "@budibase/frontend-core": "^1.0.124-alpha.0",
- "@budibase/string-templates": "^1.0.124-alpha.0",
+ "@budibase/bbui": "^1.0.130-alpha.0",
+ "@budibase/client": "^1.0.130-alpha.0",
+ "@budibase/frontend-core": "^1.0.130-alpha.0",
+ "@budibase/string-templates": "^1.0.130-alpha.0",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
diff --git a/packages/builder/src/components/backend/DataTable/DataTable.svelte b/packages/builder/src/components/backend/DataTable/DataTable.svelte
index 6a1befd7e4..1f461ebad3 100644
--- a/packages/builder/src/components/backend/DataTable/DataTable.svelte
+++ b/packages/builder/src/components/backend/DataTable/DataTable.svelte
@@ -165,7 +165,7 @@
{/key}
diff --git a/packages/builder/src/constants/backend/index.js b/packages/builder/src/constants/backend/index.js
index 2f5f26e476..922955591a 100644
--- a/packages/builder/src/constants/backend/index.js
+++ b/packages/builder/src/constants/backend/index.js
@@ -144,7 +144,11 @@ export const RelationshipTypes = {
MANY_TO_ONE: "many-to-one",
}
-export const ALLOWABLE_STRING_OPTIONS = [FIELDS.STRING, FIELDS.OPTIONS]
+export const ALLOWABLE_STRING_OPTIONS = [
+ FIELDS.STRING,
+ FIELDS.OPTIONS,
+ FIELDS.LONGFORM,
+]
export const ALLOWABLE_STRING_TYPES = ALLOWABLE_STRING_OPTIONS.map(
opt => opt.type
)
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte
index e2f9bad292..0c8cadff45 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/AppPreview.svelte
@@ -56,6 +56,7 @@
customTheme: $store.customTheme,
previewDevice: $store.previewDevice,
messagePassing: $store.clientFeatures.messagePassing,
+ navigation: $store.navigation,
isBudibaseEvent: true,
}
$: json = JSON.stringify(previewData)
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js
index c265a64d53..3555194263 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/iframeTemplate.js
@@ -66,6 +66,7 @@ export default `
theme,
customTheme,
previewDevice,
+ navigation
} = parsed
// Set some flags so the app knows we're in the builder
@@ -79,6 +80,7 @@ export default `
window["##BUDIBASE_PREVIEW_THEME##"] = theme
window["##BUDIBASE_PREVIEW_CUSTOM_THEME##"] = customTheme
window["##BUDIBASE_PREVIEW_DEVICE##"] = previewDevice
+ window["##BUDIBASE_PREVIEW_NAVIGATION##"] = navigation
// Initialise app
try {
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/new/_components/NewComponentTargetPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/new/_components/NewComponentTargetPanel.svelte
index 61dc5e2894..18c6ddd485 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/new/_components/NewComponentTargetPanel.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/new/_components/NewComponentTargetPanel.svelte
@@ -13,6 +13,9 @@
- Components you add will be placed {position} {title}
+
+ Components that you add will be placed {position}
+ {title}
+
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 00a76555b5..c9653d6a7e 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
diff --git a/packages/client/package.json b/packages/client/package.json
index d3b0a62bd3..06a0b3f6c4 100644
--- a/packages/client/package.json
+++ b/packages/client/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/client",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"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.0.124-alpha.0",
- "@budibase/frontend-core": "^1.0.124-alpha.0",
- "@budibase/string-templates": "^1.0.124-alpha.0",
+ "@budibase/bbui": "^1.0.130-alpha.0",
+ "@budibase/frontend-core": "^1.0.130-alpha.0",
+ "@budibase/string-templates": "^1.0.130-alpha.0",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",
diff --git a/packages/client/src/index.js b/packages/client/src/index.js
index 1acf25f21d..d43af38ff5 100644
--- a/packages/client/src/index.js
+++ b/packages/client/src/index.js
@@ -19,6 +19,7 @@ const loadBudibase = () => {
theme: window["##BUDIBASE_PREVIEW_THEME##"],
customTheme: window["##BUDIBASE_PREVIEW_CUSTOM_THEME##"],
previewDevice: window["##BUDIBASE_PREVIEW_DEVICE##"],
+ navigation: window["##BUDIBASE_PREVIEW_NAVIGATION##"],
})
// Set app ID - this window flag is set by both the preview and the real
diff --git a/packages/client/src/stores/builder.js b/packages/client/src/stores/builder.js
index 817944eaa9..ae6e5db74b 100644
--- a/packages/client/src/stores/builder.js
+++ b/packages/client/src/stores/builder.js
@@ -19,6 +19,7 @@ const createBuilderStore = () => {
customTheme: null,
previewDevice: "desktop",
isDragging: false,
+ navigation: null,
// Legacy - allow the builder to specify a layout
layout: null,
@@ -56,9 +57,6 @@ const createBuilderStore = () => {
// Do nothing
}
},
- setSelectedPath: path => {
- store.update(state => ({ ...state, selectedPath: path }))
- },
moveComponent: (componentId, destinationComponentId, mode) => {
dispatchEvent("move-component", {
componentId,
diff --git a/packages/client/src/stores/screens.js b/packages/client/src/stores/screens.js
index 1e87c71021..d527e69ef9 100644
--- a/packages/client/src/stores/screens.js
+++ b/packages/client/src/stores/screens.js
@@ -1,12 +1,7 @@
-import { derived, get } from "svelte/store"
+import { derived } from "svelte/store"
import { routeStore } from "./routes"
import { builderStore } from "./builder"
import { appStore } from "./app"
-import {
- findComponentPathById,
- findChildrenByType,
- findComponentById,
-} from "../utils/components"
const createScreenStore = () => {
const store = derived(
@@ -47,21 +42,22 @@ const createScreenStore = () => {
// If we don't have a legacy custom layout, build a layout structure
// from the screen navigation settings
if (!activeLayout) {
- let navigationProps = {
+ let navigationSettings = {
navigation: "None",
}
if (activeScreen?.showNavigation) {
- navigationProps = $appStore.application?.navigation
+ navigationSettings =
+ $builderStore.navigation || $appStore.application?.navigation
// Legacy - if this is a legacy screen without any navigation
// settings fall back to just showing the app title
- if (!navigationProps) {
- navigationProps = {
- title: activeScreen?.navigation ?? $appStore.application?.name,
+ if (!navigationSettings) {
+ navigationSettings = {
+ title: $appStore.application?.name,
}
}
- if (!navigationProps.navigation) {
- navigationProps.navigation = "Top"
+ if (!navigationSettings.navigation) {
+ navigationSettings.navigation = "Top"
}
}
activeLayout = {
@@ -83,7 +79,7 @@ const createScreenStore = () => {
},
},
],
- ...navigationProps,
+ ...navigationSettings,
},
}
}
@@ -92,38 +88,8 @@ const createScreenStore = () => {
}
)
- // Utils to parse component definitions
- const actions = {
- findComponentById: componentId => {
- const { activeScreen, activeLayout } = get(store)
- let result = findComponentById(activeScreen?.props, componentId)
- if (result) {
- return result
- }
- return findComponentById(activeLayout?.props)
- },
- findComponentPathById: componentId => {
- const { activeScreen, activeLayout } = get(store)
- let result = findComponentPathById(activeScreen?.props, componentId)
- if (result) {
- return result
- }
- return findComponentPathById(activeLayout?.props)
- },
- findChildrenByType: (componentId, type) => {
- const component = actions.findComponentById(componentId)
- if (!component || !component._children) {
- return null
- }
- let children = []
- findChildrenByType(component, type, children)
- return children
- },
- }
-
return {
subscribe: store.subscribe,
- actions,
}
}
diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json
index fd651db17b..dc172cbabd 100644
--- a/packages/frontend-core/package.json
+++ b/packages/frontend-core/package.json
@@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
- "@budibase/bbui": "^1.0.124-alpha.0",
+ "@budibase/bbui": "^1.0.130-alpha.0",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}
diff --git a/packages/server/package.json b/packages/server/package.json
index 1eb3b3f900..beee8b436b 100644
--- a/packages/server/package.json
+++ b/packages/server/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@@ -68,10 +68,10 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "^10.0.3",
- "@budibase/backend-core": "^1.0.124-alpha.0",
- "@budibase/client": "^1.0.124-alpha.0",
- "@budibase/pro": "1.0.124-alpha.0",
- "@budibase/string-templates": "^1.0.124-alpha.0",
+ "@budibase/backend-core": "^1.0.130-alpha.0",
+ "@budibase/client": "^1.0.130-alpha.0",
+ "@budibase/pro": "1.0.130-alpha.0",
+ "@budibase/string-templates": "^1.0.130-alpha.0",
"@bull-board/api": "^3.7.0",
"@bull-board/koa": "^3.7.0",
"@elastic/elasticsearch": "7.10.0",
diff --git a/packages/server/src/api/controllers/application.ts b/packages/server/src/api/controllers/application.ts
index 4e6d37765f..aa76dd403c 100644
--- a/packages/server/src/api/controllers/application.ts
+++ b/packages/server/src/api/controllers/application.ts
@@ -406,11 +406,14 @@ const destroyApp = async (ctx: any) => {
if (!env.isTest() && !isUnpublish) {
await deleteApp(appId)
}
+ // automations only in production
if (isUnpublish) {
await cleanupAutomations(appId)
}
- // make sure the app/role doesn't stick around after the app has been deleted
- await removeAppFromUserRoles(ctx, appId)
+ // remove app role when the dev app is deleted (no trace of app anymore)
+ else {
+ await removeAppFromUserRoles(ctx, appId)
+ }
await appCache.invalidateAppMetadata(appId)
return result
}
diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js
index ad95a25fc5..5f1dc25faa 100644
--- a/packages/server/src/api/controllers/row/internalSearch.js
+++ b/packages/server/src/api/controllers/row/internalSearch.js
@@ -1,6 +1,6 @@
const { SearchIndexes } = require("../../../db/utils")
const fetch = require("node-fetch")
-const { getCouchUrl } = require("@budibase/backend-core/db")
+const { getCouchInfo } = require("@budibase/backend-core/db")
const { getAppId } = require("@budibase/backend-core/context")
/**
@@ -242,11 +242,10 @@ class QueryBuilder {
async run() {
const appId = getAppId()
- const url = `${getCouchUrl()}/${appId}/_design/database/_search/${
- SearchIndexes.ROWS
- }`
+ const { url, cookie } = getCouchInfo()
+ const fullPath = `${url}/${appId}/_design/database/_search/${SearchIndexes.ROWS}`
const body = this.buildSearchBody()
- return await runQuery(url, body)
+ return await runQuery(fullPath, body, cookie)
}
}
@@ -254,12 +253,16 @@ class QueryBuilder {
* Executes a lucene search query.
* @param url The query URL
* @param body The request body defining search criteria
+ * @param cookie The auth cookie for CouchDB
* @returns {Promise<{rows: []}>}
*/
-const runQuery = async (url, body) => {
+const runQuery = async (url, body, cookie) => {
const response = await fetch(url, {
body: JSON.stringify(body),
method: "POST",
+ headers: {
+ Authorization: cookie,
+ },
})
const json = await response.json()
diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js
index 0d52eecb5b..60f3c981d6 100644
--- a/packages/server/src/constants/index.js
+++ b/packages/server/src/constants/index.js
@@ -47,7 +47,11 @@ exports.FieldTypes = {
exports.CanSwitchTypes = [
[exports.FieldTypes.JSON, exports.FieldTypes.ARRAY],
- [exports.FieldTypes.STRING, exports.FieldTypes.OPTIONS],
+ [
+ exports.FieldTypes.STRING,
+ exports.FieldTypes.OPTIONS,
+ exports.FieldTypes.LONGFORM,
+ ],
[exports.FieldTypes.BOOLEAN, exports.FieldTypes.NUMBER],
]
diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts
index f7f18c6fb9..326b213bc7 100644
--- a/packages/server/src/integrations/utils.ts
+++ b/packages/server/src/integrations/utils.ts
@@ -42,9 +42,9 @@ const SQL_STRING_TYPE_MAP = {
nvarchar: FieldTypes.STRING,
ntext: FieldTypes.STRING,
enum: FieldTypes.STRING,
- blob: FieldTypes.LONGFORM,
- long: FieldTypes.LONGFORM,
- text: FieldTypes.LONGFORM,
+ blob: FieldTypes.STRING,
+ long: FieldTypes.STRING,
+ text: FieldTypes.STRING,
}
const SQL_BOOLEAN_TYPE_MAP = {
@@ -207,11 +207,20 @@ function shouldCopySpecialColumn(
column: { type: string },
fetchedColumn: { type: string } | undefined
) {
+ const specialTypes = [
+ FieldTypes.OPTIONS,
+ FieldTypes.LONGFORM,
+ FieldTypes.ARRAY,
+ FieldTypes.FORMULA,
+ ]
+ if (column && !fetchedColumn) {
+ return true
+ }
+ const fetchedIsNumber =
+ !fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
return (
- column.type === FieldTypes.OPTIONS ||
- column.type === FieldTypes.ARRAY ||
- ((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
- column.type === FieldTypes.BOOLEAN)
+ specialTypes.indexOf(column.type) !== -1 ||
+ (fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
)
}
diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock
index 64f7be12e9..552e983961 100644
--- a/packages/server/yarn.lock
+++ b/packages/server/yarn.lock
@@ -1014,10 +1014,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
-"@budibase/backend-core@1.0.124-alpha.0":
- version "1.0.124-alpha.0"
- resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.124-alpha.0.tgz#33a9408206088da49154710910dafc8088d864d2"
- integrity sha512-0ZUkDeqaoXS9qyK91SjwokYEA1wUPhi48nFE0+UwBloF8i7zVDFp2kOX7VNUrUer4gLuND9BoihEdpqsdQDvAg==
+"@budibase/backend-core@1.0.130-alpha.0":
+ version "1.0.130-alpha.0"
+ resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.0.tgz#f6da46473f52d3e513a5eb7f352ae3bde6e61b78"
+ integrity sha512-DPuqEN8/OHFWPpUcfofjQ33lijsAKGDKc0DEF0QgLJOp2kMtBJa80tGjzTxccCZaFkCC2P5p+8kkMxKZQ6vYdA==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@@ -1091,12 +1091,12 @@
svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0"
-"@budibase/pro@1.0.124-alpha.0":
- version "1.0.124-alpha.0"
- resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.124-alpha.0.tgz#6287a51fa7c19754e44374c209c4aa3480fc3ac9"
- integrity sha512-EgMuh+XSd/9tb3Ej9EZa4Y8hgiS6fHG+tuUwUcTuP6zvHbTijQGPb9075yImUbSc10bS3o41AP2qa2/ZdZKV2w==
+"@budibase/pro@1.0.130-alpha.0":
+ version "1.0.130-alpha.0"
+ resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.0.tgz#ddae5dc39992d7f1c4f021d1e4f5effff687a183"
+ integrity sha512-R8DvPQ6hpLChOSp0BONwrCHOgYrYDO4r2tF8KzEg4uycZ+jbaKQJs2lZ8wdkCbXGjAHIcRNt+4RKUfa9r2epJw==
dependencies:
- "@budibase/backend-core" "1.0.124-alpha.0"
+ "@budibase/backend-core" "1.0.130-alpha.0"
node-fetch "^2.6.1"
"@budibase/standard-components@^0.9.139":
diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json
index e409be78d7..a2a1f05c6d 100644
--- a/packages/string-templates/package.json
+++ b/packages/string-templates/package.json
@@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",
diff --git a/packages/worker/package.json b/packages/worker/package.json
index 29b78d4204..7ac3a44e0c 100644
--- a/packages/worker/package.json
+++ b/packages/worker/package.json
@@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
- "version": "1.0.124-alpha.0",
+ "version": "1.0.130-alpha.0",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@@ -31,9 +31,9 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
- "@budibase/backend-core": "^1.0.124-alpha.0",
- "@budibase/pro": "1.0.124-alpha.0",
- "@budibase/string-templates": "^1.0.124-alpha.0",
+ "@budibase/backend-core": "^1.0.130-alpha.0",
+ "@budibase/pro": "1.0.130-alpha.0",
+ "@budibase/string-templates": "^1.0.130-alpha.0",
"@koa/router": "^8.0.0",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "^0.3.0",
diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock
index 405845b896..57b402d43b 100644
--- a/packages/worker/yarn.lock
+++ b/packages/worker/yarn.lock
@@ -293,10 +293,10 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
-"@budibase/backend-core@1.0.124-alpha.0":
- version "1.0.124-alpha.0"
- resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.124-alpha.0.tgz#33a9408206088da49154710910dafc8088d864d2"
- integrity sha512-0ZUkDeqaoXS9qyK91SjwokYEA1wUPhi48nFE0+UwBloF8i7zVDFp2kOX7VNUrUer4gLuND9BoihEdpqsdQDvAg==
+"@budibase/backend-core@1.0.130-alpha.0":
+ version "1.0.130-alpha.0"
+ resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.0.tgz#f6da46473f52d3e513a5eb7f352ae3bde6e61b78"
+ integrity sha512-DPuqEN8/OHFWPpUcfofjQ33lijsAKGDKc0DEF0QgLJOp2kMtBJa80tGjzTxccCZaFkCC2P5p+8kkMxKZQ6vYdA==
dependencies:
"@techpass/passport-openidconnect" "^0.3.0"
aws-sdk "^2.901.0"
@@ -321,12 +321,12 @@
uuid "^8.3.2"
zlib "^1.0.5"
-"@budibase/pro@1.0.124-alpha.0":
- version "1.0.124-alpha.0"
- resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.124-alpha.0.tgz#6287a51fa7c19754e44374c209c4aa3480fc3ac9"
- integrity sha512-EgMuh+XSd/9tb3Ej9EZa4Y8hgiS6fHG+tuUwUcTuP6zvHbTijQGPb9075yImUbSc10bS3o41AP2qa2/ZdZKV2w==
+"@budibase/pro@1.0.130-alpha.0":
+ version "1.0.130-alpha.0"
+ resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.0.tgz#ddae5dc39992d7f1c4f021d1e4f5effff687a183"
+ integrity sha512-R8DvPQ6hpLChOSp0BONwrCHOgYrYDO4r2tF8KzEg4uycZ+jbaKQJs2lZ8wdkCbXGjAHIcRNt+4RKUfa9r2epJw==
dependencies:
- "@budibase/backend-core" "1.0.124-alpha.0"
+ "@budibase/backend-core" "1.0.130-alpha.0"
node-fetch "^2.6.1"
"@cspotcode/source-map-consumer@0.8.0":