From 909fac0d4d460f262f1cf1cb550b023dbddca054 Mon Sep 17 00:00:00 2001 From: JayashTripathy Date: Thu, 19 Jun 2025 14:45:32 +0530 Subject: [PATCH 1/2] fix: projects drop only shows joined project --- .../(projects)/analytics/header.tsx | 19 ------------------- .../analytics/analytics-filter-actions.tsx | 4 ++-- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx b/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx index b42b9d21810..e3f09772dfa 100644 --- a/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx +++ b/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx @@ -15,8 +15,6 @@ import { useAppTheme } from "@/hooks/store"; export const WorkspaceAnalyticsHeader = observer(() => { const { t } = useTranslation(); - const searchParams = useSearchParams(); - const analytics_tab = searchParams.get("analytics_tab"); // store hooks const { workspaceAnalyticsSidebarCollapsed, toggleWorkspaceAnalyticsSidebar } = useAppTheme(); @@ -49,23 +47,6 @@ export const WorkspaceAnalyticsHeader = observer(() => { } /> - {analytics_tab === "custom" ? ( - - ) : ( - <> - )} ); diff --git a/web/core/components/analytics/analytics-filter-actions.tsx b/web/core/components/analytics/analytics-filter-actions.tsx index adfe7822b7e..13019063b8c 100644 --- a/web/core/components/analytics/analytics-filter-actions.tsx +++ b/web/core/components/analytics/analytics-filter-actions.tsx @@ -9,7 +9,7 @@ import { ProjectSelect } from "./select/project"; const AnalyticsFilterActions = observer(() => { const { selectedProjects, selectedDuration, updateSelectedProjects, updateSelectedDuration } = useAnalytics(); - const { workspaceProjectIds } = useProject(); + const { joinedProjectIds } = useProject(); return (
{ onChange={(val) => { updateSelectedProjects(val ?? []); }} - projectIds={workspaceProjectIds} + projectIds={joinedProjectIds} /> {/* Date: Thu, 19 Jun 2025 15:06:25 +0530 Subject: [PATCH 2/2] refactor: removed unused things from header --- .../(projects)/analytics/header.tsx | 25 +------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx b/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx index e3f09772dfa..e5ff07c90f2 100644 --- a/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx +++ b/web/app/(all)/[workspaceSlug]/(projects)/analytics/header.tsx @@ -1,38 +1,15 @@ "use client"; -import { useEffect } from "react"; import { observer } from "mobx-react"; -import { useSearchParams } from "next/navigation"; -import { BarChart2, PanelRight } from "lucide-react"; +import { BarChart2 } from "lucide-react"; // plane imports import { useTranslation } from "@plane/i18n"; import { Breadcrumbs, Header } from "@plane/ui"; -import { cn } from "@plane/utils"; // components import { BreadcrumbLink } from "@/components/common/breadcrumb-link"; -// hooks -import { useAppTheme } from "@/hooks/store"; export const WorkspaceAnalyticsHeader = observer(() => { const { t } = useTranslation(); - // store hooks - const { workspaceAnalyticsSidebarCollapsed, toggleWorkspaceAnalyticsSidebar } = useAppTheme(); - - useEffect(() => { - const handleToggleWorkspaceAnalyticsSidebar = () => { - if (window && window.innerWidth < 768) { - toggleWorkspaceAnalyticsSidebar(true); - } - if (window && workspaceAnalyticsSidebarCollapsed && window.innerWidth >= 768) { - toggleWorkspaceAnalyticsSidebar(false); - } - }; - - window.addEventListener("resize", handleToggleWorkspaceAnalyticsSidebar); - handleToggleWorkspaceAnalyticsSidebar(); - return () => window.removeEventListener("resize", handleToggleWorkspaceAnalyticsSidebar); - }, [toggleWorkspaceAnalyticsSidebar, workspaceAnalyticsSidebarCollapsed]); - return (