From 6da4247400c25cc1f3ea87dac7c657f4648634a2 Mon Sep 17 00:00:00 2001 From: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Date: Fri, 19 May 2023 15:13:55 +0530 Subject: [PATCH] fix: Application Error on issues list page (#1064) * fix: Application Error on issues list page * fix: can't read property of undefined at renderTick --- .../custom-analytics/graph/index.tsx | 2 +- .../scope-and-demand/scope-and-demand.tsx | 24 +++++++++---------- .../analytics/scope-and-demand/scope.tsx | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/apps/app/components/analytics/custom-analytics/graph/index.tsx b/apps/app/components/analytics/custom-analytics/graph/index.tsx index 057d76022..42bf5f702 100644 --- a/apps/app/components/analytics/custom-analytics/graph/index.tsx +++ b/apps/app/components/analytics/custom-analytics/graph/index.tsx @@ -80,7 +80,7 @@ export const AnalyticsGraph: React.FC = ({ params.x_axis === "assignees__email" ? (datum) => { const avatar = analytics.extras.assignee_details?.find( - (a) => a.assignees__email === datum.value + (a) => a?.assignees__email === datum?.value )?.assignees__avatar; if (avatar && avatar !== "") diff --git a/apps/app/components/analytics/scope-and-demand/scope-and-demand.tsx b/apps/app/components/analytics/scope-and-demand/scope-and-demand.tsx index 6549f58b4..d5bf10bc2 100644 --- a/apps/app/components/analytics/scope-and-demand/scope-and-demand.tsx +++ b/apps/app/components/analytics/scope-and-demand/scope-and-demand.tsx @@ -54,22 +54,22 @@ export const ScopeAndDemand: React.FC = ({ fullScreen = true }) => { ({ - avatar: user.created_by__avatar, - email: user.created_by__email, - firstName: user.created_by__first_name, - lastName: user.created_by__last_name, - count: user.count, + users={defaultAnalytics.most_issue_created_user?.map((user) => ({ + avatar: user?.created_by__avatar, + email: user?.created_by__email, + firstName: user?.created_by__first_name, + lastName: user?.created_by__last_name, + count: user?.count, }))} title="Most issues created" /> ({ - avatar: user.assignees__avatar, - email: user.assignees__email, - firstName: user.assignees__first_name, - lastName: user.assignees__last_name, - count: user.count, + users={defaultAnalytics.most_issue_closed_user?.map((user) => ({ + avatar: user?.assignees__avatar, + email: user?.assignees__email, + firstName: user?.assignees__first_name, + lastName: user?.assignees__last_name, + count: user?.count, }))} title="Most issues closed" /> diff --git a/apps/app/components/analytics/scope-and-demand/scope.tsx b/apps/app/components/analytics/scope-and-demand/scope.tsx index f7cf53be5..b0a422ed4 100644 --- a/apps/app/components/analytics/scope-and-demand/scope.tsx +++ b/apps/app/components/analytics/scope-and-demand/scope.tsx @@ -41,7 +41,7 @@ export const AnalyticsScope: React.FC = ({ defaultAnalytics }) => ( axisBottom={{ renderTick: (datum) => { const avatar = - defaultAnalytics.pending_issue_user[datum.tickIndex].assignees__avatar ?? ""; + defaultAnalytics.pending_issue_user[datum.tickIndex]?.assignees__avatar ?? ""; if (avatar && avatar !== "") return (