From 71dd456a378844fd12c092df58e33a25c56ed380 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Tue, 12 Apr 2022 15:35:24 +0100 Subject: [PATCH] Update top bar with back arrow, app name, centered large tabs, new icons, tooltips on right icons and removal of version and self-host icons --- .../src/components/deploy/RevertModal.svelte | 7 +- packages/builder/src/global.css | 83 +++++------ .../builder/app/[application]/_layout.svelte | 137 +++++++++--------- .../app/[application]/data/_layout.svelte | 2 +- .../app/[application]/data/index.svelte | 1 - .../app/[application]/design/index.svelte | 2 - .../app/[application]/settings/_layout.svelte | 2 +- .../app/[application]/settings/index.svelte | 5 + 8 files changed, 125 insertions(+), 114 deletions(-) diff --git a/packages/builder/src/components/deploy/RevertModal.svelte b/packages/builder/src/components/deploy/RevertModal.svelte index 717c55f05e..a8f9d8f6e3 100644 --- a/packages/builder/src/components/deploy/RevertModal.svelte +++ b/packages/builder/src/components/deploy/RevertModal.svelte @@ -28,7 +28,12 @@ } - + import { store, automationStore } from "builderStore" import { roles, flags } from "stores/backend" - import { Icon, ActionGroup, Tabs, Tab, notifications } from "@budibase/bbui" + import { Icon, Tabs, Tab, notifications, Heading } from "@budibase/bbui" import DeployModal from "components/deploy/DeployModal.svelte" import RevertModal from "components/deploy/RevertModal.svelte" - import VersionModal from "components/deploy/VersionModal.svelte" import { API } from "api" - import { auth, admin } from "stores/portal" + import { apps } from "stores/portal" import { isActive, goto, layout, redirect } from "@roxi/routify" - import Logo from "assets/bb-emblem.svg" import { capitalise } from "helpers" - import UpgradeModal from "components/upgrade/UpgradeModal.svelte" import { onMount, onDestroy } from "svelte" export let application @@ -20,14 +17,21 @@ // Sync once when you load the app let hasSynced = false + $: selected = capitalise( $layout.children.find(layout => $isActive(layout.path))?.title ?? "data" ) + $: appInfo = $apps?.find(app => app.devId === application) + $: published = appInfo?.status === "published" - function previewApp() { + const viewPreviewApp = () => { window.open(`/${application}`) } + const viewPublishedApp = () => { + window.open(`/app${appInfo?.url}`) + } + async function getPackage() { try { const pkg = await API.fetchAppPackage(application) @@ -67,6 +71,9 @@ } hasSynced = true } + if (!$apps?.length) { + apps.load() + } }) onDestroy(() => { @@ -81,37 +88,43 @@
- - -
- - {#each $layout.children as { path, title }} - - {/each} - -
- - - + $goto("../")} + /> + {$store.name || "App"} +
+
+ + {#each $layout.children as { path, title }} + + {/each} +
- {#if $admin.cloud && $auth.user.account} - - {/if} - - + +
@@ -138,16 +151,37 @@ } .top-nav { - flex: 0 0 auto; + flex: 0 0 60px; background: var(--background); padding: 0 var(--spacing-xl); display: flex; + flex-direction: row; box-sizing: border-box; justify-content: space-between; - align-items: center; + align-items: stretch; border-bottom: var(--border-light); } + .topleftnav { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + gap: var(--spacing-xl); + } + .topleftnav :global(.spectrum-Heading) { + font-weight: 600; + } + + .topcenternav { + display: flex; + position: relative; + margin-bottom: -2px; + } + .topcenternav :global(.spectrum-Tabs-itemLabel) { + font-weight: bold !important; + } + .toprightnav { display: flex; flex-direction: row; @@ -155,35 +189,4 @@ align-items: center; gap: var(--spacing-xl); } - - .topleftnav { - display: flex; - flex-direction: row; - justify-content: flex-start; - align-items: center; - } - - .tabs { - display: flex; - position: relative; - margin-bottom: -1px; - } - - .home-logo { - border-style: none; - background-color: rgba(0, 0, 0, 0); - cursor: pointer; - outline: none; - padding: 0 10px 0 0; - align-items: center; - height: 32px; - } - - .home-logo:active { - outline: none; - } - - .home-logo img { - height: 30px; - } diff --git a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte index 9664ebbd09..f5f5c9d977 100644 --- a/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/data/_layout.svelte @@ -18,7 +18,7 @@ } - +