-
diff --git a/packages/builder/index.html b/packages/builder/index.html
index d6f19a2d43..de8f8a6beb 100644
--- a/packages/builder/index.html
+++ b/packages/builder/index.html
@@ -3,7 +3,7 @@
-
Budibase Builder
+
Budibase
diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js
index 6fecda84c0..bd849c834f 100644
--- a/packages/builder/src/builderStore/index.js
+++ b/packages/builder/src/builderStore/index.js
@@ -2,6 +2,7 @@ import { getFrontendStore } from "./store/frontend"
import { getAutomationStore } from "./store/automation"
import { getHostingStore } from "./store/hosting"
import { getThemeStore } from "./store/theme"
+import { getAdminStore } from "./store/admin"
import { derived, writable } from "svelte/store"
import analytics from "analytics"
import { FrontendTypes, LAYOUT_NAMES } from "../constants"
@@ -11,6 +12,7 @@ export const store = getFrontendStore()
export const automationStore = getAutomationStore()
export const themeStore = getThemeStore()
export const hostingStore = getHostingStore()
+export const adminPanelStore = getAdminStore()
export const currentAsset = derived(store, $store => {
const type = $store.currentFrontEndType
diff --git a/packages/builder/src/builderStore/store/admin.js b/packages/builder/src/builderStore/store/admin.js
new file mode 100644
index 0000000000..dcf7fef485
--- /dev/null
+++ b/packages/builder/src/builderStore/store/admin.js
@@ -0,0 +1,11 @@
+import { writable } from "svelte/store"
+
+const INITIAL_ADMIN_STATE = {
+ oauth: [],
+}
+
+export const getAdminStore = () => {
+ const store = writable({ ...INITIAL_ADMIN_STATE })
+ store.actions = {}
+ return store
+}
diff --git a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte
index 36e0d1661c..de5400d0ba 100644
--- a/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte
+++ b/packages/builder/src/components/design/NavigationPanel/FrontendNavigatePane.svelte
@@ -119,10 +119,6 @@
top: var(--spacing-l);
right: var(--spacing-xl);
}
- .title i:hover {
- cursor: pointer;
- color: var(--blue);
- }
.role-select {
display: flex;
diff --git a/packages/builder/src/pages/builder/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte
index c01de46334..de657a63ac 100644
--- a/packages/builder/src/pages/builder/_layout.svelte
+++ b/packages/builder/src/pages/builder/_layout.svelte
@@ -16,11 +16,14 @@
{#if $auth.user}
-
+
+
+
- Apps
+ - OAuth
-
Hosting
diff --git a/packages/builder/src/pages/index.svelte b/packages/builder/src/pages/index.svelte
new file mode 100644
index 0000000000..bb0361f273
--- /dev/null
+++ b/packages/builder/src/pages/index.svelte
@@ -0,0 +1 @@
+Index route
diff --git a/packages/builder/src/pages/portal/_layout.svelte b/packages/builder/src/pages/portal/_layout.svelte
new file mode 100644
index 0000000000..c9f6aac4af
--- /dev/null
+++ b/packages/builder/src/pages/portal/_layout.svelte
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
{orgName}
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/builder/src/pages/portal/index.svelte b/packages/builder/src/pages/portal/index.svelte
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/packages/builder/src/pages/portal/oauth/index.svelte b/packages/builder/src/pages/portal/oauth/index.svelte
new file mode 100644
index 0000000000..ac23a9c3a4
--- /dev/null
+++ b/packages/builder/src/pages/portal/oauth/index.svelte
@@ -0,0 +1,118 @@
+
+
+
+
+ OAuth
+
+ Every budibase app comes with basic authentication (email/password)
+ included. You can add additional authentication methods from the options
+ below.
+
+
+
+ {#if google}
+
+
+ {/if}
+
+
+
diff --git a/packages/builder/src/pages/portal/oauth/logos/Google.svelte b/packages/builder/src/pages/portal/oauth/logos/Google.svelte
new file mode 100644
index 0000000000..518a668f75
--- /dev/null
+++ b/packages/builder/src/pages/portal/oauth/logos/Google.svelte
@@ -0,0 +1,38 @@
+
diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js
index db02790ffd..b67aae0a2e 100644
--- a/packages/builder/vite.config.js
+++ b/packages/builder/vite.config.js
@@ -6,7 +6,7 @@ import path from "path"
export default ({ mode }) => {
const isProduction = mode === "production"
return {
- base: "/builder/",
+ base: "/",
build: {
minify: isProduction,
outDir: "../server/builder",
diff --git a/packages/worker/src/api/controllers/admin/configs.js b/packages/worker/src/api/controllers/admin/configs.js
index 0b114a7b0b..790fbcbe35 100644
--- a/packages/worker/src/api/controllers/admin/configs.js
+++ b/packages/worker/src/api/controllers/admin/configs.js
@@ -12,13 +12,10 @@ const GLOBAL_DB = StaticDatabases.GLOBAL.name
exports.save = async function (ctx) {
const db = new CouchDB(GLOBAL_DB)
- const { type, config } = ctx.request.body
- const { group, user } = config
- // insert the type into the doc
- config.type = type
+ const { type, group, user, config } = ctx.request.body
// Config does not exist yet
- if (!config._id) {
+ if (!ctx.request.body._id) {
config._id = generateConfigID({
type,
group,
diff --git a/packages/worker/src/api/routes/admin/configs.js b/packages/worker/src/api/routes/admin/configs.js
index 7bef117a70..9bbc016d1d 100644
--- a/packages/worker/src/api/routes/admin/configs.js
+++ b/packages/worker/src/api/routes/admin/configs.js
@@ -44,6 +44,9 @@ function googleValidation() {
function buildConfigSaveValidation() {
// prettier-ignore
return joiValidator.body(Joi.object({
+ _id: Joi.string(),
+ _rev: Joi.string(),
+ group: Joi.string(),
type: Joi.string().valid(...Object.values(Configs)).required(),
config: Joi.alternatives()
.conditional("type", {
diff --git a/packages/worker/src/utilities/templates.js b/packages/worker/src/utilities/templates.js
index e4d6b7d396..f3fe881b21 100644
--- a/packages/worker/src/utilities/templates.js
+++ b/packages/worker/src/utilities/templates.js
@@ -1,5 +1,5 @@
const CouchDB = require("../db")
-const { getConfigParams, StaticDatabases } = require("@budibase/auth").db
+const { determineScopedConfig, StaticDatabases } = require("@budibase/auth").db
const {
Configs,
TemplateBindings,
@@ -14,12 +14,8 @@ const BASE_COMPANY = "Budibase"
exports.getSettingsTemplateContext = async (purpose, code = null) => {
const db = new CouchDB(StaticDatabases.GLOBAL.name)
- const response = await db.allDocs(
- getConfigParams(Configs.SETTINGS, {
- include_docs: true,
- })
- )
- let settings = response.rows.map(row => row.doc)[0] || {}
+ // TODO: use more granular settings in the future if required
+ const settings = await determineScopedConfig(db, { type: Configs.SETTINGS })
if (!settings.platformUrl) {
settings.platformUrl = LOCAL_URL
}