Prefix builder URLs with 'builder' in both routify and vite to lay groundwork for server proxying

This commit is contained in:
Andrew Kingston 2021-03-31 19:27:52 +01:00
parent db0e234858
commit 80f819255d
38 changed files with 10 additions and 116 deletions

View File

@ -11,7 +11,7 @@
const id = $params.application const id = $params.application
await del(`/api/applications/${id}`) await del(`/api/applications/${id}`)
loading = false loading = false
$goto("/") $goto("/builder/")
} }
</script> </script>

View File

@ -31,7 +31,11 @@
<Heading small black>{name}</Heading> <Heading small black>{name}</Heading>
<Spacer medium /> <Spacer medium />
<div class="card-footer" data-cy={`app-${name}`}> <div class="card-footer" data-cy={`app-${name}`}>
<TextButton text medium blue href="/{_id}">Open {name}</TextButton> <TextButton text medium blue href="/builder/{_id}">
Open
{name}
</TextButton>
{#if appExportLoading} {#if appExportLoading}
<Spinner size="10" /> <Spinner size="10" />
{:else}<i class="ri-folder-download-line" on:click={exportApp} />{/if} {:else}<i class="ri-folder-download-line" on:click={exportApp} />{/if}

View File

@ -167,7 +167,7 @@
} }
const userResp = await api.post(`/api/users`, user) const userResp = await api.post(`/api/users`, user)
const json = await userResp.json() const json = await userResp.json()
$goto(`/${appJson._id}`) $goto(`./${appJson._id}`)
} catch (error) { } catch (error) {
console.error(error) console.error(error)
notifier.danger(error) notifier.danger(error)

View File

@ -51,7 +51,7 @@
<img <img
src="/assets/bb-logo.svg" src="/assets/bb-logo.svg"
alt="budibase icon" alt="budibase icon"
on:click={() => $goto(`/`)} /> on:click={() => $goto(`/builder/`)} />
</button> </button>
<!-- This gets all indexable subroutes and sticks them in the top nav. --> <!-- This gets all indexable subroutes and sticks them in the top nav. -->

View File

@ -56,7 +56,7 @@
<div class="container"> <div class="container">
<div class="header"> <div class="header">
<Heading medium black>Welcome to the Budibase Beta 123</Heading> <Heading medium black>Welcome to the Budibase Beta</Heading>
<div class="button-group"> <div class="button-group">
<Button secondary on:click={initiateAppImport}>Import Web App</Button> <Button secondary on:click={initiateAppImport}>Import Web App</Button>
<Spacer medium /> <Spacer medium />

View File

@ -1,111 +0,0 @@
export const componentsAndScreens = () => ({
components: [
{
_instanceName: "TextBox",
tags: ["Text", "input"],
children: false,
props: {
size: { type: "options", options: ["small", "medium", "large"] },
isPassword: "bool",
placeholder: "string",
label: "string",
},
},
{
_instanceName: "Button",
tags: ["input"],
children: true,
props: {
size: { type: "options", options: ["small", "medium", "large"] },
css: "string",
contentText: "string",
},
},
{
_instanceName: "div",
tags: ["input"],
props: {
width: "number",
},
},
{
_instanceName: "Row View",
tags: ["row"],
props: {
data: "state",
},
},
],
screens: [
{
props: {
_component: "budibase-components/TextBox",
_instanceName: "SmallTextbox",
size: "small",
},
},
{
name: "common/PasswordBox",
tags: ["mask"],
props: {
_component: "budibase-components/TextBox",
_instanceName: "PasswordBox",
isPassword: true,
size: "small",
},
},
{
props: {
_component: "budibase-components/Button",
_instanceName: "PrimaryButton",
css: "btn-primary",
},
},
{
route: "",
props: {
_component: "budibase-components/div",
width: 100,
_instanceName: "Screen 1",
_children: [
{
_component: "budibase-components/Button",
contentText: "Button 1",
_instanceName: "Button 1",
},
{
_component: "budibase-components/Button",
contentText: "Button 2",
_instanceName: "Button 2",
},
{
_component: "budibase-components/TextBox",
_instanceName: "TextBox",
isPassword: true,
size: "small",
},
],
},
},
{
props: {
_component: "budibase-components/div",
_instanceName: "Field",
_children: [
{
_component: "common/SmallTextbox",
},
],
},
},
],
})
export const stripStandardProps = props => {
delete props._id
delete props._styles
}

View File

@ -6,6 +6,7 @@ import path from "path"
export default ({ mode }) => { export default ({ mode }) => {
const isProduction = mode === "production" const isProduction = mode === "production"
return { return {
base: "/builder/",
build: { build: {
minify: isProduction, minify: isProduction,
}, },