fix unassigned issues count in analytics page (#4542)

This commit is contained in:
rahulramesha 2024-05-22 12:33:36 +05:30 committed by GitHub
parent 1c377163d2
commit 6eca4a1f1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 7 deletions

View File

@ -45,7 +45,7 @@ export const ScopeAndDemand: React.FC<Props> = (props) => {
// scope data
const pendingIssues = defaultAnalytics?.pending_issue_user ?? [];
const pendingUnAssignedIssues = pendingIssues?.filter((issue) => issue.assignees__id === null);
const pendingUnAssignedIssuesUser = pendingIssues?.find((issue) => issue.assignees__id === null);
const pendingAssignedIssues = pendingIssues?.filter((issue) => issue.assignees__id !== null);
return (
@ -56,7 +56,7 @@ export const ScopeAndDemand: React.FC<Props> = (props) => {
<div className={`grid grid-cols-1 gap-5 ${fullScreen ? "md:grid-cols-2" : ""}`}>
<AnalyticsDemand defaultAnalytics={defaultAnalytics} />
<AnalyticsScope
pendingUnAssignedIssues={pendingUnAssignedIssues}
pendingUnAssignedIssuesUser={pendingUnAssignedIssuesUser}
pendingAssignedIssues={pendingAssignedIssues}
/>
<AnalyticsLeaderBoard

View File

@ -6,19 +6,21 @@ import emptyBarGraph from "public/empty-state/empty_bar_graph.svg";
// types
type Props = {
pendingUnAssignedIssues: IDefaultAnalyticsUser[];
pendingUnAssignedIssuesUser: IDefaultAnalyticsUser | undefined;
pendingAssignedIssues: IDefaultAnalyticsUser[];
};
export const AnalyticsScope: React.FC<Props> = ({ pendingUnAssignedIssues, pendingAssignedIssues }) => (
export const AnalyticsScope: React.FC<Props> = ({ pendingUnAssignedIssuesUser, pendingAssignedIssues }) => (
<div className="rounded-[10px] border border-custom-border-200 p-3">
<div className="divide-y divide-custom-border-200">
<div>
<div className="flex items-center justify-between">
<h6 className=" text-base font-medium">Pending issues</h6>
<div className="relative flex items-center py-1 px-3 rounded-md gap-2 text-xs text-custom-primary-100 bg-custom-primary-100/10">
Unassigned: {pendingUnAssignedIssues.length}
</div>
{pendingUnAssignedIssuesUser && (
<div className="relative flex items-center py-1 px-3 rounded-md gap-2 text-xs text-custom-primary-100 bg-custom-primary-100/10">
Unassigned: {pendingUnAssignedIssuesUser.count}
</div>
)}
</div>
{pendingAssignedIssues && pendingAssignedIssues.length > 0 ? (