From ad1d9c34ea8d49454e5058f6266a9254d8f3a201 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Fri, 24 Apr 2026 14:03:22 +0300 Subject: [PATCH] =?UTF-8?q?UI=20-=20=D0=9C=D0=95=D0=96=D0=9F=D0=A0=D0=9E?= =?UTF-8?q?=D0=95=D0=9A=D0=A2=D0=9D=D0=90=D0=AF=20=D0=9A=D0=9E=D0=9C=D0=9C?= =?UTF-8?q?=D0=A3=D0=9D=D0=98=D0=9A=D0=90=D0=A6=D0=98=D0=AF:=20=D0=B2?= =?UTF-8?q?=D0=BE=D1=81=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9=20=D1=81=D0=B2=D0=BE=D0=B4=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B0=D0=BD=D0=B0=D0=BB=D0=B8=D1=82=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/analytics/total-insights.tsx | 62 +++++++++++++++-- plane-src/apps/web/styles/globals.css | 67 +++++++++++++++++++ 2 files changed, 123 insertions(+), 6 deletions(-) diff --git a/plane-src/apps/web/core/components/analytics/total-insights.tsx b/plane-src/apps/web/core/components/analytics/total-insights.tsx index 98e5ed0..5b72d39 100644 --- a/plane-src/apps/web/core/components/analytics/total-insights.tsx +++ b/plane-src/apps/web/core/components/analytics/total-insights.tsx @@ -22,6 +22,29 @@ import InsightCard from "./insight-card"; const analyticsService = new AnalyticsService(); +const WORK_ITEM_SUMMARY_FIELDS: IInsightField[] = [ + { + key: "total_work_items", + i18nKey: "workspace_analytics.total", + }, + { + key: "started_work_items", + i18nKey: "workspace_analytics.started_work_items", + }, + { + key: "backlog_work_items", + i18nKey: "workspace_analytics.backlog_work_items", + }, + { + key: "un_started_work_items", + i18nKey: "workspace_analytics.un_started_work_items", + }, + { + key: "completed_work_items", + i18nKey: "workspace_analytics.completed_work_items", + }, +]; + const getInsightLabel = ( analyticsType: TAnalyticsTabsBase, item: IInsightField, @@ -61,6 +84,13 @@ const TotalInsights = observer(function TotalInsights({ const workspaceSlug = params.workspaceSlug.toString(); const { t } = useTranslation(); const { selectedDuration, selectedProjects, selectedCycle, selectedModule, isPeekView, isEpic } = useAnalytics(); + const insightFields = + analyticsType === "work-items" + ? ANALYTICS_INSIGHTS_FIELDS[analyticsType]?.length + ? ANALYTICS_INSIGHTS_FIELDS[analyticsType] + : WORK_ITEM_SUMMARY_FIELDS + : (ANALYTICS_INSIGHTS_FIELDS[analyticsType] ?? []); + const shouldUseSummaryCard = analyticsType === "work-items"; const { data: totalInsightsData, isLoading } = useSWR( `total-insights-${analyticsType}-${selectedDuration}-${selectedProjects}-${selectedCycle}-${selectedModule}-${isEpic}`, () => @@ -77,18 +107,38 @@ const TotalInsights = observer(function TotalInsights({ isPeekView ) ); + + if (shouldUseSummaryCard) { + return ( +
+ {insightFields.map((item) => ( +
+
+ {getInsightLabel(analyticsType, item, isEpic, t)} +
+
+ {totalInsightsData?.[item.key]?.count ?? 0} +
+
+ ))} +
+ ); + } + return (
- {ANALYTICS_INSIGHTS_FIELDS[analyticsType]?.map((item) => ( + {insightFields.map((item) => (