From 58752cea3e0a9aed1332a2c130b1247bdd7a184e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:14:36 +0100 Subject: [PATCH 01/10] fix view export --- .../src/components/backend/DataTable/ViewDataTable.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 9913333054..a52fbdb177 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -68,5 +68,5 @@ {/if} - + From 0fb17e41b7bf158f064ab70b1e6cb8e961de7ca7 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:26:09 +0100 Subject: [PATCH 02/10] fix table view export in prod --- packages/server/src/api/controllers/view/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/server/src/api/controllers/view/utils.js b/packages/server/src/api/controllers/view/utils.js index 1f3b980882..27fccaf47f 100644 --- a/packages/server/src/api/controllers/view/utils.js +++ b/packages/server/src/api/controllers/view/utils.js @@ -2,6 +2,8 @@ const { ViewNames, generateMemoryViewID, getMemoryViewParams, + DocumentTypes, + SEPARATOR, } = require("../../../db/utils") const env = require("../../../environment") @@ -10,6 +12,11 @@ exports.getView = async (db, viewName) => { const designDoc = await db.get("_design/database") return designDoc.views[viewName] } else { + // This is a table view, don't read the view from the DB + if (viewName.startsWith(DocumentTypes.TABLE + SEPARATOR)) { + return null + } + const viewDoc = await db.get(generateMemoryViewID(viewName)) return viewDoc.view } From b9d067f9518690b0ce88c7555fd50f46e5195d23 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:48:38 +0100 Subject: [PATCH 03/10] CSS fixes for template themes --- packages/builder/src/components/start/TemplateList.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/start/TemplateList.svelte b/packages/builder/src/components/start/TemplateList.svelte index 576415762a..deddd92880 100644 --- a/packages/builder/src/components/start/TemplateList.svelte +++ b/packages/builder/src/components/start/TemplateList.svelte @@ -33,7 +33,10 @@ {/each}
onSelect(null)}> -
+
Start from scratch @@ -74,7 +77,7 @@ align-items: center; cursor: pointer; border-radius: 4px; - background: #1a1a1a; + background: var(--background-alt); padding: 8px 16px; } From f6a52ad92ae10a67888cdeb943cff648acf44650 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 12:03:08 +0100 Subject: [PATCH 04/10] fix intercom createdAt --- packages/builder/src/stores/portal/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/stores/portal/auth.js b/packages/builder/src/stores/portal/auth.js index f522095473..7beb25a1b4 100644 --- a/packages/builder/src/stores/portal/auth.js +++ b/packages/builder/src/stores/portal/auth.js @@ -56,7 +56,7 @@ export function createAuthStore() { analytics.identify(user._id, user) analytics.showChat({ email: user.email, - created_at: user.createdAt || Date.now(), + created_at: (user.createdAt || Date.now()) / 1000, name: user.name, user_id: user._id, tenant: user.tenantId, From dea2c95d804ff2805a95fdfed2f37b25c4c27429 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 12:15:05 +0100 Subject: [PATCH 05/10] fix user ping event --- packages/server/src/api/controllers/analytics.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/analytics.js b/packages/server/src/api/controllers/analytics.js index e6e5d6a748..0c0761840e 100644 --- a/packages/server/src/api/controllers/analytics.js +++ b/packages/server/src/api/controllers/analytics.js @@ -21,9 +21,12 @@ exports.endUserPing = async ctx => { return } - posthogClient.capture("budibase:end_user_ping", { - userId: ctx.user && ctx.user._id, - appId: ctx.appId, + posthogClient.capture({ + event: "budibase:end_user_ping", + distinctId: ctx.user && ctx.user._id, + properties: { + appId: ctx.appId, + }, }) ctx.body = { From f32266df83a8d2f0f017769e4765151a2a6474fe Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 15:39:22 +0100 Subject: [PATCH 06/10] remove currentapp stuff --- packages/server/src/middleware/currentapp.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/server/src/middleware/currentapp.js b/packages/server/src/middleware/currentapp.js index e523850e1d..99f9d2318c 100644 --- a/packages/server/src/middleware/currentapp.js +++ b/packages/server/src/middleware/currentapp.js @@ -4,13 +4,9 @@ const { Cookies } = require("@budibase/auth").constants const { getRole } = require("@budibase/auth/roles") const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") const { generateUserMetadataID } = require("../db/utils") -const { dbExists, getTenantIDFromAppID } = require("@budibase/auth/db") -const { getTenantId } = require("@budibase/auth/tenancy") +const { dbExists } = require("@budibase/auth/db") const { getCachedSelf } = require("../utilities/global") const CouchDB = require("../db") -const env = require("../environment") - -const DEFAULT_TENANT_ID = "default" module.exports = async (ctx, next) => { // try to get the appID from the request @@ -55,15 +51,6 @@ module.exports = async (ctx, next) => { return next() } - // If user and app tenant Ids do not match, 403 - if (env.MULTI_TENANCY && ctx.user) { - const userTenantId = getTenantId() - const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID - if (tenantId !== userTenantId) { - ctx.throw(403, "Cannot access application.") - } - } - ctx.appId = appId if (roleId) { ctx.roleId = roleId From 815f2c98d3b6128f94b3501bbd2134a2b4e1b17c Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 7 Oct 2021 15:41:53 +0100 Subject: [PATCH 07/10] Remove update screen in the cloud --- .../builder/src/pages/builder/portal/_layout.svelte | 13 +++++++++---- .../src/pages/builder/portal/settings/update.svelte | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 02f49bec5a..8fca18d29d 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -46,11 +46,16 @@ title: "Theming", href: "/builder/portal/settings/theming", }, - { - title: "Updates", - href: "/builder/portal/settings/update", - }, ]) + + if (!$adminStore.cloud) { + menu = menu.concat([ + { + title: "Updates", + href: "/builder/portal/settings/update", + }, + ]) + } } else { menu = menu.concat([ { diff --git a/packages/builder/src/pages/builder/portal/settings/update.svelte b/packages/builder/src/pages/builder/portal/settings/update.svelte index 3931203f44..5deb724a7c 100644 --- a/packages/builder/src/pages/builder/portal/settings/update.svelte +++ b/packages/builder/src/pages/builder/portal/settings/update.svelte @@ -10,14 +10,14 @@ Label, } from "@budibase/bbui" import api from "builderStore/api" - import { auth } from "stores/portal" + import { auth, admin } from "stores/portal" import { redirect } from "@roxi/routify" let version // Only admins allowed here $: { - if (!$auth.isAdmin) { + if (!$auth.isAdmin || $admin.cloud) { $redirect("../../portal") } } From 1d55b5ece2d30bb1f281529146b8d88b7360890d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 20:57:50 +0100 Subject: [PATCH 08/10] adding made in budibase tag --- .../design/AppPreview/iframeTemplate.js | 2 +- .../src/components/MadeInBudibase.svelte | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 packages/client/src/components/MadeInBudibase.svelte diff --git a/packages/builder/src/components/design/AppPreview/iframeTemplate.js b/packages/builder/src/components/design/AppPreview/iframeTemplate.js index d992be8cd7..58557273f2 100644 --- a/packages/builder/src/components/design/AppPreview/iframeTemplate.js +++ b/packages/builder/src/components/design/AppPreview/iframeTemplate.js @@ -64,7 +64,7 @@ export default ` appId, theme, customTheme, - previewDevice + previewDevice, } = parsed // Set some flags so the app knows we're in the builder diff --git a/packages/client/src/components/MadeInBudibase.svelte b/packages/client/src/components/MadeInBudibase.svelte new file mode 100644 index 0000000000..2e5d6336f1 --- /dev/null +++ b/packages/client/src/components/MadeInBudibase.svelte @@ -0,0 +1,42 @@ + +
+ Budibase +

