-
+
{name}
diff --git a/packages/builder/src/components/start/AppList.svelte b/packages/builder/src/components/start/AppList.svelte
index 0349f1cd8d..33c8d765f9 100644
--- a/packages/builder/src/components/start/AppList.svelte
+++ b/packages/builder/src/components/start/AppList.svelte
@@ -13,13 +13,13 @@
{/each}
{:else}
- No apps
+ No apps found.
{/if}
diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte
index 9202343322..3cbdaa3f34 100644
--- a/packages/builder/src/components/start/CreateAppModal.svelte
+++ b/packages/builder/src/components/start/CreateAppModal.svelte
@@ -112,7 +112,7 @@
}
const userResp = await api.post(`/api/users/metadata/self`, user)
await userResp.json()
- $goto(`./${appJson._id}`)
+ window.location = `/builder/app/${appJson._id}`
} catch (error) {
console.error(error)
notifications.error(error)
diff --git a/packages/builder/src/pages/app/_layout.svelte b/packages/builder/src/pages/builder/_layout.svelte
similarity index 51%
rename from packages/builder/src/pages/app/_layout.svelte
rename to packages/builder/src/pages/builder/_layout.svelte
index fdc9bc2251..b15001b788 100644
--- a/packages/builder/src/pages/app/_layout.svelte
+++ b/packages/builder/src/pages/builder/_layout.svelte
@@ -4,24 +4,30 @@
import { auth } from "stores/backend"
import { admin } from "stores/portal"
- let checked = false
+ let loaded = false
+ $: hasAdminUser = !!$admin?.checklist?.adminUser
onMount(async () => {
await admin.init()
await auth.checkAuth()
- if (!$admin?.checklist?.adminUser) {
- $goto("./admin")
- }
- checked = true
+ loaded = true
})
+ // Force creation of an admin user if one doesn't exist
$: {
- if (checked && !$auth.user) {
+ if (loaded && !hasAdminUser) {
+ $goto("./admin")
+ }
+ }
+
+ // Redirect to log in at any time if the user isn't authenticated
+ $: {
+ if (loaded && hasAdminUser && !$auth.user) {
$goto("./auth/login")
}
}
-{#if checked}
+{#if loaded}
{/if}
diff --git a/packages/builder/src/pages/app/admin/index.svelte b/packages/builder/src/pages/builder/admin/index.svelte
similarity index 85%
rename from packages/builder/src/pages/app/admin/index.svelte
rename to packages/builder/src/pages/builder/admin/index.svelte
index 9bcc6029c6..d3027f881e 100644
--- a/packages/builder/src/pages/app/admin/index.svelte
+++ b/packages/builder/src/pages/builder/admin/index.svelte
@@ -2,15 +2,14 @@
import {
Button,
Heading,
- Label,
notifications,
Layout,
Input,
Body,
} from "@budibase/bbui"
import { goto } from "@roxi/routify"
- import { onMount } from "svelte"
import api from "builderStore/api"
+ import { admin } from "stores/portal"
let adminUser = {}
@@ -18,13 +17,15 @@
try {
// Save the admin user
const response = await api.post(`/api/admin/users/init`, adminUser)
-
const json = await response.json()
- if (response.status !== 200) throw new Error(json.message)
- notifications.success(`Admin user created.`)
+ if (response.status !== 200) {
+ throw new Error(json.message)
+ }
+ notifications.success(`Admin user created`)
+ await admin.init()
$goto("../portal")
} catch (err) {
- notifications.error(`Failed to create admin user.`)
+ notifications.error(`Failed to create admin user`)
}
}
diff --git a/packages/builder/src/pages/app/builder/[application]/_reset.svelte b/packages/builder/src/pages/builder/app/[application]/_reset.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/_reset.svelte
rename to packages/builder/src/pages/builder/app/[application]/_reset.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/automate/[automation]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automate/[automation]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/automate/[automation]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/automate/[automation]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/automate/[automation]/index.svelte b/packages/builder/src/pages/builder/app/[application]/automate/[automation]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/automate/[automation]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/automate/[automation]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/automate/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/automate/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/automate/index.svelte b/packages/builder/src/pages/builder/app/[application]/automate/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/automate/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/automate/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/[selectedDatasource]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/datasource/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/datasource/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/datasource/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/datasource/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/[selectedRow]/[selectedField]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/[selectedRow]/[selectedField]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/[selectedRow]/[selectedField]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/[selectedRow]/[selectedField]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/[selectedRow]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/[selectedRow]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/[selectedRow]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/[selectedRow]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/[selectedTable]/relationship/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/relationship/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/table/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/table/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/table/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/table/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/view/[selectedView]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/view/[selectedView]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/data/view/[selectedView]/index.svelte b/packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/data/view/[selectedView]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/deploy/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/deploy/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/deploy/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/deploy/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/deploy/index.svelte b/packages/builder/src/pages/builder/app/[application]/deploy/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/deploy/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/deploy/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/design/[assetType]/[asset]/_fallback.svelte b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/[asset]/_fallback.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/design/[assetType]/[asset]/_fallback.svelte
rename to packages/builder/src/pages/builder/app/[application]/design/[assetType]/[asset]/_fallback.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/design/[assetType]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/design/[assetType]/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/design/[assetType]/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/design/[assetType]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/design/[assetType]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/design/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/design/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/design/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/design/index.svelte b/packages/builder/src/pages/builder/app/[application]/design/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/design/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/design/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/index.svelte b/packages/builder/src/pages/builder/app/[application]/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/index.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/settings/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/settings/_layout.svelte
rename to packages/builder/src/pages/builder/app/[application]/settings/_layout.svelte
diff --git a/packages/builder/src/pages/app/builder/[application]/settings/index.svelte b/packages/builder/src/pages/builder/app/[application]/settings/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/[application]/settings/index.svelte
rename to packages/builder/src/pages/builder/app/[application]/settings/index.svelte
diff --git a/packages/builder/src/pages/app/builder/index.svelte b/packages/builder/src/pages/builder/app/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/builder/index.svelte
rename to packages/builder/src/pages/builder/app/index.svelte
diff --git a/packages/builder/src/pages/app/auth/index.svelte b/packages/builder/src/pages/builder/auth/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/auth/index.svelte
rename to packages/builder/src/pages/builder/auth/index.svelte
diff --git a/packages/builder/src/pages/app/auth/login.svelte b/packages/builder/src/pages/builder/auth/login.svelte
similarity index 100%
rename from packages/builder/src/pages/app/auth/login.svelte
rename to packages/builder/src/pages/builder/auth/login.svelte
diff --git a/packages/builder/src/pages/app/index.svelte b/packages/builder/src/pages/builder/index.svelte
similarity index 100%
rename from packages/builder/src/pages/app/index.svelte
rename to packages/builder/src/pages/builder/index.svelte
diff --git a/packages/builder/src/pages/app/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte
similarity index 84%
rename from packages/builder/src/pages/app/portal/_layout.svelte
rename to packages/builder/src/pages/builder/portal/_layout.svelte
index 518e1ecb24..5019edb56e 100644
--- a/packages/builder/src/pages/app/portal/_layout.svelte
+++ b/packages/builder/src/pages/builder/portal/_layout.svelte
@@ -35,19 +35,19 @@
onMount(getInfo)
let menu = [
- { title: "Apps", href: "/app/portal/apps" },
- { title: "Drafts", href: "/app/portal/drafts" },
- { title: "Users", href: "/app/portal/users", heading: "Manage" },
- { title: "Groups", href: "/app/portal/groups" },
- { title: "Auth", href: "/app/portal/oauth" },
- { title: "Email", href: "/app/portal/email" },
+ { title: "Apps", href: "/builder/portal/apps" },
+ { title: "Drafts", href: "/builder/portal/drafts" },
+ { title: "Users", href: "/builder/portal/users", heading: "Manage" },
+ { title: "Groups", href: "/builder/portal/groups" },
+ { title: "Auth", href: "/builder/portal/oauth" },
+ { title: "Email", href: "/builder/portal/email" },
{
title: "General",
- href: "/app/portal/settings/general",
+ href: "/builder/portal/settings/general",
heading: "Settings",
},
- { title: "Theming", href: "/app/portal/theming" },
- { title: "Account", href: "/app/portal/account" },
+ { title: "Theming", href: "/builder/portal/theming" },
+ { title: "Account", href: "/builder/portal/account" },
]
@@ -100,17 +100,20 @@
diff --git a/packages/builder/src/pages/app/portal/apps/_layout.svelte b/packages/builder/src/pages/builder/portal/apps/_layout.svelte
similarity index 100%
rename from packages/builder/src/pages/app/portal/apps/_layout.svelte
rename to packages/builder/src/pages/builder/portal/apps/_layout.svelte
diff --git a/packages/builder/src/pages/app/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte
similarity index 99%
rename from packages/builder/src/pages/app/portal/apps/index.svelte
rename to packages/builder/src/pages/builder/portal/apps/index.svelte
index 294c1a4f97..5062248e11 100644
--- a/packages/builder/src/pages/app/portal/apps/index.svelte
+++ b/packages/builder/src/pages/builder/portal/apps/index.svelte
@@ -65,7 +65,7 @@
{#if layout === "grid"}
{:else}
- Table
+ Table view.
{/if}