From 61481fd50b9df46395cac1c0287375756ff4a15e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 25 Jul 2022 17:06:00 +0100 Subject: [PATCH] Update screen list to match designs. Update nav items to make text clearer. Update screen picker --- .../src/components/common/NavItem.svelte | 45 +++++++------- .../[screenId]/_components/AppPanel.svelte | 11 ++-- .../navigation/ComponentListPanel.svelte | 2 +- .../screens/_components/RoleIndicator.svelte | 58 +++++++++++++++++++ .../_components/ScreenListPanel.svelte | 6 +- 5 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 4cb67dc9c4..0309458a1a 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -1,5 +1,5 @@
@@ -15,10 +14,11 @@ options={$sortedScreens} getOptionLabel={x => x.routing.route} getOptionValue={x => x._id} - getOptionIcon={x => (x.routing.homeScreen ? "Home" : "WebPage")} getOptionColour={x => RoleUtils.getRoleColour(x.routing.roleId)} value={$store.selectedScreenId} on:change={e => store.actions.screens.select(e.detail)} + quiet + autoWidth />
@@ -62,7 +62,8 @@ gap: var(--spacing-l); } .header-left :global(.spectrum-Picker) { - width: 250px; + font-weight: 600; + color: var(--spectrum-global-color-gray-900); } .content { flex: 1 1 auto; diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte index e025b8c7a7..d6d77a0d87 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -24,7 +24,7 @@ let newOffsets = {} // Calculate left offset - const offsetX = bounds.left + bounds.width + scrollLeft - 58 + const offsetX = bounds.left + bounds.width + scrollLeft - 39 if (offsetX > sidebarWidth) { newOffsets.left = offsetX - sidebarWidth } else { diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte new file mode 100644 index 0000000000..eb25d86645 --- /dev/null +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/RoleIndicator.svelte @@ -0,0 +1,58 @@ + + +
(showTooltip = true)} + on:mouseleave={() => (showTooltip = false)} + style="--color: {color};" +> + + {#if showTooltip} +
+ +
+ {/if} +
+ + diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte index 27345cc429..a6fd9089b1 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/screens/_components/ScreenListPanel.svelte @@ -6,6 +6,7 @@ import NavItem from "components/common/NavItem.svelte" import ScreenDropdownMenu from "./ScreenDropdownMenu.svelte" import ScreenWizard from "./ScreenWizard.svelte" + import RoleIndicator from "./RoleIndicator.svelte" import { RoleUtils } from "@budibase/frontend-core" let searchString @@ -52,14 +53,15 @@ {#each filteredScreens as screen (screen._id)} store.actions.screens.select(screen._id)} - color={RoleUtils.getRoleColour(screen.routing.roleId)} + rightAlignIcon > + {/each} {#if !filteredScreens?.length}