diff --git a/hosting/envoy.dev.yaml.hbs b/hosting/envoy.dev.yaml.hbs index 5d4192d232..6cb1c804a9 100644 --- a/hosting/envoy.dev.yaml.hbs +++ b/hosting/envoy.dev.yaml.hbs @@ -19,7 +19,7 @@ static_resources: # special case to redirect specifically the route path # to the builder, if this were a prefix then it would break minio - match: { path: "/" } - redirect: { path_redirect: "/app/" } + redirect: { path_redirect: "/builder/" } - match: { prefix: "/db/" } route: @@ -42,14 +42,14 @@ static_resources: route: cluster: builder-dev - - match: { prefix: "/app/" } + - match: { prefix: "/builder/" } route: cluster: builder-dev - - match: { prefix: "/app" } + - match: { prefix: "/builder" } route: cluster: builder-dev - prefix_rewrite: "/app/" + prefix_rewrite: "/builder/" # minio is on the default route because this works # best, minio + AWS SDK doesn't handle path proxy diff --git a/packages/builder/cypress.json b/packages/builder/cypress.json index 236cd3803e..669ee5af34 100644 --- a/packages/builder/cypress.json +++ b/packages/builder/cypress.json @@ -1,5 +1,5 @@ { - "baseUrl": "http://localhost:10000/app/", + "baseUrl": "http://localhost:10000/builder/", "video": true, "projectId": "bmbemn", "env": { diff --git a/packages/builder/src/components/backend/DataTable/Table.svelte b/packages/builder/src/components/backend/DataTable/Table.svelte index d3f4b8cf4b..6555197cb2 100644 --- a/packages/builder/src/components/backend/DataTable/Table.svelte +++ b/packages/builder/src/components/backend/DataTable/Table.svelte @@ -59,7 +59,7 @@ const selectRelationship = ({ tableId, rowId, fieldName }) => { $goto( - `/app/builder/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}` + `/builder/app/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}` ) } diff --git a/packages/builder/src/components/settings/tabs/DangerZone.svelte b/packages/builder/src/components/settings/tabs/DangerZone.svelte index d8a0c27fe7..e941cfd418 100644 --- a/packages/builder/src/components/settings/tabs/DangerZone.svelte +++ b/packages/builder/src/components/settings/tabs/DangerZone.svelte @@ -11,7 +11,7 @@ const id = $params.application await del(`/api/applications/${id}`) loading = false - $goto("/app") + $goto("/builder") } diff --git a/packages/builder/src/components/start/AppCard.svelte b/packages/builder/src/components/start/AppCard.svelte index afeb72f77d..9a14efd81b 100644 --- a/packages/builder/src/components/start/AppCard.svelte +++ b/packages/builder/src/components/start/AppCard.svelte @@ -36,7 +36,7 @@
- + {name} diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 0ce420d83d..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(`/app/builder/${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 84% rename from packages/builder/src/pages/app/_layout.svelte rename to packages/builder/src/pages/builder/_layout.svelte index e607337761..b15001b788 100644 --- a/packages/builder/src/pages/app/_layout.svelte +++ b/packages/builder/src/pages/builder/_layout.svelte @@ -11,12 +11,14 @@ await admin.init() await auth.checkAuth() loaded = true + }) - // Force creation of an admin user if one doesn't exist - if (!hasAdminUser) { + // Force creation of an admin user if one doesn't exist + $: { + if (loaded && !hasAdminUser) { $goto("./admin") } - }) + } // Redirect to log in at any time if the user isn't authenticated $: { 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 87% rename from packages/builder/src/pages/app/portal/_layout.svelte rename to packages/builder/src/pages/builder/portal/_layout.svelte index b044ab7b4c..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" }, ] 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 100% rename from packages/builder/src/pages/app/portal/apps/index.svelte rename to packages/builder/src/pages/builder/portal/apps/index.svelte diff --git a/packages/builder/src/pages/app/portal/index.svelte b/packages/builder/src/pages/builder/portal/index.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/index.svelte rename to packages/builder/src/pages/builder/portal/index.svelte diff --git a/packages/builder/src/pages/app/portal/oauth/index.svelte b/packages/builder/src/pages/builder/portal/oauth/index.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/oauth/index.svelte rename to packages/builder/src/pages/builder/portal/oauth/index.svelte diff --git a/packages/builder/src/pages/app/portal/oauth/logos/Google.svelte b/packages/builder/src/pages/builder/portal/oauth/logos/Google.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/oauth/logos/Google.svelte rename to packages/builder/src/pages/builder/portal/oauth/logos/Google.svelte diff --git a/packages/builder/src/pages/app/portal/settings/_layout.svelte b/packages/builder/src/pages/builder/portal/settings/_layout.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/settings/_layout.svelte rename to packages/builder/src/pages/builder/portal/settings/_layout.svelte diff --git a/packages/builder/src/pages/app/portal/settings/general.svelte b/packages/builder/src/pages/builder/portal/settings/general.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/settings/general.svelte rename to packages/builder/src/pages/builder/portal/settings/general.svelte diff --git a/packages/builder/src/pages/app/portal/settings/index.svelte b/packages/builder/src/pages/builder/portal/settings/index.svelte similarity index 100% rename from packages/builder/src/pages/app/portal/settings/index.svelte rename to packages/builder/src/pages/builder/portal/settings/index.svelte diff --git a/packages/builder/src/pages/index.svelte b/packages/builder/src/pages/index.svelte index 4767d8b38e..5ce4a2c43f 100644 --- a/packages/builder/src/pages/index.svelte +++ b/packages/builder/src/pages/index.svelte @@ -1,4 +1,4 @@ diff --git a/packages/builder/vite.config.js b/packages/builder/vite.config.js index 205c9d9122..69b5730b5b 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: "/app/", + base: "/builder/", build: { minify: isProduction, outDir: "../server/builder",