diff --git a/packages/builder/src/builderStore/index.js b/packages/builder/src/builderStore/index.js index 16a87810ad..2ca8057b48 100644 --- a/packages/builder/src/builderStore/index.js +++ b/packages/builder/src/builderStore/index.js @@ -127,8 +127,12 @@ export const selectedAutomation = derived(automationStore, $automationStore => { export const userSelectedResourceMap = derived(userStore, $userStore => { let map = {} $userStore.forEach(user => { - if (user.builderMetadata?.selectedResourceId) { - map[user.builderMetadata?.selectedResourceId] = user + const resource = user.builderMetadata?.selectedResourceId + if (resource) { + if (!map[resource]) { + map[resource] = [] + } + map[resource].push(user) } }) return map diff --git a/packages/builder/src/components/common/NavItem.svelte b/packages/builder/src/components/common/NavItem.svelte index 5309bc0d7d..468f60b9f7 100644 --- a/packages/builder/src/components/common/NavItem.svelte +++ b/packages/builder/src/components/common/NavItem.svelte @@ -3,6 +3,7 @@ import { createEventDispatcher, getContext } from "svelte" import { helpers } from "@budibase/shared-core" import { UserAvatar } from "@budibase/frontend-core" + import UserAvatars from "../../pages/builder/app/[application]/_components/UserAvatars.svelte" export let icon export let withArrow = false @@ -102,7 +103,7 @@
{text} {#if selectedBy} - + {/if}
@@ -145,13 +146,16 @@ } .nav-item.highlighted { background-color: var(--spectrum-global-color-gray-200); + --avatars-background: var(--spectrum-global-color-gray-200); } .nav-item.selected { background-color: var(--spectrum-global-color-gray-300); + --avatars-background: var(--spectrum-global-color-gray-300); color: var(--ink); } .nav-item:hover { background-color: var(--spectrum-global-color-gray-300); + --avatars-background: var(--spectrum-global-color-gray-300); } .nav-item:hover .actions { visibility: visible; diff --git a/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte b/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte index dc4938b9bd..9e62951d53 100644 --- a/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_components/UserAvatars.svelte @@ -1,24 +1,54 @@
- {#each uniqueUsers as user, idx} - - + {#each avatars as user} + + {#if user._id === "overflow"} + + {:else} + + {/if} {/each}
@@ -27,10 +57,10 @@ .avatars { display: flex; } - .avatars :global(> *:not(:first-child)) { - margin-left: -12px; + span:not(:first-of-type) { + margin-left: -6px; } .avatars :global(.spectrum-Avatar) { - border: 2px solid var(--background); + border: 2px solid var(--avatars-background, var(--background)); } diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index e6c79335a9..8586a300fc 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -172,7 +172,7 @@
- +
diff --git a/packages/frontend-core/src/components/UserAvatar.svelte b/packages/frontend-core/src/components/UserAvatar.svelte index 97a06aa569..bc630ed473 100644 --- a/packages/frontend-core/src/components/UserAvatar.svelte +++ b/packages/frontend-core/src/components/UserAvatar.svelte @@ -3,7 +3,7 @@ import { helpers } from "@budibase/shared-core" export let user - export let size + export let size = "S" export let tooltipPosition = TooltipPosition.Top export let showTooltip = true