Skip to content

Commit

Permalink
fix: removed pi chat from community version
Browse files Browse the repository at this point in the history
  • Loading branch information
gakshita committed Nov 4, 2024
1 parent 442aee7 commit 7a68cf7
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 53 deletions.
53 changes: 53 additions & 0 deletions web/ce/constants/dashboard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
"use client";

// 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";

export const SIDEBAR_USER_MENU_ITEMS: {
key: string;
label: string;
href: string;
access: EUserPermissions[];
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) => boolean;
Icon: React.FC<Props>;
}[] = [
{
key: "home",
label: "Home",
href: ``,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/`,
Icon: Home,
},
{
key: "your-work",
label: "Your work",
href: "/profile",
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) =>
options?.userId ? pathname.includes(`${baseUrl}/profile/${options?.userId}`) : false,
Icon: UserActivityIcon,
},
{
key: "notifications",
label: "Inbox",
href: `/notifications`,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/notifications/`),
Icon: Inbox,
},
{
key: "drafts",
label: "Drafts",
href: `/drafts`,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/drafts/`),
Icon: PenSquare,
},
];
3 changes: 2 additions & 1 deletion web/core/components/workspace/sidebar/user-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { Tooltip } from "@plane/ui";
import { SidebarNavItem } from "@/components/sidebar";
import { NotificationAppSidebarOption } from "@/components/workspace-notifications";
// constants
import { SIDEBAR_USER_MENU_ITEMS } from "@/constants/dashboard";
import { SIDEBAR_CLICKED } from "@/constants/event-tracker";
// helpers
import { cn } from "@/helpers/common.helper";
// hooks
import { useAppTheme, useEventTracker, useUser, useUserPermissions } from "@/hooks/store";
import { usePlatformOS } from "@/hooks/use-platform-os";

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

export const SidebarUserMenu = observer(() => {
Expand Down
53 changes: 1 addition & 52 deletions web/core/constants/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,57 +292,6 @@ export const SIDEBAR_WORKSPACE_MENU_ITEMS: {
},
];

type TLinkOptions = {
export type TLinkOptions = {
userId: string | undefined;
};

export const SIDEBAR_USER_MENU_ITEMS: {
key: string;
label: string;
href: string;
access: EUserPermissions[];
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) => boolean;
Icon: React.FC<Props>;
}[] = [
{
key: "home",
label: "Home",
href: ``,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/`,
Icon: Home,
},
{
key: "your-work",
label: "Your work",
href: "/profile",
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
highlight: (pathname: string, baseUrl: string, options?: TLinkOptions) =>
options?.userId ? pathname.includes(`${baseUrl}/profile/${options?.userId}`) : false,
Icon: UserActivityIcon,
},
{
key: "notifications",
label: "Inbox",
href: `/notifications`,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/notifications/`),
Icon: Inbox,
},
{
key: "drafts",
label: "Drafts",
href: `/drafts`,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER],
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/drafts/`),
Icon: PenSquare,
},
{
key: "pi-chat",
label: "Pi chat",
href: `/pi-chat`,
access: [EUserPermissions.ADMIN, EUserPermissions.MEMBER, EUserPermissions.GUEST],
highlight: (pathname: string, baseUrl: string) => pathname.includes(`${baseUrl}/pi-chat/`),
Icon: PiChatLogo,
},
];

0 comments on commit 7a68cf7

Please sign in to comment.