From 9309d1b574bd4f98fcb4fbe4c3ccb1996535ef1d Mon Sep 17 00:00:00 2001 From: Akshita Goyal <36129505+gakshita@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:16:58 +0530 Subject: [PATCH] feat: Pi chat (#5933) * fix: added pi chat * fix: added bot * fix: removed pi chat from community version * fix: removed unwanted files * fix: removed unused import --- packages/ui/src/icons/index.ts | 1 + packages/ui/src/icons/pi-chat.tsx | 21 ++++++++ web/ce/constants/dashboard.ts | 53 +++++++++++++++++++ web/core/components/workspace/logo.tsx | 9 ++-- .../workspace/sidebar/user-menu.tsx | 3 +- web/core/constants/dashboard.ts | 49 ++--------------- 6 files changed, 86 insertions(+), 50 deletions(-) create mode 100644 packages/ui/src/icons/pi-chat.tsx create mode 100644 web/ce/constants/dashboard.ts diff --git a/packages/ui/src/icons/index.ts b/packages/ui/src/icons/index.ts index e857dc1a4..d1cc6af03 100644 --- a/packages/ui/src/icons/index.ts +++ b/packages/ui/src/icons/index.ts @@ -32,3 +32,4 @@ export * from "./planned-icon"; export * from "./in-progress-icon"; export * from "./done-icon"; export * from "./pending-icon"; +export * from "./pi-chat"; diff --git a/packages/ui/src/icons/pi-chat.tsx b/packages/ui/src/icons/pi-chat.tsx new file mode 100644 index 000000000..e2e49a28f --- /dev/null +++ b/packages/ui/src/icons/pi-chat.tsx @@ -0,0 +1,21 @@ +import * as React from "react"; + +import { ISvgIcons } from "./type"; + +export const PiChatLogo: React.FC = ({ width = "16", height = "16", className, color = "currentColor" }) => ( + + + + + +); diff --git a/web/ce/constants/dashboard.ts b/web/ce/constants/dashboard.ts new file mode 100644 index 000000000..9f2c5b62f --- /dev/null +++ b/web/ce/constants/dashboard.ts @@ -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; +}[] = [ + { + 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, + }, +]; diff --git a/web/core/components/workspace/logo.tsx b/web/core/components/workspace/logo.tsx index 56d19bad8..4407205e0 100644 --- a/web/core/components/workspace/logo.tsx +++ b/web/core/components/workspace/logo.tsx @@ -1,4 +1,5 @@ // helpers +import { cn } from "@plane/editor"; import { getFileURL } from "@/helpers/file.helper"; type Props = { @@ -9,9 +10,11 @@ type Props = { export const WorkspaceLogo = (props: Props) => (
{props.logo && props.logo !== "" ? ( { diff --git a/web/core/constants/dashboard.ts b/web/core/constants/dashboard.ts index 3cfdec0e2..8d9848a48 100644 --- a/web/core/constants/dashboard.ts +++ b/web/core/constants/dashboard.ts @@ -2,11 +2,11 @@ import { linearGradientDef } from "@nivo/core"; // icons -import { BarChart2, Briefcase, Home, Inbox, Layers, PenSquare } from "lucide-react"; +import { BarChart2, Briefcase, Layers } from "lucide-react"; // types import { TIssuesListTypes, TStateGroups } from "@plane/types"; // ui -import { ContrastIcon, UserActivityIcon } from "@plane/ui"; +import { ContrastIcon } from "@plane/ui"; import { Props } from "@/components/icons/types"; import { EUserPermissions } from "@/plane-web/constants/user-permissions"; // assets @@ -292,49 +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; -}[] = [ - { - 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, - }, -];