From 09a30886129d358fb2b7ceb58889c4d538e832f8 Mon Sep 17 00:00:00 2001 From: boppanapraveen <61085397+boppanapraveen@users.noreply.github.com> Date: Wed, 12 Nov 2025 19:53:06 -0600 Subject: [PATCH 1/3] Fix: Implemented .css to .module.css PR Anlaytics Dashboard --- .../ReviewsInsight/ActionDoneGraph.jsx | 8 ++++---- .../ReviewsInsight/PRQualityGraph.jsx | 10 +++++----- .../ReviewsInsight/ReviewsInsight.jsx | 20 ++++++++++--------- ...sInsight.css => ReviewsInsight.module.css} | 0 4 files changed, 20 insertions(+), 18 deletions(-) rename src/components/PRAnalyticsDashboard/ReviewsInsight/{ReviewsInsight.css => ReviewsInsight.module.css} (100%) diff --git a/src/components/PRAnalyticsDashboard/ReviewsInsight/ActionDoneGraph.jsx b/src/components/PRAnalyticsDashboard/ReviewsInsight/ActionDoneGraph.jsx index 646a0d14c9..3ff81a0c6d 100644 --- a/src/components/PRAnalyticsDashboard/ReviewsInsight/ActionDoneGraph.jsx +++ b/src/components/PRAnalyticsDashboard/ReviewsInsight/ActionDoneGraph.jsx @@ -1,5 +1,5 @@ import { Bar } from 'react-chartjs-2'; -import './ReviewsInsight.css'; +import styles from './ReviewsInsight.module.css'; import { useSelector } from 'react-redux'; function ActionDoneGraph({ selectedTeams, teamData }) { @@ -10,7 +10,7 @@ function ActionDoneGraph({ selectedTeams, teamData }) { } if (!teamData || Object.keys(teamData).length === 0) { - return
No data available for Action Done Graph.
; + return
No data available for Action Done Graph.
; } const isAllTeams = selectedTeams.some(team => team.value === 'All'); @@ -81,9 +81,9 @@ function ActionDoneGraph({ selectedTeams, teamData }) { }; return ( -
+

PR: Action Done

-
+
diff --git a/src/components/PRAnalyticsDashboard/ReviewsInsight/PRQualityGraph.jsx b/src/components/PRAnalyticsDashboard/ReviewsInsight/PRQualityGraph.jsx index 5726f606b1..46b420f3ce 100644 --- a/src/components/PRAnalyticsDashboard/ReviewsInsight/PRQualityGraph.jsx +++ b/src/components/PRAnalyticsDashboard/ReviewsInsight/PRQualityGraph.jsx @@ -1,5 +1,5 @@ import { Pie } from 'react-chartjs-2'; -import './ReviewsInsight.css'; +import styles from './ReviewsInsight.module.css'; import { useSelector } from 'react-redux'; function PRQualityGraph({ selectedTeams, qualityData }) { @@ -10,7 +10,7 @@ function PRQualityGraph({ selectedTeams, qualityData }) { } if (!qualityData || Object.keys(qualityData).length === 0) { - return
No data available for Quality Graph.
; + return
No data available for Quality Graph.
; } const isAllTeams = selectedTeams.some(team => team.value === 'All'); @@ -57,11 +57,11 @@ function PRQualityGraph({ selectedTeams, qualityData }) { }; return ( -
+

PR Quality Distribution

-
+
{teamsToDisplay.map(team => ( -
+

{team}

diff --git a/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.jsx b/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.jsx index f666462620..ef956f91ce 100644 --- a/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.jsx +++ b/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.jsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import Select from 'react-select'; -import './ReviewsInsight.css'; +import styles from './ReviewsInsight.module.css'; import ActionDoneGraph from './ActionDoneGraph'; import PRQualityGraph from './PRQualityGraph'; import { fetchReviewsInsights } from '../../../actions/prAnalytics/reviewsInsightsAction'; @@ -93,11 +93,13 @@ function ReviewsInsight() { ]; return ( -
+

PR Reviews Insights

-
-
+
+
-
+
+
+
+ +
-
- +
+ setDataViewActive(v => !v)} + aria-label="Toggle data view: Percent vs Number" + className={styles.riSwitchInput} + /> + + + + + {dataViewActive ? 'PERCENT' : 'NUMBER'} + +
+
-
+
{selectedTeams.length === 0 ? ( -

No teams selected

+

+ No teams selected +

) : selectedTeams.some(team => team.value === 'All') ? ( -

Selected Teams: All Teams

+

+ Selected Teams: All Teams +

) : ( -

Selected Teams: {selectedTeams.map(team => team.label).join(', ')}

+

+ Selected Teams: {selectedTeams.map(team => team.label).join(', ')} +

)}
- {loading &&
Loading...
} - {error &&
{error}
} + {loading && ( +
+ Loading... +
+ )} + {error &&
{error}
} {!loading && !error && ( -
+
- +
)}
diff --git a/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.module.css b/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.module.css index eea8d8fad6..51af3510f9 100644 --- a/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.module.css +++ b/src/components/PRAnalyticsDashboard/ReviewsInsight/ReviewsInsight.module.css @@ -1,5 +1,5 @@ -.reviews-insight-container { - padding: 20px; +.reviewsInsightContainer { + padding: 20px 20px 60px; font-family: Arial, sans-serif; background-color: #ffffff; color: #000000; @@ -7,118 +7,155 @@ transition: background-color 0.3s, color 0.3s; } -.reviews-insight-container h1 { - color: #000000; -} -.dark-mode h1 { - color: #f1f1f1; +.heading { + color: #000000; + text-align: center; } -.reviews-insight-container.dark-mode { - background-color: #1b2a41; +.darkModeForeground { color: #f1f1f1; } -@media screen and (max-width: 1080px) { - .ri-graphs { - flex-direction: column; - gap: 5px; - } - - .ri-action-done-graph{ - width: 100% !important; - height: 500px; - } - - .ri-quality-graph { - width: 100% !important; - } - - .ri-graph{ - min-height: 300px; - } +.darkModeBackground{ + background-color: #1b2a41; } -.ri-filters { +.riFilters { display: flex; justify-content: space-between; - margin-bottom: 20px; + margin-bottom: 15px; + padding: 10px; } -.dark-mode .ri-filters { - background-color: #1c2541; - color: #f1f1f1; - box-shadow: 2px 2px 4px 1px black; - padding: 10px; - border-radius: 8px; +.riGraphs { + display: flex; + justify-content: space-around; } -.ri-filter-item { +.riFilterItem { display: flex; flex-direction: column; - margin-right: 20px; + padding: 10px 25px; + min-width: 23ch; } -.dark-mode #ri-duration-filter { +.riDurationFilter { + min-height: 40px; + align-items: center; + position: relative; + overflow: hidden; + padding: 2px 8px; + box-sizing: border-box; + box-shadow: 2px 2px 4px 1px black; +} + +.riDurationFilterDarkMode{ background-color: #1c2541; box-shadow: 2px 2px 4px 1px black; border: none; color: #f1f1f1; } -.ri-filter-item label { +.riFilterItemLabel { margin-bottom: 5px; font-weight: bold; } -.dark-mode .ri-filter-item label { - color: #f1f1f1; -} - -.ri-selected-teams p{ - margin-bottom: 20px; +.riSelectedTeams { + margin: 20px 0 40px; font-style: italic; text-align: center; font-size: 24px; } -.no-data-ri { - text-align: center; - font-size: 18px; - margin-top: 20px; +.riToggleWrap { + display: inline-flex; + gap: 13px; + white-space: nowrap; } -.dark-mode .ri-selected-teams p { - color: #f1f1f1; +.riDataviewTitle { + font-weight: 600; + font-size: 16px; + margin-right: 4px; } -.ri-graphs { - display: flex; - justify-content: space-around; +.riSwitch { + display: inline-flex; + position: relative; + align-items: center; + gap: 10px; + padding: 8px 12px; + width: 42px; + height: 24px; } -.ri-quality-graph { - width: 50%; - display: flex; - flex-direction: column; +.riSwitchInput { + opacity: 1; + width: 0; + height: 0; } -.ri-quality-graph h2 { - color: #000000; +.riSwitch input:checked + .riSlider::before { + transform: translateX(18px); } -.dark-mode .ri-quality-graph h2 { - color: #f1f1f1; +.riSlider { + position: absolute; + cursor: pointer; + inset: 0; + background: #1c1c1c; + border-radius: 999px; + transition: background 0.2s ease; +} + +.riSlider::before { + content: ''; + position: absolute; + height: 20px; + width: 20px; + left: 2px; + top: 2px; + background: #fff; + border-radius: 50%; + transition: transform 0.2s ease; +} + +.riModeLabel { + font-weight: 700; + font-size: 12px; + letter-spacing: 0.08em; + color: #4a4a4a; +} + +.riSliderDarkMode{ + background: #e6e6e6; } -.ri-charts { +.riSliderDarkMode::before{ + background: #1c2541; +} + +.noData { + text-align: center; + font-size: 18px; + margin-top: 20px; +} + +.riQualityGraph { + width: 50%; + display: flex; + flex-direction: column; +} + +.riCharts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-evenly; } -.ri-chart { +.riChart { width: 250px; text-align: center; border: 1px solid #ccc; @@ -129,35 +166,20 @@ transition: background-color 0.3s, color 0.3s; } -.dark-mode .ri-chart { +.riChartDarkMode{ background-color: #1c2541; color: #f1f1f1; box-shadow: 2px 2px 4px 1px black; border: none; } -.ri-chart h3 { - color: #000000; -} - -.dark-mode .ri-chart h3 { - color: #f1f1f1; -} - -.ri-action-done-graph { +.riActionDoneGraph { width: 50%; display: flex; flex-direction: column; } -.ri-action-done-graph h2 { - color: #000000; -} -.dark-mode .ri-action-done-graph h2 { - color: #f1f1f1; -} - -.ri-graph { +.riGraph { border: 1px solid #ccc; padding: 10px; height: 100%; @@ -168,50 +190,46 @@ transition: background-color 0.3s, color 0.3s; } -.dark-mode .ri-graph { +.riGraphDarkMode{ background-color: #1c2541; color: #f1f1f1; box-shadow: 2px 2px 4px 1px black; border: none; } -.ri-graph canvas{ - height: auto !important; -} - -.ri-graph-placeholder { - height: 300px; - background-color: #f0f0f0; - display: flex; - align-items: center; - justify-content: center; - color: #666666; - font-size: 14px; +.riGraph canvas { + height: 100% !important; } -.dark-mode .ri-graph-placeholder { - background-color: #1c1c1c; - color: #f1f1f1; -} - -.ri-team-name { - font-weight: bold; - margin-bottom: 10px; - text-align: center; -} - -.dark-mode .ri-team-name { - color: #f1f1f1; -} - -.ri-loading { +.riLoading { text-align: center; font-size: 18px; - color: #666666; + color: #888; } -.ri-error { +.riError { text-align: center; color: #dc3545; font-weight: bold; } + + +@media screen and (max-width: 1080px) { + .riGraphs { + flex-direction: column; + gap: 5px; + } + + .riActionDoneGraph { + width: 100% !important; + height: 500px; + } + + .riQualityGraph { + width: 100% !important; + } + + .riGraph { + min-height: 300px; + } +} \ No newline at end of file