Merge branch 'next' of github.com:Budibase/budibase into feature/logo-api

This commit is contained in:
mike12345567 2021-05-07 11:41:32 +01:00
commit 045a88feb3
63 changed files with 2623 additions and 77 deletions

View File

@ -19,7 +19,7 @@ static_resources:
# special case to redirect specifically the route path # special case to redirect specifically the route path
# to the builder, if this were a prefix then it would break minio # to the builder, if this were a prefix then it would break minio
- match: { path: "/" } - match: { path: "/" }
redirect: { path_redirect: "/app/" } redirect: { path_redirect: "/builder/" }
- match: { prefix: "/db/" } - match: { prefix: "/db/" }
route: route:
@ -42,14 +42,14 @@ static_resources:
route: route:
cluster: builder-dev cluster: builder-dev
- match: { prefix: "/app/" } - match: { prefix: "/builder/" }
route: route:
cluster: builder-dev cluster: builder-dev
- match: { prefix: "/app" } - match: { prefix: "/builder" }
route: route:
cluster: builder-dev cluster: builder-dev
prefix_rewrite: "/app/" prefix_rewrite: "/builder/"
# minio is on the default route because this works # minio is on the default route because this works
# best, minio + AWS SDK doesn't handle path proxy # best, minio + AWS SDK doesn't handle path proxy

View File

@ -37,3 +37,9 @@
{/if} {/if}
<span class="spectrum-Menu-itemLabel"><slot /></span> <span class="spectrum-Menu-itemLabel"><slot /></span>
</li> </li>
<style>
.spectrum-Menu-itemIcon {
align-self: center;
}
</style>

View File

@ -1,5 +1,5 @@
{ {
"baseUrl": "http://localhost:10000/app/", "baseUrl": "http://localhost:10000/builder/",
"video": true, "video": true,
"projectId": "bmbemn", "projectId": "bmbemn",
"env": { "env": {

View File

@ -74,7 +74,7 @@
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",
"codemirror": "^5.59.0", "codemirror": "^5.59.0",
"downloadjs": "1.4.7", "downloadjs": "1.4.7",
"lodash": "4.17.13", "lodash": "4.17.21",
"posthog-js": "1.4.5", "posthog-js": "1.4.5",
"remixicon": "2.5.0", "remixicon": "2.5.0",
"shortid": "2.2.15", "shortid": "2.2.15",

View File

@ -59,7 +59,7 @@
const selectRelationship = ({ tableId, rowId, fieldName }) => { const selectRelationship = ({ tableId, rowId, fieldName }) => {
$goto( $goto(
`/app/builder/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}` `/builder/app/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}`
) )
} }

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("/app") $goto("/builder")
} }
</script> </script>

View File

@ -36,7 +36,7 @@
<Layout noPadding gap="XS"> <Layout noPadding gap="XS">
<div class="preview" use:gradient /> <div class="preview" use:gradient />
<div class="title"> <div class="title">
<Link href={`/app/builder/${_id}`}> <Link href={`/builder/app/${_id}`}>
<Heading size="XS"> <Heading size="XS">
{name} {name}
</Heading> </Heading>

View File

@ -13,13 +13,13 @@
{/each} {/each}
</div> </div>
{:else} {:else}
<div>No apps</div> <div>No apps found.</div>
{/if} {/if}
<style> <style>
.appList { .appList {
display: grid; display: grid;
grid-gap: 50px; grid-gap: 50px;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
} }
</style> </style>

View File

@ -112,7 +112,7 @@
} }
const userResp = await api.post(`/api/users/metadata/self`, user) const userResp = await api.post(`/api/users/metadata/self`, user)
await userResp.json() await userResp.json()
$goto(`./${appJson._id}`) window.location = `/builder/app/${appJson._id}`
} catch (error) { } catch (error) {
console.error(error) console.error(error)
notifications.error(error) notifications.error(error)

View File

@ -4,24 +4,30 @@
import { auth } from "stores/backend" import { auth } from "stores/backend"
import { admin } from "stores/portal" import { admin } from "stores/portal"
let checked = false let loaded = false
$: hasAdminUser = !!$admin?.checklist?.adminUser
onMount(async () => { onMount(async () => {
await admin.init() await admin.init()
await auth.checkAuth() await auth.checkAuth()
if (!$admin?.checklist?.adminUser) { loaded = true
$goto("./admin")
}
checked = 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") $goto("./auth/login")
} }
} }
</script> </script>
{#if checked} {#if loaded}
<slot /> <slot />
{/if} {/if}

View File

@ -2,15 +2,14 @@
import { import {
Button, Button,
Heading, Heading,
Label,
notifications, notifications,
Layout, Layout,
Input, Input,
Body, Body,
} from "@budibase/bbui" } from "@budibase/bbui"
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
import { onMount } from "svelte"
import api from "builderStore/api" import api from "builderStore/api"
import { admin } from "stores/portal"
let adminUser = {} let adminUser = {}
@ -18,13 +17,15 @@
try { try {
// Save the admin user // Save the admin user
const response = await api.post(`/api/admin/users/init`, adminUser) const response = await api.post(`/api/admin/users/init`, adminUser)
const json = await response.json() const json = await response.json()
if (response.status !== 200) throw new Error(json.message) if (response.status !== 200) {
notifications.success(`Admin user created.`) throw new Error(json.message)
}
notifications.success(`Admin user created`)
await admin.init()
$goto("../portal") $goto("../portal")
} catch (err) { } catch (err) {
notifications.error(`Failed to create admin user.`) notifications.error(`Failed to create admin user`)
} }
} }
</script> </script>

