diff --git a/web/components/analytics/scope-and-demand/demand.tsx b/web/components/analytics/scope-and-demand/demand.tsx index 20bc502ce..0100f8630 100644 --- a/web/components/analytics/scope-and-demand/demand.tsx +++ b/web/components/analytics/scope-and-demand/demand.tsx @@ -9,7 +9,6 @@ type Props = { export const AnalyticsDemand: React.FC = ({ defaultAnalytics }) => (
-
DEMAND

Total open tasks

{defaultAnalytics.open_issues}

diff --git a/web/components/analytics/scope-and-demand/scope-and-demand.tsx b/web/components/analytics/scope-and-demand/scope-and-demand.tsx index 3c5e3f48e..2e9756d67 100644 --- a/web/components/analytics/scope-and-demand/scope-and-demand.tsx +++ b/web/components/analytics/scope-and-demand/scope-and-demand.tsx @@ -43,6 +43,11 @@ export const ScopeAndDemand: React.FC = (props) => { workspaceSlug ? () => analyticsService.getDefaultAnalytics(workspaceSlug.toString(), params) : null ); + // scope data + const pendingIssues = defaultAnalytics?.pending_issue_user ?? []; + const pendingUnAssignedIssues = pendingIssues?.filter((issue) => issue.assignees__id === null); + const pendingAssignedIssues = pendingIssues?.filter((issue) => issue.assignees__id !== null); + return ( <> {!defaultAnalyticsError ? ( @@ -50,7 +55,10 @@ export const ScopeAndDemand: React.FC = (props) => {
- + ({ avatar: user?.created_by__avatar, diff --git a/web/components/analytics/scope-and-demand/scope.tsx b/web/components/analytics/scope-and-demand/scope.tsx index 527761e96..2b1796259 100644 --- a/web/components/analytics/scope-and-demand/scope.tsx +++ b/web/components/analytics/scope-and-demand/scope.tsx @@ -1,32 +1,36 @@ // ui -import { IDefaultAnalyticsResponse } from "@plane/types"; +import { IDefaultAnalyticsUser } from "@plane/types"; import { BarGraph, ProfileEmptyState } from "@/components/ui"; // image import emptyBarGraph from "public/empty-state/empty_bar_graph.svg"; // types type Props = { - defaultAnalytics: IDefaultAnalyticsResponse; + pendingUnAssignedIssues: IDefaultAnalyticsUser[]; + pendingAssignedIssues: IDefaultAnalyticsUser[]; }; -export const AnalyticsScope: React.FC = ({ defaultAnalytics }) => ( -
-
SCOPE
+export const AnalyticsScope: React.FC = ({ pendingUnAssignedIssues, pendingAssignedIssues }) => ( +
-
Pending issues
- {defaultAnalytics.pending_issue_user && defaultAnalytics.pending_issue_user.length > 0 ? ( +
+
Pending issues
+
+ Unassigned: {pendingUnAssignedIssues.length} +
+
+ + {pendingAssignedIssues && pendingAssignedIssues.length > 0 ? ( `#f97316`} - customYAxisTickValues={defaultAnalytics.pending_issue_user.map((d) => (d.count > 0 ? d.count : 50))} + customYAxisTickValues={pendingAssignedIssues.map((d) => (d.count > 0 ? d.count : 50))} tooltip={(datum) => { - const assignee = defaultAnalytics.pending_issue_user.find( - (a) => a.assignees__id === `${datum.indexValue}` - ); + const assignee = pendingAssignedIssues.find((a) => a.assignees__id === `${datum.indexValue}`); return (
@@ -39,7 +43,7 @@ export const AnalyticsScope: React.FC = ({ defaultAnalytics }) => ( }} axisBottom={{ renderTick: (datum) => { - const assignee = defaultAnalytics.pending_issue_user[datum.tickIndex] ?? ""; + const assignee = pendingAssignedIssues[datum.tickIndex] ?? ""; if (assignee && assignee?.assignees__avatar && assignee?.assignees__avatar !== "") return (