fix: sub issue progress indicator fix (#1847)

This commit is contained in:
Anmol Singh Bhatia 2023-08-11 19:05:13 +05:30 committed by GitHub
parent ac6d2b0139
commit a3d99100ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,13 +93,14 @@ export const SubIssuesList: FC<Props> = ({ parentIssue, user, disabled = false }
}); });
}; };
const completedSubIssues = subIssuesResponse const completedSubIssue = subIssuesResponse?.state_distribution.completed ?? 0;
? subIssuesResponse.state_distribution.completed + const cancelledSubIssue = subIssuesResponse?.state_distribution.cancelled ?? 0;
subIssuesResponse.state_distribution.cancelled
: 0; const totalCompletedSubIssues = completedSubIssue + cancelledSubIssue;
const totalSubIssues = subIssuesResponse ? subIssuesResponse.sub_issues.length : 0; const totalSubIssues = subIssuesResponse ? subIssuesResponse.sub_issues.length : 0;
const completionPercentage = (completedSubIssues / totalSubIssues) * 100; const completionPercentage = (totalCompletedSubIssues / totalSubIssues) * 100;
const isNotAllowed = memberRole.isGuest || memberRole.isViewer || disabled; const isNotAllowed = memberRole.isGuest || memberRole.isViewer || disabled;