From efb50f005091ccda968ad17170d55733b8a535e7 Mon Sep 17 00:00:00 2001 From: Peter Clement Date: Wed, 8 Dec 2021 18:51:24 +0000 Subject: [PATCH] add option to change icon / colour --- packages/bbui/src/Form/Core/Picker.svelte | 23 ++-- packages/bbui/src/Form/Core/Search.svelte | 3 +- packages/bbui/src/Form/Search.svelte | 2 + .../src/components/start/AppRow.svelte | 28 ++-- .../components/start/ChooseIconModal.svelte | 126 ++++++++++++++++++ .../components/start/CreateAppModal.svelte | 31 +---- .../src/components/start/TemplateList.svelte | 38 +----- .../pages/builder/portal/apps/index.svelte | 62 +++++++-- packages/builder/src/stores/portal/apps.js | 22 +++ 9 files changed, 237 insertions(+), 98 deletions(-) create mode 100644 packages/builder/src/components/start/ChooseIconModal.svelte diff --git a/packages/bbui/src/Form/Core/Picker.svelte b/packages/bbui/src/Form/Core/Picker.svelte index 5f4da1cad9..4f5f2ddd85 100644 --- a/packages/bbui/src/Form/Core/Picker.svelte +++ b/packages/bbui/src/Form/Core/Picker.svelte @@ -6,6 +6,7 @@ import { createEventDispatcher } from "svelte" import clickOutside from "../../Actions/click_outside" import Search from "./Search.svelte" + import Icon from "../../Icon/Icon.svelte" export let id = null export let disabled = false @@ -159,17 +160,21 @@ > {#if getOptionIcon(option, idx)} - icon + {#if getOptionIcon(option, idx).includes("assets")} + icon + {:else}{/if} + + {/if} + {#if getOptionLabel(option, idx)} + + {getOptionLabel(option, idx)} {/if} - - {getOptionLabel(option, idx)} -
diff --git a/packages/bbui/src/Form/Search.svelte b/packages/bbui/src/Form/Search.svelte index b5a6c17b4a..25dd98306b 100644 --- a/packages/bbui/src/Form/Search.svelte +++ b/packages/bbui/src/Form/Search.svelte @@ -9,6 +9,7 @@ export let placeholder = null export let disabled = false export let updateOnChange = true + export let quiet = false const dispatch = createEventDispatcher() const onChange = e => { @@ -23,6 +24,7 @@ {disabled} {value} {placeholder} + {quiet} on:change={onChange} on:click on:input diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index 8dbe428dde..2a2de3ed7d 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -1,6 +1,6 @@
-
-
editApp(app)}> - - {app.name} - +
+
+ +
+
editApp(app)}> + + {app.name} + +
@@ -53,15 +62,11 @@ updateApp(app)} icon="Edit">Edit deleteApp(app)} icon="Delete">Delete {/if} + editIcon(app)} icon="Edit">Edit Icon
diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index 75df17e532..61b36e1301 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -1,15 +1,9 @@ - {#await templatesPromise} -
- -
- {:then templates} - {#if templates?.length > 0} - Select a template below, or start from scratch. - {:else} - Start your app from scratch below. - {/if} -
- {#each templates as template} -
onSelect(template)}> -
- -
- {template.name} -

{template?.category?.toUpperCase()}

-
- {/each} -
- {:catch err} -

{err}

- {/await}
onSelect(null)}>
{ + selectedApp = app + iconModal.show() + } + const exportApp = app => { const id = app.deployed ? app.prodId : app.devId const appName = encodeURIComponent(app.name) @@ -279,7 +287,7 @@ - +
Welcome to Budibase @@ -287,32 +295,45 @@ {#if cloud} {/if} - - + +
- Manage your apps and get a head start with templates +
+ Manage your apps and get a head start with templates +
Quick Start Templates
- {#each templates as val} -
+ {#each templates as item} +
{ + template = item + creationModal.show() + creatingApp = true + }} + class="template-card" + >
-
+
- +
- {val.name} + {item.name}
- {val.category.toUpperCase()} + {item.category.toUpperCase()}
@@ -326,6 +347,7 @@