From 2a15ac97bbd02386cc1ebf22596947765333a4d8 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Mon, 27 Jun 2022 14:28:25 +0100 Subject: [PATCH] adding endpoint to cloud to check for beta access --- .../builder/app/[application]/_layout.svelte | 15 ++++++-- packages/builder/vite.config.js | 3 ++ packages/frontend-core/src/api/other.js | 9 +++++ packages/server/src/api/controllers/dev.js | 38 ++++++++++++++++++- packages/server/src/api/routes/dev.js | 1 + packages/server/yarn.lock | 27 +++++-------- packages/worker/yarn.lock | 18 ++++----- 7 files changed, 79 insertions(+), 32 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index 130bc386ac..5f0710338a 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -24,6 +24,7 @@ // Get Package and set store let promise = getPackage() + let betaAccess = false // Sync once when you load the app let hasSynced = false @@ -74,6 +75,9 @@ if (!hasSynced && application) { try { await API.syncApp(application) + // check if user has beta access + const betaResponse = await API.checkBetaAccess($auth?.user?.email) + betaAccess = betaResponse.access } catch (error) { notifications.error("Failed to sync with production database") } @@ -91,9 +95,14 @@
{:then _}
- - Try the all new budibase design interface. - + {#if betaAccess} + + Try the all new budibase design interface. + + {/if}