Skip to content

Commit

Permalink
Feat: Only show workspaces menu item when no workspaces (#3540)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikehrn authored Nov 21, 2024
1 parent a37a7fc commit b0ff431
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/frontend-2/components/dashboard/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
>
<NuxtLink :to="workspacesRoute" @click="handleIntroducingWorkspacesClick">
<LayoutSidebarMenuGroupItem
v-if="!hasWorkspaces || route.path === workspacesRoute"
label="Introducing workspaces"
:active="isActive(workspacesRoute)"
tag="BETA"
>
<template #icon>
<IconWorkspaces class="size-4 text-foreground-2" />
Expand Down Expand Up @@ -221,7 +221,6 @@ const isActive = (...routes: string[]): boolean => {
const isNotGuest = computed(
() => Roles.Server.Admin || user.value?.role === Roles.Server.User
)

const workspacesItems = computed(() =>
workspaceResult.value?.activeUser
? workspaceResult.value.activeUser.workspaces.items.map((workspace) => ({
Expand All @@ -236,6 +235,7 @@ const workspacesItems = computed(() =>
}))
: []
)
const hasWorkspaces = computed(() => workspacesItems.value.length > 0)

onWorkspaceResult((result) => {
if (result.data?.activeUser) {
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-2/components/settings/Dialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"
:tooltip-text="workspaceMenuItem.tooltipText"
:disabled="workspaceMenuItem.disabled"
:tag="workspaceMenuItem.disabled ? 'Coming soon' : undefined"
extra-padding
@click="
onWorkspaceMenuItemClick(
Expand Down
1 change: 0 additions & 1 deletion packages/frontend-2/components/workspaces/Promo/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<div class="relative z-10 text-foreground max-w-sm lg:max-w-md xl:max-w-lg">
<div class="flex gap-2 items-center">
<h3 class="text-heading-lg">Introducing workspaces</h3>
<CommonBadge rounded class="">BETA</CommonBadge>
</div>
<p class="text-body-sm mt-4">
You are one click away from reaching higher data security, more data control,
Expand Down
3 changes: 0 additions & 3 deletions packages/frontend-2/components/workspaces/Promo/Page.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<template>
<div class="flex flex-col gap-12">
<WorkspacesPromoBanner @create="openWorkspaceCreateDialog" />

<section>
<div class="flex justify-between mb-2">
<h4 class="text-foreground-2 text-heading-sm">In a nutshell</h4>
Expand Down Expand Up @@ -29,7 +28,6 @@

<CommonCard
title="SSO"
badge="Coming soon"
description="Ensure compliance and security with workspace based SSO."
>
<template #icon>
Expand All @@ -39,7 +37,6 @@

<CommonCard
title="Data residency"
badge="Coming soon"
description="Store your workspace projects in the geographical region of your choice."
>
<template #icon>
Expand Down

0 comments on commit b0ff431

Please sign in to comment.