From 6958e860ef5892a8972dc4b6400bfbf47a87bf0e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 6 May 2021 22:28:50 +0100 Subject: [PATCH] Improve app list styles --- .../builder/src/components/start/AppList.svelte | 4 ++-- .../src/components/start/CreateAppModal.svelte | 2 +- packages/builder/src/pages/app/_layout.svelte | 14 +++++++++----- .../builder/src/pages/app/portal/apps/index.svelte | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) 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..003df10c8f 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}`) + $goto(`/app/builder/${appJson._id}/design`) } catch (error) { console.error(error) notifications.error(error) diff --git a/packages/builder/src/pages/app/_layout.svelte b/packages/builder/src/pages/app/_layout.svelte index fdc9bc2251..e607337761 100644 --- a/packages/builder/src/pages/app/_layout.svelte +++ b/packages/builder/src/pages/app/_layout.svelte @@ -4,24 +4,28 @@ 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) { + loaded = true + + // Force creation of an admin user if one doesn't exist + if (!hasAdminUser) { $goto("./admin") } - checked = true }) + // Redirect to log in at any time if the user isn't authenticated $: { - if (checked && !$auth.user) { + if (loaded && hasAdminUser && !$auth.user) { $goto("./auth/login") } } -{#if checked} +{#if loaded} {/if} diff --git a/packages/builder/src/pages/app/portal/apps/index.svelte b/packages/builder/src/pages/app/portal/apps/index.svelte index 294c1a4f97..5062248e11 100644 --- a/packages/builder/src/pages/app/portal/apps/index.svelte +++ b/packages/builder/src/pages/app/portal/apps/index.svelte @@ -65,7 +65,7 @@ {#if layout === "grid"} {:else} - Table + Table view. {/if}