Made In Budibase

+
+
+ + From 6357d316a79ac2f0546cf672a49f316ed34254b6 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Oct 2021 20:17:21 +0000 Subject: [PATCH 09/10] v0.9.157-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index d761f49f6d..e59e04bc85 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.156", + "version": "0.9.157-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index c2b70119de..e3f433b43b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 35ae9f46a7..7b6f5810f9 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": "0.9.156", + "version": "0.9.157-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e97c1aa4bd..c716d42e26 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.156", - "@budibase/client": "^0.9.156", + "@budibase/bbui": "^0.9.157-alpha.0", + "@budibase/client": "^0.9.157-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157-alpha.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 32a1fded6d..8242b45e5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.156", + "version": "0.9.157-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 cab9a8fe65..20f97212f6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.156", + "version": "0.9.157-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": "^0.9.156", + "@budibase/bbui": "^0.9.157-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index c1de0be72c..0925ab01b1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/client": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157-alpha.0", + "@budibase/client": "^0.9.157-alpha.0", + "@budibase/string-templates": "^0.9.157-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5914389f5c..c877124f84 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.156", + "version": "0.9.157-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 58284e108b..5c33c4f88f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157-alpha.0", + "@budibase/string-templates": "^0.9.157-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 7f5148a1e1bd5355d23fe2c9a7a4a6bdce7b6c1d Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Oct 2021 21:09:01 +0000 Subject: [PATCH 10/10] v0.9.158-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index b2f38f0ffc..33eb240067 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.157", + "version": "0.9.158-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5db8694df0..2d91bd7dbf 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 9b2aece866..bd088af7e8 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": "0.9.157", + "version": "0.9.158-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index da7efe97db..afdef177c1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.157", - "@budibase/client": "^0.9.157", + "@budibase/bbui": "^0.9.158-alpha.0", + "@budibase/client": "^0.9.158-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.157", + "@budibase/string-templates": "^0.9.158-alpha.0", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 9e3aba144a..70d78a6f1c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.157", + "version": "0.9.158-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 07f579b713..dfed5117f2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.157", + "version": "0.9.158-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": "^0.9.157", + "@budibase/bbui": "^0.9.158-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.157", + "@budibase/string-templates": "^0.9.158-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index bced5dab59..1fb9e080e0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.157", - "@budibase/client": "^0.9.157", - "@budibase/string-templates": "^0.9.157", + "@budibase/auth": "^0.9.158-alpha.0", + "@budibase/client": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 989dd60ff9..204dc49d9e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.157", + "version": "0.9.158-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 2be283ae33..3efafebca8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.157", - "@budibase/string-templates": "^0.9.157", + "@budibase/auth": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",