Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions web/ce/constants/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,24 @@

// icons
import { Home, Inbox, PenSquare } from "lucide-react";

// ui
import { UserActivityIcon } from "@plane/ui";
import { Props } from "@/components/icons/types";
import { TLinkOptions } from "@/constants/dashboard";
import { EUserPermissions } from "@/plane-web/constants/user-permissions";
// plane web types
import { TSidebarUserMenuItemKeys } from "@/plane-web/types/dashboard";

export const SIDEBAR_USER_MENU_ITEMS: {
key: string;
export type TSidebarUserMenuItems = {
key: TSidebarUserMenuItemKeys;
label: string;
href: string;
access: EUserPermissions[];
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) => boolean;
Icon: React.FC<Props>;
}[] = [
};

export const SIDEBAR_USER_MENU_ITEMS: TSidebarUserMenuItems[] = [
{
key: "home",
label: "Home",
Expand Down
5 changes: 5 additions & 0 deletions web/ce/helpers/dashboard.helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// plane web types
import { TSidebarUserMenuItemKeys } from "@/plane-web/types/dashboard";

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const isUserFeatureEnabled = (featureKey: TSidebarUserMenuItemKeys) => true;
1 change: 1 addition & 0 deletions web/ce/types/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type TSidebarUserMenuItemKeys = "home" | "your-work" | "notifications" | "drafts";
5 changes: 4 additions & 1 deletion web/core/components/workspace/sidebar/user-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import { cn } from "@/helpers/common.helper";
// hooks
import { useAppTheme, useEventTracker, useUser, useUserPermissions } from "@/hooks/store";
import { usePlatformOS } from "@/hooks/use-platform-os";

// plane web constants
import { SIDEBAR_USER_MENU_ITEMS } from "@/plane-web/constants/dashboard";
import { EUserPermissionsLevel } from "@/plane-web/constants/user-permissions";
// plane web helpers
import { isUserFeatureEnabled } from "@/plane-web/helpers/dashboard.helper";

export const SidebarUserMenu = observer(() => {
// store hooks
Expand Down Expand Up @@ -61,6 +63,7 @@ export const SidebarUserMenu = observer(() => {
>
{SIDEBAR_USER_MENU_ITEMS.map((link) => {
if (link.key === "drafts" && draftIssueCount === 0) return null;
if (!isUserFeatureEnabled(link.key)) return null;
return (
allowPermissions(link.access, EUserPermissionsLevel.WORKSPACE, workspaceSlug.toString()) && (
<Tooltip
Expand Down
1 change: 1 addition & 0 deletions web/ee/helpers/dashboard.helper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "ce/helpers/dashboard.helper";
1 change: 1 addition & 0 deletions web/ee/types/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "ce/types/dashboard";