From 3bf9bd73ae39e0f6c5466ac5a4e6573efa50b2eb Mon Sep 17 00:00:00 2001 From: Fredrik Strand Oseberg Date: Tue, 20 Apr 2021 16:22:23 +0200 Subject: [PATCH] Fix/overall bugs (#271) * fix: reporting * fix: center icon * fix: paths in featureview * fix: revert path in passwordauth * fix: remove console log --- .../Reporting/ReportCard/ReportCard.jsx | 50 +++++++++++++---- .../src/component/Reporting/Reporting.jsx | 16 ++++-- .../component/Reporting/Reporting.module.scss | 1 + .../Reporting/ReportingContainer.jsx | 5 +- .../feature/FeatureView/FeatureView.jsx | 56 ++++++++++--------- 5 files changed, 85 insertions(+), 43 deletions(-) diff --git a/frontend/src/component/Reporting/ReportCard/ReportCard.jsx b/frontend/src/component/Reporting/ReportCard/ReportCard.jsx index bd1952f71a..6e93c9b027 100644 --- a/frontend/src/component/Reporting/ReportCard/ReportCard.jsx +++ b/frontend/src/component/Reporting/ReportCard/ReportCard.jsx @@ -21,30 +21,45 @@ const ReportCard = ({ features }) => { }; const getPotentiallyStaleToggles = activeToggles => { - const result = activeToggles.filter(feature => isFeatureExpired(feature) && !feature.stale); + const result = activeToggles.filter( + feature => isFeatureExpired(feature) && !feature.stale + ); return result; }; - const getHealthRating = (total, staleTogglesCount, potentiallyStaleTogglesCount) => { + const getHealthRating = ( + total, + staleTogglesCount, + potentiallyStaleTogglesCount + ) => { const startPercentage = 100; const stalePercentage = (staleTogglesCount / total) * 100; - const potentiallyStalePercentage = (potentiallyStaleTogglesCount / total) * 100; + const potentiallyStalePercentage = + (potentiallyStaleTogglesCount / total) * 100; - return Math.round(startPercentage - stalePercentage - potentiallyStalePercentage); + return Math.round( + startPercentage - stalePercentage - potentiallyStalePercentage + ); }; const total = features.length; const activeTogglesArray = getActiveToggles(); - const potentiallyStaleToggles = getPotentiallyStaleToggles(activeTogglesArray); + const potentiallyStaleToggles = getPotentiallyStaleToggles( + activeTogglesArray + ); const activeTogglesCount = activeTogglesArray.length; const staleTogglesCount = features.length - activeTogglesCount; const potentiallyStaleTogglesCount = potentiallyStaleToggles.length; - const healthRating = getHealthRating(total, staleTogglesCount, potentiallyStaleTogglesCount); + const healthRating = getHealthRating( + total, + staleTogglesCount, + potentiallyStaleTogglesCount + ); const healthLessThan50 = healthRating < 50; const healthLessThan75 = healthRating < 75; @@ -71,7 +86,9 @@ const ReportCard = ({ features }) => { const renderPotentiallyStaleToggles = () => ( <> - {potentiallyStaleTogglesCount} potentially stale toggles + + {potentiallyStaleTogglesCount} potentially stale toggles + ); @@ -82,10 +99,16 @@ const ReportCard = ({ features }) => {

Toggle report