fix: Application Error on issues list page (#1064)

* fix: Application Error on issues list page

* fix: can't read property of undefined at renderTick
This commit is contained in:
Dakshesh Jain 2023-05-19 15:13:55 +05:30 committed by GitHub
parent 4ce5a450d9
commit 6da4247400
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 14 deletions

View File

@ -80,7 +80,7 @@ export const AnalyticsGraph: React.FC<Props> = ({
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 !== "")

View File

@ -54,22 +54,22 @@ export const ScopeAndDemand: React.FC<Props> = ({ fullScreen = true }) => {
<AnalyticsDemand defaultAnalytics={defaultAnalytics} />
<AnalyticsScope defaultAnalytics={defaultAnalytics} />
<AnalyticsLeaderboard
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,
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"
/>
<AnalyticsLeaderboard
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,
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"
/>

View File

@ -41,7 +41,7 @@ export const AnalyticsScope: React.FC<Props> = ({ 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 (