From 0cdc814bcc1ccec46bc03f8cd291b733f94e96c0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 27 Oct 2022 19:20:55 +0100 Subject: [PATCH] Add redesign for apps pages --- packages/bbui/src/Layout/Page.svelte | 6 +- .../src/components/common/AppLockModal.svelte | 14 +- .../components/common/TemplateDisplay.svelte | 190 ++++++++---------- .../components/portal/page/Breadcrumb.svelte | 34 ++++ .../components/portal/page/Breadcrumbs.svelte | 20 ++ .../src/components/portal/page/Content.svelte | 27 +++ .../src/components/portal/page/Header.svelte | 31 +++ .../src/components/portal/page/SideNav.svelte | 25 +++ .../components/portal/page/SideNavItem.svelte | 23 +++ .../src/components/portal/page/index.js | 6 + .../src/components/start/AppRow.svelte | 143 +++++++------ .../src/pages/builder/portal/_layout.svelte | 9 +- .../pages/builder/portal/apps/_layout.svelte | 33 +++ .../pages/builder/portal/apps/create.svelte | 118 +++-------- .../pages/builder/portal/apps/index.svelte | 186 ++++------------- .../builder/portal/apps/templates.svelte | 46 +---- 16 files changed, 466 insertions(+), 445 deletions(-) create mode 100644 packages/builder/src/components/portal/page/Breadcrumb.svelte create mode 100644 packages/builder/src/components/portal/page/Breadcrumbs.svelte create mode 100644 packages/builder/src/components/portal/page/Content.svelte create mode 100644 packages/builder/src/components/portal/page/Header.svelte create mode 100644 packages/builder/src/components/portal/page/SideNav.svelte create mode 100644 packages/builder/src/components/portal/page/SideNavItem.svelte create mode 100644 packages/builder/src/components/portal/page/index.js create mode 100644 packages/builder/src/pages/builder/portal/apps/_layout.svelte diff --git a/packages/bbui/src/Layout/Page.svelte b/packages/bbui/src/Layout/Page.svelte index 2996bcc613..de497f396e 100644 --- a/packages/bbui/src/Layout/Page.svelte +++ b/packages/bbui/src/Layout/Page.svelte @@ -1,6 +1,6 @@ @@ -16,8 +16,8 @@ align-items: stretch; max-width: var(--max-width); margin: 0 auto; - padding: calc(var(--spacing-xl) * 2); - min-height: calc(100% - var(--spacing-xl) * 4); + flex: 1 1 auto; + padding-bottom: 50px; } .wide { diff --git a/packages/builder/src/components/common/AppLockModal.svelte b/packages/builder/src/components/common/AppLockModal.svelte index 9794e350d9..4a708fbd83 100644 --- a/packages/builder/src/components/common/AppLockModal.svelte +++ b/packages/builder/src/components/common/AppLockModal.svelte @@ -8,6 +8,7 @@ ProgressCircle, Layout, Body, + Icon, } from "@budibase/bbui" import { auth, apps } from "stores/portal" import { processStringSync } from "@budibase/string-templates" @@ -58,19 +59,14 @@
{#if lockedBy} - + /> {/if}
diff --git a/packages/builder/src/components/common/TemplateDisplay.svelte b/packages/builder/src/components/common/TemplateDisplay.svelte index d6ba4bd8e7..66da437118 100644 --- a/packages/builder/src/components/common/TemplateDisplay.svelte +++ b/packages/builder/src/components/common/TemplateDisplay.svelte @@ -1,128 +1,110 @@ -
- - Templates -
- - { - selectedTemplateCategory = null - }} - > - All - - {#each templateCategories as templateCategoryKey} - { - selectedTemplateCategory = templateCategoryKey - }} - > - {templateCategoryKey} - - {/each} - -
-
-
- -
- - {#each filteredTemplateCategories as templateCategoryKey} -
- {templateCategoryKey} -
- {#each filteredTemplates[templateCategoryKey] as templateEntry} - - {#if !($licensing?.usageMetrics?.apps >= 100)} - - {/if} - +
+ + (selectedCategory = null)} + text="All" + active={selectedCategory == null} + /> + {#each categories as category} + (selectedCategory = category.name)} + text={category.name} + active={selectedCategory === category.name} + /> + {/each} + +
+
+ + {#each filteredCategories as category} +
+ {category.name} +
+ {#each category.templates as templateEntry} + - Details - - - {/each} + {#if !($licensing?.usageMetrics?.apps >= 100)} + + {/if} + + Details + + + {/each} +
-
- {/each} - -
+ {/each} + +
+ + import { Icon } from "@budibase/bbui" + + export let url + export let text + + +
+ + {text} + + +
+ + diff --git a/packages/builder/src/components/portal/page/Breadcrumbs.svelte b/packages/builder/src/components/portal/page/Breadcrumbs.svelte new file mode 100644 index 0000000000..6fa311f0f7 --- /dev/null +++ b/packages/builder/src/components/portal/page/Breadcrumbs.svelte @@ -0,0 +1,20 @@ +
+ +
+ + diff --git a/packages/builder/src/components/portal/page/Content.svelte b/packages/builder/src/components/portal/page/Content.svelte new file mode 100644 index 0000000000..365ddd40fa --- /dev/null +++ b/packages/builder/src/components/portal/page/Content.svelte @@ -0,0 +1,27 @@ + + +
+
+ +
+
+ +
+
+ + diff --git a/packages/builder/src/components/portal/page/Header.svelte b/packages/builder/src/components/portal/page/Header.svelte new file mode 100644 index 0000000000..72515af8a6 --- /dev/null +++ b/packages/builder/src/components/portal/page/Header.svelte @@ -0,0 +1,31 @@ + + +
+ {title} +
+ +
+
+ + diff --git a/packages/builder/src/components/portal/page/SideNav.svelte b/packages/builder/src/components/portal/page/SideNav.svelte new file mode 100644 index 0000000000..01097f9c3a --- /dev/null +++ b/packages/builder/src/components/portal/page/SideNav.svelte @@ -0,0 +1,25 @@ + + +
+ {#if title} +
{title}
+ {/if} + +
+ + diff --git a/packages/builder/src/components/portal/page/SideNavItem.svelte b/packages/builder/src/components/portal/page/SideNavItem.svelte new file mode 100644 index 0000000000..66c7ce101d --- /dev/null +++ b/packages/builder/src/components/portal/page/SideNavItem.svelte @@ -0,0 +1,23 @@ + + + + {text} + + + diff --git a/packages/builder/src/components/portal/page/index.js b/packages/builder/src/components/portal/page/index.js new file mode 100644 index 0000000000..05caf565dc --- /dev/null +++ b/packages/builder/src/components/portal/page/index.js @@ -0,0 +1,6 @@ +export { default as Breadcrumb } from "./Breadcrumb.svelte" +export { default as Breadcrumbs } from "./Breadcrumbs.svelte" +export { default as Header } from "./Header.svelte" +export { default as Content } from "./Content.svelte" +export { default as SideNavItem } from "./SideNavItem.svelte" +export { default as SideNav } from "./SideNav.svelte" diff --git a/packages/builder/src/components/start/AppRow.svelte b/packages/builder/src/components/start/AppRow.svelte index eee8aa19b2..c741fe6749 100644 --- a/packages/builder/src/components/start/AppRow.svelte +++ b/packages/builder/src/components/start/AppRow.svelte @@ -1,5 +1,5 @@ -
-
-
- +
+
+
+
+ +
+
editApp(app)}> + + {app.name} + +
-
editApp(app)}> - - {app.name} - + +
+ {#if app.updatedAt} + {processStringSync("Updated {{ duration time 'millisecond' }} ago", { + time: new Date().getTime() - new Date(app.updatedAt).getTime(), + })} + {:else} + Never updated + {/if}
-
-
- {#if app.updatedAt} - {processStringSync("Updated {{ duration time 'millisecond' }} ago", { - time: new Date().getTime() - new Date(app.updatedAt).getTime(), - })} - {:else} - Never updated - {/if} -
-
- -
-
-
- {#if app.deployed} - - Published - {:else} - - Unpublished - {/if} + +
+ + {`${window.origin}/app${app.url}`}
-
-
-
- - + +
+
+ + + +