From 9e41b9cd8f2ef4c85bc1069f089897b9c9cd38c1 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 5 Oct 2021 23:49:32 +0100 Subject: [PATCH] UX improvements --- .../components/start/OnboardingModal.svelte | 25 +++++++++++-------- .../src/components/start/TemplateList.svelte | 19 ++++++-------- .../pages/builder/portal/apps/index.svelte | 6 ++--- .../server/src/utilities/fileSystem/index.js | 11 ++++---- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/packages/builder/src/components/start/OnboardingModal.svelte b/packages/builder/src/components/start/OnboardingModal.svelte index 16d95135a2..a6a66201dd 100644 --- a/packages/builder/src/components/start/OnboardingModal.svelte +++ b/packages/builder/src/components/start/OnboardingModal.svelte @@ -1,6 +1,6 @@ {#if step === 0} { - nextStep() - return false - }} + onConfirm={nextStep} >

Welcome to Budibase!

-

We're different from other development tools in some really special ways, so we'd like to take you through them. @@ -46,10 +51,8 @@ { - nextStep() - return false - }} + size="L" + onConfirm={nextStep} > One of the coolest things about Budibase is that you don't have to start diff --git a/packages/builder/src/components/start/TemplateList.svelte b/packages/builder/src/components/start/TemplateList.svelte index 38fbb76f62..d555fcf273 100644 --- a/packages/builder/src/components/start/TemplateList.svelte +++ b/packages/builder/src/components/start/TemplateList.svelte @@ -1,5 +1,5 @@ -

+ {#await templatesPromise}
@@ -21,7 +21,7 @@ {:then templates}
{#each templates as template} -
+ template onSelect(template)} @@ -30,13 +30,13 @@ /> {template.name} {template.description} -
+ {/each}
{:catch err}

{err}

{/await} -
+
diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 4f1da5916f..fbff84e64e 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -45,6 +45,7 @@ $: filteredApps = enrichedApps.filter(app => app?.name?.toLowerCase().includes(searchTerm.toLowerCase()) ) + $: loaded && enrichedApps.length === 0 && onboardingModal?.show() const enrichApps = (apps, user, sortBy) => { const enrichedApps = apps.map(app => ({ @@ -199,9 +200,6 @@ onMount(async () => { await apps.load() loaded = true - // TODO: only show when they have not onboarded yet - // If apps = 0 or user isn't onboarded? - onboardingModal.show() }) @@ -321,7 +319,7 @@ - + diff --git a/packages/server/src/utilities/fileSystem/index.js b/packages/server/src/utilities/fileSystem/index.js index 34732e5ebd..0c2da56b58 100644 --- a/packages/server/src/utilities/fileSystem/index.js +++ b/packages/server/src/utilities/fileSystem/index.js @@ -76,8 +76,9 @@ exports.getTemplateStream = async template => { if (template.file) { return fs.createReadStream(template.file.path) } else { - const tmpPath = await exports.downloadTemplate(template.key) - return fs.createReadStream(join(tmpPath, "db", "dump.txt")) + const [type, name] = template.key.split("/") + const tmpPath = await exports.downloadTemplate(type, name) + return fs.createReadStream(join(tmpPath, name, "db", "dump.txt")) } } @@ -218,13 +219,11 @@ exports.deleteApp = async appId => { * @param name * @return {Promise<*>} */ -exports.downloadTemplate = async path => { - const [type, name] = path.split("/") - +exports.downloadTemplate = async (type, name) => { const DEFAULT_TEMPLATES_BUCKET = "prod-budi-templates.s3-eu-west-1.amazonaws.com" const templateUrl = `https://${DEFAULT_TEMPLATES_BUCKET}/templates/${type}/${name}.tar.gz` - return downloadTarball(templateUrl, ObjectStoreBuckets.TEMPLATES, path) + return downloadTarball(templateUrl, ObjectStoreBuckets.TEMPLATES, type) } /**