From 67cf1785b82a60404bd1b44b65aad34bd40a3025 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:13:30 +0530 Subject: [PATCH 01/58] chore: breadcrumb component improvement (#3537) * chore: breadcrumb component improvement * chore: code refactor --- packages/ui/src/breadcrumbs/breadcrumbs.tsx | 39 ++------------ web/components/common/breadcrumb-link.tsx | 36 +++++++++++++ web/components/common/index.ts | 1 + web/components/headers/cycle-issues.tsx | 39 ++++++++------ web/components/headers/cycles.tsx | 34 ++++++------ web/components/headers/global-issues.tsx | 21 +++++--- web/components/headers/module-issues.tsx | 39 ++++++++------ web/components/headers/modules-list.tsx | 34 ++++++------ web/components/headers/page-details.tsx | 49 ++++++++++------- web/components/headers/pages.tsx | 34 ++++++------ .../headers/profile-preferences.tsx | 3 +- web/components/headers/profile-settings.tsx | 13 +++-- .../project-archived-issue-details.tsx | 50 ++++++++++------- .../headers/project-archived-issues.tsx | 39 ++++++++------ .../headers/project-draft-issues.tsx | 36 +++++++------ web/components/headers/project-inbox.tsx | 36 +++++++------ .../headers/project-issue-details.tsx | 50 ++++++++++------- web/components/headers/project-issues.tsx | 54 ++++++++++--------- web/components/headers/project-settings.tsx | 40 ++++++++------ .../headers/project-view-issues.tsx | 47 +++++++++------- web/components/headers/project-views.tsx | 44 ++++++++------- web/components/headers/projects.tsx | 6 +-- web/components/headers/user-profile.tsx | 5 +- .../headers/workspace-active-cycles.tsx | 11 ++-- .../headers/workspace-analytics.tsx | 6 ++- .../headers/workspace-dashboard.tsx | 7 +-- web/components/headers/workspace-settings.tsx | 17 ++++-- web/layouts/admin-layout/header.tsx | 13 +++-- 28 files changed, 480 insertions(+), 323 deletions(-) create mode 100644 web/components/common/breadcrumb-link.tsx diff --git a/packages/ui/src/breadcrumbs/breadcrumbs.tsx b/packages/ui/src/breadcrumbs/breadcrumbs.tsx index e82944c03..0f09764ac 100644 --- a/packages/ui/src/breadcrumbs/breadcrumbs.tsx +++ b/packages/ui/src/breadcrumbs/breadcrumbs.tsx @@ -2,8 +2,6 @@ import * as React from "react"; // icons import { ChevronRight } from "lucide-react"; -// components -import { Tooltip } from "../tooltip"; type BreadcrumbsProps = { children: any; @@ -25,42 +23,11 @@ const Breadcrumbs = ({ children }: BreadcrumbsProps) => ( type Props = { type?: "text" | "component"; component?: React.ReactNode; - label?: string; - icon?: React.ReactNode; - link?: string; + link?: JSX.Element; }; const BreadcrumbItem: React.FC = (props) => { - const { type = "text", component, label, icon, link } = props; - return ( - <> - {type != "text" ? ( -
{component}
- ) : ( - -
  • -
    - {link ? ( - - {icon && ( -
    {icon}
    - )} -
    {label}
    -
    - ) : ( -
    - {icon &&
    {icon}
    } -
    {label}
    -
    - )} -
    -
  • -
    - )} - - ); + const { type = "text", component, link } = props; + return <>{type != "text" ?
    {component}
    : link}; }; Breadcrumbs.BreadcrumbItem = BreadcrumbItem; diff --git a/web/components/common/breadcrumb-link.tsx b/web/components/common/breadcrumb-link.tsx new file mode 100644 index 000000000..aebd7fc02 --- /dev/null +++ b/web/components/common/breadcrumb-link.tsx @@ -0,0 +1,36 @@ +import { Tooltip } from "@plane/ui"; +import Link from "next/link"; + +type Props = { + label?: string; + href?: string; + icon?: React.ReactNode | undefined; +}; + +export const BreadcrumbLink: React.FC = (props) => { + const { href, label, icon } = props; + return ( + +
  • +
    + {href ? ( + + {icon && ( +
    {icon}
    + )} +
    {label}
    + + ) : ( +
    + {icon &&
    {icon}
    } +
    {label}
    +
    + )} +
    +
  • +
    + ); +}; diff --git a/web/components/common/index.ts b/web/components/common/index.ts index 04aaa8512..0eff24d93 100644 --- a/web/components/common/index.ts +++ b/web/components/common/index.ts @@ -1,3 +1,4 @@ export * from "./product-updates-modal"; export * from "./empty-state"; export * from "./latest-feature-block"; +export * from "./breadcrumb-link"; diff --git a/web/components/headers/cycle-issues.tsx b/web/components/headers/cycle-issues.tsx index fc0075030..8e2ceab10 100644 --- a/web/components/headers/cycle-issues.tsx +++ b/web/components/headers/cycle-issues.tsx @@ -18,6 +18,7 @@ import useLocalStorage from "hooks/use-local-storage"; import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { ProjectAnalyticsModal } from "components/analytics"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, Button, ContrastIcon, CustomMenu } from "@plane/ui"; // icons @@ -151,25 +152,33 @@ export const CycleIssuesHeader: React.FC = observer(() => { - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Cycles" - link={`/${workspaceSlug}/projects/${projectId}/cycles`} + link={ + } + /> + } /> { // router @@ -32,29 +33,32 @@ export const CyclesHeader: FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Cycles" + link={} />} />
    diff --git a/web/components/headers/global-issues.tsx b/web/components/headers/global-issues.tsx index debcbc213..cca1a972b 100644 --- a/web/components/headers/global-issues.tsx +++ b/web/components/headers/global-issues.tsx @@ -8,6 +8,7 @@ import { useLabel, useMember, useUser, useIssues } from "hooks/store"; import { DisplayFiltersSelection, FiltersDropdown, FilterSelection } from "components/issues"; import { CreateUpdateWorkspaceViewModal } from "components/workspace"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, Button, LayersIcon, PhotoFilterIcon, Tooltip } from "@plane/ui"; // icons @@ -108,18 +109,22 @@ export const GlobalIssuesHeader: React.FC = observer((props) => { setCreateViewModal(false)} />
    - + - ) : ( - - ) + link={ + + ) : ( + + ) + } + /> } - label={`All ${activeLayout === "spreadsheet" ? "Issues" : "Views"}`} />
    diff --git a/web/components/headers/module-issues.tsx b/web/components/headers/module-issues.tsx index 84a284f2e..5ec67a3d7 100644 --- a/web/components/headers/module-issues.tsx +++ b/web/components/headers/module-issues.tsx @@ -18,6 +18,7 @@ import useLocalStorage from "hooks/use-local-storage"; import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { ProjectAnalyticsModal } from "components/analytics"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, Button, CustomMenu, DiceIcon } from "@plane/ui"; // icons @@ -154,25 +155,33 @@ export const ModuleIssuesHeader: React.FC = observer(() => { - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Modules" - link={`/${workspaceSlug}/projects/${projectId}/modules`} + link={ + } + /> + } /> { // router @@ -33,29 +34,32 @@ export const ModulesListHeader: React.FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Modules" + link={} />} />
    diff --git a/web/components/headers/page-details.tsx b/web/components/headers/page-details.tsx index d2a959817..83595af60 100644 --- a/web/components/headers/page-details.tsx +++ b/web/components/headers/page-details.tsx @@ -10,6 +10,7 @@ import { Breadcrumbs, Button } from "@plane/ui"; import { renderEmoji } from "helpers/emoji.helper"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; export interface IPagesHeaderProps { showButton?: boolean; @@ -29,35 +30,47 @@ export const PageDetailsHeader: FC = observer((props) => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Pages" - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/pages`} + link={ + } + /> + } /> } - label={pageDetails?.name ?? "Page"} + link={ + } + /> + } />
    diff --git a/web/components/headers/pages.tsx b/web/components/headers/pages.tsx index 2afb549a0..28116b323 100644 --- a/web/components/headers/pages.tsx +++ b/web/components/headers/pages.tsx @@ -11,6 +11,7 @@ import { renderEmoji } from "helpers/emoji.helper"; import { EUserProjectRoles } from "constants/project"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; export const PagesHeader = observer(() => { // router @@ -31,29 +32,32 @@ export const PagesHeader = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Pages" + link={} />} />
    diff --git a/web/components/headers/profile-preferences.tsx b/web/components/headers/profile-preferences.tsx index 0c6329ac9..e9f37bf6e 100644 --- a/web/components/headers/profile-preferences.tsx +++ b/web/components/headers/profile-preferences.tsx @@ -1,12 +1,13 @@ // components import { Breadcrumbs } from "@plane/ui"; +import { BreadcrumbLink } from "components/common"; export const ProfilePreferencesHeader = () => (
    - + } />
    diff --git a/web/components/headers/profile-settings.tsx b/web/components/headers/profile-settings.tsx index 76e5e6fcc..24c69f093 100644 --- a/web/components/headers/profile-settings.tsx +++ b/web/components/headers/profile-settings.tsx @@ -2,6 +2,7 @@ import { FC } from "react"; // ui import { Breadcrumbs } from "@plane/ui"; import { Settings } from "lucide-react"; +import { BreadcrumbLink } from "components/common"; interface IProfileSettingHeader { title: string; @@ -17,11 +18,15 @@ export const ProfileSettingsHeader: FC = (props) => { } - link="/profile" + link={ + } + /> + } /> - + } />
    diff --git a/web/components/headers/project-archived-issue-details.tsx b/web/components/headers/project-archived-issue-details.tsx index e393450af..3b3e05f1a 100644 --- a/web/components/headers/project-archived-issue-details.tsx +++ b/web/components/headers/project-archived-issue-details.tsx @@ -16,6 +16,7 @@ import { IssueArchiveService } from "services/issue"; import { renderEmoji } from "helpers/emoji.helper"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; const issueArchiveService = new IssueArchiveService(); @@ -41,37 +42,50 @@ export const ProjectArchivedIssueDetailsHeader: FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects`} /> } - label="Archived Issues" - link={`/${workspaceSlug}/projects/${projectId}/archived-issues`} + link={ + } + /> + } /> } /> diff --git a/web/components/headers/project-archived-issues.tsx b/web/components/headers/project-archived-issues.tsx index ee1265374..b7ca78ede 100644 --- a/web/components/headers/project-archived-issues.tsx +++ b/web/components/headers/project-archived-issues.tsx @@ -11,6 +11,7 @@ import { Breadcrumbs, LayersIcon } from "@plane/ui"; // components import { DisplayFiltersSelection, FilterSelection, FiltersDropdown } from "components/issues"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // helpers import { renderEmoji } from "helpers/emoji.helper"; // types @@ -71,7 +72,7 @@ export const ProjectArchivedIssuesHeader: FC = observer(() => { return (
    - +
    diff --git a/web/components/headers/project-draft-issues.tsx b/web/components/headers/project-draft-issues.tsx index 10f07f779..0fe6a74c5 100644 --- a/web/components/headers/project-draft-issues.tsx +++ b/web/components/headers/project-draft-issues.tsx @@ -6,6 +6,7 @@ import { useIssues, useLabel, useMember, useProject, useProjectState } from "hoo // components import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, LayersIcon } from "@plane/ui"; // helper @@ -75,30 +76,35 @@ export const ProjectDraftIssueHeader: FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects`} /> } - label="Draft Issues" + link={ + } /> + } />
    diff --git a/web/components/headers/project-inbox.tsx b/web/components/headers/project-inbox.tsx index 29ea9fc47..b5260edd7 100644 --- a/web/components/headers/project-inbox.tsx +++ b/web/components/headers/project-inbox.tsx @@ -9,6 +9,7 @@ import { Breadcrumbs, Button, LayersIcon } from "@plane/ui"; // components import { CreateInboxIssueModal } from "components/inbox"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // helper import { renderEmoji } from "helpers/emoji.helper"; @@ -24,30 +25,35 @@ export const ProjectInboxHeader: FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects`} /> } - label="Inbox Issues" + link={ + } /> + } />
    diff --git a/web/components/headers/project-issue-details.tsx b/web/components/headers/project-issue-details.tsx index 7b45d3fcf..8d3a22682 100644 --- a/web/components/headers/project-issue-details.tsx +++ b/web/components/headers/project-issue-details.tsx @@ -14,6 +14,7 @@ import { IssueService } from "services/issue"; import { ISSUE_DETAILS } from "constants/fetch-keys"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // services const issueService = new IssueService(); @@ -35,37 +36,50 @@ export const ProjectIssueDetailsHeader: FC = observer(() => { return (
    - +
    - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - label={currentProjectDetails?.name ?? "Project"} - link={`/${workspaceSlug}/projects`} /> } - label="Issues" - link={`/${workspaceSlug}/projects/${projectId}/issues`} + link={ + } + /> + } /> } /> diff --git a/web/components/headers/project-issues.tsx b/web/components/headers/project-issues.tsx index 04a7ecb64..29ecb16c7 100644 --- a/web/components/headers/project-issues.tsx +++ b/web/components/headers/project-issues.tsx @@ -9,6 +9,7 @@ import { useApplication, useLabel, useProject, useProjectState, useUser, useInbo import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { ProjectAnalyticsModal } from "components/analytics"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, Button, LayersIcon } from "@plane/ui"; // types @@ -106,7 +107,7 @@ export const ProjectIssuesHeader: React.FC = observer(() => { />
    - +
    diff --git a/web/components/headers/project-settings.tsx b/web/components/headers/project-settings.tsx index eff05aba5..fdb033a21 100644 --- a/web/components/headers/project-settings.tsx +++ b/web/components/headers/project-settings.tsx @@ -11,6 +11,7 @@ import { useProject, useUser } from "hooks/store"; import { EUserProjectRoles, PROJECT_SETTINGS_LINKS } from "constants/project"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; export interface IProjectSettingHeader { title: string; @@ -38,22 +39,26 @@ export const ProjectSettingHeader: FC = observer((props) - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} />
    - + } />
    @@ -62,13 +67,18 @@ export const ProjectSettingHeader: FC = observer((props) className="flex-shrink-0 block sm:block md:hidden lg:hidden" maxHeight="lg" customButton={ - {title} + + {title} + } placement="bottom-start" closeOnSelect > {PROJECT_SETTINGS_LINKS.map((item) => ( - router.push(`/${workspaceSlug}/projects/${projectId}${item.href}`)}> + router.push(`/${workspaceSlug}/projects/${projectId}${item.href}`)} + > {item.label} ))} diff --git a/web/components/headers/project-view-issues.tsx b/web/components/headers/project-view-issues.tsx index abe13c4e2..050400a2c 100644 --- a/web/components/headers/project-view-issues.tsx +++ b/web/components/headers/project-view-issues.tsx @@ -17,6 +17,7 @@ import { // components import { DisplayFiltersSelection, FiltersDropdown, FilterSelection, LayoutSelection } from "components/issues"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; // ui import { Breadcrumbs, Button, CustomMenu, PhotoFilterIcon } from "@plane/ui"; // helpers @@ -112,29 +113,37 @@ export const ProjectViewIssuesHeader: React.FC = observer(() => { - {renderEmoji(currentProjectDetails.emoji)} - - ) : currentProjectDetails?.icon_prop ? ( -
    - {renderEmoji(currentProjectDetails.icon_prop)} -
    - ) : ( - - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {renderEmoji(currentProjectDetails.emoji)} + + ) : currentProjectDetails?.icon_prop ? ( +
    + {renderEmoji(currentProjectDetails.icon_prop)} +
    + ) : ( + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Views" - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/views`} + link={ + } + /> + } /> { <>
    - +
    - {renderEmoji(currentProjectDetails.emoji)} - - ) : currentProjectDetails?.icon_prop ? ( -
    - {renderEmoji(currentProjectDetails.icon_prop)} -
    - ) : ( - - {currentProjectDetails?.name.charAt(0)} - - ) + link={ + + {renderEmoji(currentProjectDetails.emoji)} + + ) : currentProjectDetails?.icon_prop ? ( +
    + {renderEmoji(currentProjectDetails.icon_prop)} +
    + ) : ( + + {currentProjectDetails?.name.charAt(0)} + + ) + } + /> } - link={`/${workspaceSlug}/projects/${currentProjectDetails?.id}/issues`} /> } - label="Views" + link={ + } /> + } />
    diff --git a/web/components/headers/projects.tsx b/web/components/headers/projects.tsx index 96929f7b0..33192930e 100644 --- a/web/components/headers/projects.tsx +++ b/web/components/headers/projects.tsx @@ -8,6 +8,7 @@ import { Breadcrumbs, Button } from "@plane/ui"; import { EUserWorkspaceRoles } from "constants/workspace"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; export const ProjectsHeader = observer(() => { // store hooks @@ -25,13 +26,12 @@ export const ProjectsHeader = observer(() => { return (
    - +
    } - label="Projects" + link={} />} />
    diff --git a/web/components/headers/user-profile.tsx b/web/components/headers/user-profile.tsx index dca0dc7e6..d54f73009 100644 --- a/web/components/headers/user-profile.tsx +++ b/web/components/headers/user-profile.tsx @@ -1,15 +1,16 @@ // ui import { Breadcrumbs } from "@plane/ui"; +import { BreadcrumbLink } from "components/common"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; export const UserProfileHeader = () => (
    - +
    - + } />
    diff --git a/web/components/headers/workspace-active-cycles.tsx b/web/components/headers/workspace-active-cycles.tsx index 90cbccd81..195b89471 100644 --- a/web/components/headers/workspace-active-cycles.tsx +++ b/web/components/headers/workspace-active-cycles.tsx @@ -1,9 +1,10 @@ import { observer } from "mobx-react-lite"; // ui import { Breadcrumbs, ContrastIcon } from "@plane/ui"; +import { BreadcrumbLink } from "components/common"; +import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; // icons import { Crown } from "lucide-react"; -import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; export const WorkspaceActiveCycleHeader = observer(() => (
    @@ -13,8 +14,12 @@ export const WorkspaceActiveCycleHeader = observer(() => ( } - label="Active Cycles" + link={ + } + /> + } /> diff --git a/web/components/headers/workspace-analytics.tsx b/web/components/headers/workspace-analytics.tsx index 2ae373471..8bb4c9251 100644 --- a/web/components/headers/workspace-analytics.tsx +++ b/web/components/headers/workspace-analytics.tsx @@ -4,6 +4,7 @@ import { ArrowLeft, BarChart2 } from "lucide-react"; import { Breadcrumbs } from "@plane/ui"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; +import { BreadcrumbLink } from "components/common"; export const WorkspaceAnalyticsHeader = () => { const router = useRouter(); @@ -28,8 +29,9 @@ export const WorkspaceAnalyticsHeader = () => { } - label="Analytics" + link={ + } /> + } />
    diff --git a/web/components/headers/workspace-dashboard.tsx b/web/components/headers/workspace-dashboard.tsx index d576cb963..b7c05929c 100644 --- a/web/components/headers/workspace-dashboard.tsx +++ b/web/components/headers/workspace-dashboard.tsx @@ -6,7 +6,7 @@ import { useTheme } from "next-themes"; import githubBlackImage from "/public/logos/github-black.png"; import githubWhiteImage from "/public/logos/github-white.png"; // components -import { ProductUpdatesModal } from "components/common"; +import { BreadcrumbLink, ProductUpdatesModal } from "components/common"; import { Breadcrumbs } from "@plane/ui"; import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; @@ -25,8 +25,9 @@ export const WorkspaceDashboardHeader = () => { } - label="Dashboard" + link={ + } /> + } />
    diff --git a/web/components/headers/workspace-settings.tsx b/web/components/headers/workspace-settings.tsx index 625b7991c..5ced55204 100644 --- a/web/components/headers/workspace-settings.tsx +++ b/web/components/headers/workspace-settings.tsx @@ -8,6 +8,7 @@ import { observer } from "mobx-react-lite"; // components import { SidebarHamburgerToggle } from "components/core/sidebar/sidebar-menu-hamburger-toggle"; import { WORKSPACE_SETTINGS_LINKS } from "constants/workspace"; +import { BreadcrumbLink } from "components/common"; export interface IWorkspaceSettingHeader { title: string; @@ -27,12 +28,16 @@ export const WorkspaceSettingHeader: FC = observer((pro } - link={`/${workspaceSlug}/settings`} + link={ + } + /> + } />
    - + } />
    @@ -40,7 +45,9 @@ export const WorkspaceSettingHeader: FC = observer((pro className="flex-shrink-0 block sm:block md:hidden lg:hidden" maxHeight="lg" customButton={ - {title} + + {title} + } placement="bottom-start" closeOnSelect diff --git a/web/layouts/admin-layout/header.tsx b/web/layouts/admin-layout/header.tsx index f86abf6e6..2607fe91d 100644 --- a/web/layouts/admin-layout/header.tsx +++ b/web/layouts/admin-layout/header.tsx @@ -5,6 +5,7 @@ import { observer } from "mobx-react-lite"; import { Breadcrumbs } from "@plane/ui"; // icons import { Settings } from "lucide-react"; +import { BreadcrumbLink } from "components/common"; export interface IInstanceAdminHeader { title?: string; @@ -21,11 +22,15 @@ export const InstanceAdminHeader: FC = observer((props) => } - label="Settings" - link="/god-mode" + link={ + } + /> + } /> - + } />
    )} From 662b4970820a0b26f8ed4c80b0af91d0312c6496 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:29:59 +0530 Subject: [PATCH 02/58] fix: create issue modal project select (#3549) --- web/components/issues/issue-modal/modal.tsx | 22 ++++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/web/components/issues/issue-modal/modal.tsx b/web/components/issues/issue-modal/modal.tsx index da13e6353..4dfee1ea2 100644 --- a/web/components/issues/issue-modal/modal.tsx +++ b/web/components/issues/issue-modal/modal.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react"; import { observer } from "mobx-react-lite"; import { Dialog, Transition } from "@headlessui/react"; // hooks -import { useApplication, useCycle, useIssues, useModule, useProject, useUser, useWorkspace } from "hooks/store"; +import { useApplication, useCycle, useIssues, useModule, useProject, useWorkspace } from "hooks/store"; import useToast from "hooks/use-toast"; import useLocalStorage from "hooks/use-local-storage"; // components @@ -32,7 +32,6 @@ export const CreateUpdateIssueModal: React.FC = observer((prop const { eventTracker: { postHogEventTracker }, } = useApplication(); - const { currentUser } = useUser(); const { router: { workspaceSlug, projectId, cycleId, moduleId, viewId: projectViewId }, } = useApplication(); @@ -49,27 +48,22 @@ export const CreateUpdateIssueModal: React.FC = observer((prop const issueStores = { [EIssuesStoreType.PROJECT]: { store: projectIssues, - dataIdToUpdate: activeProjectId, viewId: undefined, }, [EIssuesStoreType.PROJECT_VIEW]: { store: viewIssues, - dataIdToUpdate: activeProjectId, viewId: projectViewId, }, [EIssuesStoreType.PROFILE]: { store: profileIssues, - dataIdToUpdate: currentUser?.id || undefined, viewId: undefined, }, [EIssuesStoreType.CYCLE]: { store: cycleIssues, - dataIdToUpdate: activeProjectId, viewId: cycleId, }, [EIssuesStoreType.MODULE]: { store: moduleIssues, - dataIdToUpdate: activeProjectId, viewId: moduleId, }, }; @@ -78,7 +72,7 @@ export const CreateUpdateIssueModal: React.FC = observer((prop // local storage const { setValue: setLocalStorageDraftIssue } = useLocalStorage("draftedIssue", {}); // current store details - const { store: currentIssueStore, viewId, dataIdToUpdate } = issueStores[storeType]; + const { store: currentIssueStore, viewId } = issueStores[storeType]; useEffect(() => { // if modal is closed, reset active project to null @@ -129,13 +123,13 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleCreateIssue = async (payload: Partial): Promise => { - if (!workspaceSlug || !dataIdToUpdate) return; + if (!workspaceSlug || !payload.project_id) return; try { - const response = await currentIssueStore.createIssue(workspaceSlug, dataIdToUpdate, payload, viewId); + const response = await currentIssueStore.createIssue(workspaceSlug, payload.project_id, payload, viewId); if (!response) throw new Error(); - currentIssueStore.fetchIssues(workspaceSlug, dataIdToUpdate, "mutation", viewId); + currentIssueStore.fetchIssues(workspaceSlug, payload.project_id, "mutation", viewId); if (payload.cycle_id && payload.cycle_id !== "" && storeType !== EIssuesStoreType.CYCLE) await addIssueToCycle(response, payload.cycle_id); @@ -182,10 +176,10 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleUpdateIssue = async (payload: Partial): Promise => { - if (!workspaceSlug || !dataIdToUpdate || !data?.id) return; + if (!workspaceSlug || !payload.project_id || !data?.id) return; try { - const response = await currentIssueStore.updateIssue(workspaceSlug, dataIdToUpdate, data.id, payload, viewId); + const response = await currentIssueStore.updateIssue(workspaceSlug, payload.project_id, data.id, payload, viewId); setToastAlert({ type: "success", title: "Success!", @@ -226,7 +220,7 @@ export const CreateUpdateIssueModal: React.FC = observer((prop }; const handleFormSubmit = async (formData: Partial) => { - if (!workspaceSlug || !dataIdToUpdate || !storeType) return; + if (!workspaceSlug || !formData.project_id || !storeType) return; const payload: Partial = { ...formData, From 2eab3b41a24048d0bd6c147f378736e622472c14 Mon Sep 17 00:00:00 2001 From: Ramesh Kumar Chandra <31303617+rameshkumarchandra@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:49:42 +0530 Subject: [PATCH 03/58] chore: responsive and styling fixes (#3541) --- packages/ui/src/icons/priority-icon.tsx | 1 + .../account/deactivate-account-modal.tsx | 4 ++-- .../widgets/dropdowns/duration-filter.tsx | 10 +++++----- .../widgets/issue-panels/issues-list.tsx | 2 +- .../dashboard/widgets/overview-stats.tsx | 15 ++++++++++++--- web/components/headers/workspace-dashboard.tsx | 2 +- web/layouts/app-layout/sidebar.tsx | 2 +- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/packages/ui/src/icons/priority-icon.tsx b/packages/ui/src/icons/priority-icon.tsx index 0b98b3e6b..caa821305 100644 --- a/packages/ui/src/icons/priority-icon.tsx +++ b/packages/ui/src/icons/priority-icon.tsx @@ -47,6 +47,7 @@ export const PriorityIcon: React.FC = (props) => { > = (props) => {
    -
    -