From 4379716e9bed56536df5ba2745c49fa5002b832d Mon Sep 17 00:00:00 2001 From: Joao Ramos Date: Thu, 22 Aug 2024 23:16:16 +0100 Subject: [PATCH] ENCOA-86: Stats page now filters assignments PDF download based on released --- src/components/StatGridItem.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/components/StatGridItem.tsx b/src/components/StatGridItem.tsx index 10c93fe6..7fa485c2 100644 --- a/src/components/StatGridItem.tsx +++ b/src/components/StatGridItem.tsx @@ -178,6 +178,15 @@ const StatsGridItem: React.FC = ({ } }; + const shouldRenderPDFIcon = () => { + if(assignment) { + return assignment.released; + } + + return true; + } + + const content = ( <>
@@ -202,7 +211,7 @@ const StatsGridItem: React.FC = ({ Level{" "} {(aggregatedLevels.reduce((accumulator, current) => accumulator + current.level, 0) / aggregatedLevels.length).toFixed(1)} - {renderPdfIcon(session, textColor, textColor)} + {shouldRenderPDFIcon() && renderPdfIcon(session, textColor, textColor)}
{examNumber === undefined ? ( <>