Mirror of https://github.com/roostorg/coop github.com/roostorg/coop
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix console warning and NaN error (#60)

authored by

Shalabh Agarwal and committed by
GitHub
b4e5959b 936a6900

+8 -1
+7
client/src/webpages/dashboard/overview/Overview.tsx
··· 56 56 57 57 const totalActionsTakenCard = ( 58 58 <OverviewCard 59 + key="total-actions" 59 60 title="Actions taken" 60 61 icon={TapFilled} 61 62 iconColor="text-teal-300" ··· 66 67 67 68 const jobsPendingReviewCard = ( 68 69 <OverviewCard 70 + key="jobs-pending" 69 71 title="Jobs pending review" 70 72 icon={UsersFilled} 71 73 iconColor="text-orange-400" ··· 77 79 78 80 const topPolicyViolationsCard = ( 79 81 <OverviewCard 82 + key="violations-per-policy" 80 83 title="Top policy violations" 81 84 icon={FileExclamationFilled} 82 85 iconColor="text-amber-400" ··· 87 90 88 91 const automatedVsManualActionsCard = ( 89 92 <OverviewCard 93 + key="automated-vs-manual" 90 94 title="Automated vs. manual actions" 91 95 icon={PieChartAlt1Filled} 92 96 iconColor="text-amber-400" ··· 104 108 105 109 const decisionsPerModeratorChart = ( 106 110 <OverviewChart 111 + key="decisions" 107 112 title="Decisions per moderator" 108 113 icon={UsersFilled} 109 114 iconColor="text-orange-400" ··· 116 121 117 122 const actionsPerRuleChart = (chartType: ChartType.BAR | ChartType.LINE) => ( 118 123 <OverviewChart 124 + key="actions" 119 125 title="Actions per rule" 120 126 icon={FlowChartAltFilled} 121 127 iconColor="text-amber-400" ··· 128 134 129 135 const topViolationsByPolicyTable = ( 130 136 <OverviewTable 137 + key="policy" 131 138 title="Policy Violations" 132 139 icon={FileExclamationFilled} 133 140 iconColor="text-amber-400"
+1 -1
client/src/webpages/dashboard/overview/OverviewCard.tsx
··· 472 472 previousTotal?: number; 473 473 }) => { 474 474 const { num, total, previousNum, previousTotal } = opts; 475 - const percent = (num / total) * 100; 475 + const percent = total ? (num / total) * 100 : 0; 476 476 const previousPercent = 477 477 previousNum && previousTotal ? (previousNum / previousTotal) * 100 : 0; 478 478 return (