View File

@ -35,19 +35,19 @@
onMount(getInfo) onMount(getInfo)
let menu = [ let menu = [
{ title: "Apps", href: "/app/portal/apps" }, { title: "Apps", href: "/builder/portal/apps" },
{ title: "Drafts", href: "/app/portal/drafts" }, { title: "Drafts", href: "/builder/portal/drafts" },
{ title: "Users", href: "/app/portal/users", heading: "Manage" }, { title: "Users", href: "/builder/portal/users", heading: "Manage" },
{ title: "Groups", href: "/app/portal/groups" }, { title: "Groups", href: "/builder/portal/groups" },
{ title: "Auth", href: "/app/portal/oauth" }, { title: "Auth", href: "/builder/portal/oauth" },
{ title: "Email", href: "/app/portal/email" }, { title: "Email", href: "/builder/portal/email" },
{ {
title: "General", title: "General",
href: "/app/portal/settings/general", href: "/builder/portal/settings/general",
heading: "Settings", heading: "Settings",
}, },
{ title: "Theming", href: "/app/portal/theming" }, { title: "Theming", href: "/builder/portal/theming" },
{ title: "Account", href: "/app/portal/account" }, { title: "Account", href: "/builder/portal/account" },
] ]
</script> </script>
@ -89,7 +89,7 @@
<MenuItem icon="LogOut" on:click={auth.logout}>Log out</MenuItem> <MenuItem icon="LogOut" on:click={auth.logout}>Log out</MenuItem>
</ActionMenu> </ActionMenu>
</div> </div>
<div> <div class="content">
<slot /> <slot />
</div> </div>
</div> </div>
@ -100,17 +100,20 @@
<style> <style>
.container { .container {
min-height: 100vh; height: 100%;
display: grid; display: grid;
grid-template-columns: 250px 1fr; grid-template-columns: 250px 1fr;
align-items: stretch;
} }
.nav { .nav {
background: var(--background); background: var(--background);
border-right: var(--border-light); border-right: var(--border-light);
overflow: auto;
} }
.main { .main {
display: grid; display: grid;
grid-template-rows: auto 1fr; grid-template-rows: auto 1fr;
overflow: hidden;
} }
.branding { .branding {
display: grid; display: grid;
@ -156,4 +159,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
font-weight: 500; font-weight: 500;
} }
.content {
overflow: auto;
}
</style> </style>

View File

@ -65,7 +65,7 @@
{#if layout === "grid"} {#if layout === "grid"}
<AppList /> <AppList />
{:else} {:else}
Table Table view.
{/if} {/if}
</Layout> </Layout>
<Modal <Modal

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,4 +1,4 @@
<script> <script>
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
$goto("./app") $goto("./builder")
</script> </script>

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -109,7 +109,7 @@
"koa-send": "5.0.0", "koa-send": "5.0.0",
"koa-session": "5.12.0", "koa-session": "5.12.0",
"koa-static": "5.0.0", "koa-static": "5.0.0",
"lodash": "4.17.13", "lodash": "4.17.21",
"mongodb": "3.6.3", "mongodb": "3.6.3",
"mssql": "6.2.3", "mssql": "6.2.3",
"mysql": "2.18.1", "mysql": "2.18.1",

View File

@ -6099,12 +6099,7 @@ lodash.xor@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6" resolved "https://registry.yarnpkg.com/lodash.xor/-/lodash.xor-4.5.0.tgz#4d48ed7e98095b0632582ba714d3ff8ae8fb1db6"
integrity sha1-TUjtfpgJWwYyWCunFNP/iuj7HbY= integrity sha1-TUjtfpgJWwYyWCunFNP/iuj7HbY=
lodash@4.17.13: lodash@4.17.21, lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3:
version "4.17.13"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.13.tgz#0bdc3a6adc873d2f4e0c4bac285df91b64fc7b93"
integrity sha512-vm3/XWXfWtRua0FkUyEHBZy8kCPjErNBT9fJx8Zvs+U6zjqPbTUOpkaoum3O5uiA8sm+yNMHXfYkTUHFoMxFNA==
lodash@^4.14.0, lodash@^4.17.11, lodash@^4.17.14, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.3:
version "4.17.21" version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==

View File

@ -2181,9 +2181,9 @@ handlebars-utils@^1.0.2, handlebars-utils@^1.0.4, handlebars-utils@^1.0.6:
typeof-article "^0.1.1" typeof-article "^0.1.1"
handlebars@^4.0.11, handlebars@^4.7.6: handlebars@^4.0.11, handlebars@^4.7.6:
version "4.7.6" version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
dependencies: dependencies:
minimist "^1.2.5" minimist "^1.2.5"
neo-async "^2.6.0" neo-async "^2.6.0"
@ -3339,9 +3339,9 @@ lodash.templatesettings@^4.0.0:
lodash._reinterpolate "^3.0.0" lodash._reinterpolate "^3.0.0"
lodash@^4.17.19, lodash@^4.17.20: lodash@^4.17.19, lodash@^4.17.20:
version "4.17.20" version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log-ok@^0.1.1: log-ok@^0.1.1:
version "0.1.1" version "0.1.1"