From 91bf0d7a98de9bc9ff35e2dc1ff95b60ab4fe6b9 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 6 May 2021 10:28:06 +0100 Subject: [PATCH] budibase config checklist complete --- .../components/common/ConfigChecklist.svelte | 60 +++++++++++++++++++ packages/builder/src/pages/_layout.svelte | 17 ++---- .../builder/src/pages/portal/_layout.svelte | 10 +++- packages/builder/src/stores/portal/admin.js | 32 +++++++++- 4 files changed, 102 insertions(+), 17 deletions(-) create mode 100644 packages/builder/src/components/common/ConfigChecklist.svelte diff --git a/packages/builder/src/components/common/ConfigChecklist.svelte b/packages/builder/src/components/common/ConfigChecklist.svelte new file mode 100644 index 0000000000..3c1355860a --- /dev/null +++ b/packages/builder/src/components/common/ConfigChecklist.svelte @@ -0,0 +1,60 @@ + + + +
+ +
+ +
+ Get Started Checklist + +
+
+ {#each Object.keys($admin.checklist) as checklistItem, idx} + +
+ {idx + 1}. {MESSAGES[checklistItem]} + +
+
+ {/each} +
+ + diff --git a/packages/builder/src/pages/_layout.svelte b/packages/builder/src/pages/_layout.svelte index 656f769fc5..ce10dc8c91 100644 --- a/packages/builder/src/pages/_layout.svelte +++ b/packages/builder/src/pages/_layout.svelte @@ -5,7 +5,7 @@ SideNavigation as Navigation, SideNavigationItem as Item, } from "@budibase/bbui" - import { auth } from "stores/backend" + import { admin } from "stores/portal" import LoginForm from "components/login/LoginForm.svelte" import BuilderSettingsButton from "components/start/BuilderSettingsButton.svelte" import LogoutButton from "components/start/LogoutButton.svelte" @@ -14,21 +14,16 @@ let checklist - async function fetchConfigChecklist() { - const response = await api.get("/api/admin/configs/checklist") - return await response.json() - } - onMount(async () => { - const response = await fetchConfigChecklist() - if (!response.adminUser) { + await admin.init() + if (!$admin?.checklist?.adminUser) { $goto("./admin") + } else { + $goto("./portal") } - - checklist = response }) -{#if checklist} +{#if $admin.checklist} {/if} diff --git a/packages/builder/src/pages/portal/_layout.svelte b/packages/builder/src/pages/portal/_layout.svelte index 671fdcf1f2..715af9e95d 100644 --- a/packages/builder/src/pages/portal/_layout.svelte +++ b/packages/builder/src/pages/portal/_layout.svelte @@ -2,7 +2,11 @@ import { isActive, url, goto } from "@roxi/routify" import { onMount } from "svelte" import { + ActionMenu, + Checkbox, + MenuItem, Icon, + Heading, Avatar, Search, Layout, @@ -11,13 +15,13 @@ SideNavigationItem as Item, } from "@budibase/bbui" import api from "builderStore/api" - import { organisation } from "stores/portal" + import ConfigChecklist from "components/common/ConfigChecklist.svelte" + import { organisation, admin } from "stores/portal" organisation.init() let orgName let orgLogo - let onBoardingProgress let user async function getInfo() { @@ -55,7 +59,7 @@ {$organisation?.company}
- +