1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

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 7e10dc16b3
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
# 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

View file

@ -37,3 +37,9 @@
{/if}
<span class="spectrum-Menu-itemLabel"><slot /></span>
</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,
"projectId": "bmbemn",
"env": {

View file

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

View file

@ -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}`
)
}

View file

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

View file

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

View file

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

View file

@ -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)

View file

@ -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")
}
}
</script>
{#if checked}
{#if loaded}
<slot />
{/if}

View file

@ -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`)
}
}
</script>

View file

@ -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" },
]
</script>
@ -89,7 +89,7 @@
<MenuItem icon="LogOut" on:click={auth.logout}>Log out</MenuItem>
</ActionMenu>
</div>
<div>
<div class="content">
<slot />
</div>
</div>
@ -100,17 +100,20 @@
<style>
.container {
min-height: 100vh;
height: 100%;
display: grid;
grid-template-columns: 250px 1fr;
align-items: stretch;
}
.nav {
background: var(--background);
border-right: var(--border-light);
overflow: auto;
}
.main {
display: grid;
grid-template-rows: auto 1fr;
overflow: hidden;
}
.branding {
display: grid;
@ -156,4 +159,7 @@
text-overflow: ellipsis;
font-weight: 500;
}
.content {
overflow: auto;
}
</style>

View file

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

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

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

View file

@ -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",

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-session": "5.12.0",
"koa-static": "5.0.0",
"lodash": "4.17.13",
"lodash": "4.17.21",
"mongodb": "3.6.3",
"mssql": "6.2.3",
"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"
integrity sha1-TUjtfpgJWwYyWCunFNP/iuj7HbY=
lodash@4.17.13:
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:
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.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
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"
handlebars@^4.0.11, handlebars@^4.7.6:
version "4.7.6"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e"
integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==
version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
dependencies:
minimist "^1.2.5"
neo-async "^2.6.0"
@ -3339,9 +3339,9 @@ lodash.templatesettings@^4.0.0:
lodash._reinterpolate "^3.0.0"
lodash@^4.17.19, lodash@^4.17.20:
version "4.17.20"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log-ok@^0.1.1:
version "0.1.1"