Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c0252b3
feat: add project status donut chart with date filters (frontend)
Saicharan1505 Aug 30, 2025
9b812e8
fix(routes): removed duplicate imports for LogTools and EquipmentUpdate
Saicharan1505 Oct 5, 2025
265d805
chore: rebuilt dependencies and finalized merge with development
Saicharan1505 Oct 5, 2025
6ff47c5
chore: added regenerated yarn.lock for CI build
Saicharan1505 Oct 5, 2025
834d65e
fix: use cross-platform rollup build for CI compatibility
Saicharan1505 Oct 5, 2025
546446d
chore: resolved merge conflicts and converted CSS to modules - FINAL FIX
vamsidharpanithi Oct 17, 2025
f3d98f5
chore: update yarn.lock to fix CI/CD platform compatibility issues
vamsidharpanithi Oct 17, 2025
6142b0d
fix: update CI/CD workflows to handle platform compatibility issues
vamsidharpanithi Oct 17, 2025
8fdc776
fix: improve ProjectStatus component security and error handling
vamsidharpanithi Oct 17, 2025
f734534
merged development into feature/project-status-donut-frontend
Juhitha-Reddy Nov 3, 2025
cda815d
Fix: regenerate lockfile for cross-platform compatibility
Juhitha-Reddy Nov 3, 2025
ae81e34
Updated merge with developement branch
Juhitha-Reddy Nov 13, 2025
b324dfc
resolved package dependancy issue
Juhitha-Reddy Nov 13, 2025
55ed766
Update yarn.lock
Juhitha-Reddy Nov 13, 2025
c32da7e
Merge branch 'development' into feature/project-status-donut-frontend
Juhitha-Reddy Dec 6, 2025
4696112
fix: Remove duplicate CSS selectors and add dark mode support with da…
Juhitha-Reddy Dec 6, 2025
734e07c
Merge branch 'development' into feature/project-status-donut-frontend
Juhitha-Reddy Jan 1, 2026
12cd93f
removed the duplicate files
Juhitha-Reddy Jan 1, 2026
1e81a12
Fixed reliability issues
Juhitha-Reddy Jan 1, 2026
0dc0773
Merge branch 'development' into feature/project-status-donut-frontend
Juhitha-Reddy Mar 1, 2026
6bd80c7
fix: Removed duplicate code
Juhitha-Reddy Mar 1, 2026
20bbd29
Merged development into local
Juhitha-Reddy Apr 6, 2026
a8e30e0
Fixed tooltip issues and updated authentication handler
Juhitha-Reddy Apr 6, 2026
ac068c0
Fixed lint issues
Juhitha-Reddy Apr 6, 2026
4f9be02
Resolve merge conflicts with origin/development
Jun 13, 2026
7227500
Resolve merge conflicts with origin/development
Jun 13, 2026
821a383
Resolve merge conflicts with origin/development
Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
concurrency:
group: Build and Deploy / ${{ github.ref_name == 'main' && 'Production' || 'Development' }}
cancel-in-progress: true
jobs:
jobs:
# Build
build:
name: Build
Expand All @@ -23,14 +23,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: "yarn"
- name: Install Dependencies
run: yarn install --frozen-lockfile
run: yarn install --frozen-lockfile --ignore-platform
# We don't run tests here since we assume it's already done during PR process.
# - name: Update Browser List
# run: npx browserslist@latest --update-db
- name: Build React App
run: yarn run build && cp build/index.html build/200.html
run: yarn run build && cp build/index.html build/200.html
env:
NODE_ENV: ${{ github.ref_name == 'main' && 'production' || 'development' }}
REACT_APP_APIENDPOINT: ${{ vars.REACT_APP_API_ENDPOINT }}
Expand Down Expand Up @@ -60,6 +60,6 @@ jobs:
uses: dswistowski/surge-sh-action@v1
with:
domain: ${{ vars.SURGE_DOMAIN }}
project: './build'
project: "./build"
login: ${{ secrets.SURGE_LOGIN }}
token: ${{ secrets.SURGE_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/pull_request_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ jobs:
run: |
# Get list of changed CSS files in this PR
changed_files=$(git diff --name-only --diff-filter=ACMR origin/${{ github.base_ref }}...HEAD | grep '\.css$' || true)

if [ -z "$changed_files" ]; then
echo "No CSS files changed in this PR"
exit 0
fi

echo "Changed CSS files:"
echo "$changed_files"

# Check if any of the changed files are disallowed
disallowed=$(echo "$changed_files" | grep -vE '(\.module\.css$|index\.css$)' || true)

if [ -n "$disallowed" ]; then
echo "❌ Disallowed CSS file detected! Only '.module.css' (or 'index.css') files are permitted."
echo "The following files violate the CSS Module policy:"
Expand All @@ -43,8 +43,8 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
cache: yarn

- name: Install dependencies
run: yarn install
run: yarn install --ignore-platform

- name: Run tests
run: NODE_OPTIONS="--max-old-space-size=4096" yarn test
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"react-chartjs-2": "^5.3.0",
"react-circular-progressbar": "^2.1.0",
"react-collapsible": "^2.10.0",
"react-datepicker": "^4.8.0",
"react-datepicker": "^4.25.0",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
"react-icons": "^4.12.0",
Expand Down
62 changes: 0 additions & 62 deletions src/actions/lbdashboard/userPreferenceActions.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,56 @@
import React, { useEffect, useState } from 'react';
import { PieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer, Label } from 'recharts';
import axios from 'axios';
import { useSelector } from 'react-redux';
import { PieChart, Pie, Cell, Tooltip, Legend, ResponsiveContainer, Label } from 'recharts';
import { fetchProjectStatusSummary } from '../../../services/projectStatusService';
import styles from './ProjectStatusDonutChart.module.css';
import PropTypes from 'prop-types';

const COLORS = ['#B39DDB', '#80DEEA', '#FFABAB'];

function CustomTooltip({ active, payload, darkMode }) {
if (!active || !payload?.length) return null;
const { name, value } = payload[0];
const total = payload[0]?.payload?.total || 0;
const pct = total ? Number(((value / total) * 100).toFixed(1)) : 0;

const COLORS = ['#B39DDB', '#80DEEA', '#FFABAB']; // Active, Completed, Delayed
return (
<div
className={styles.tooltip}
style={
darkMode
? { backgroundColor: '#1b2a41', color: '#fff', border: '1px solid #4a6a8a' }
: { backgroundColor: '#fff', color: '#333', border: '1px solid #d1d5db' }
}
>
<p className={styles.tooltipName}>{name}</p>
<p className={styles.tooltipValue}>
Count: <strong>{value}</strong>
</p>
<p className={styles.tooltipValue}>
Share: <strong>{pct}%</strong>
</p>
</div>
);
}
CustomTooltip.propTypes = {
active: PropTypes.bool,
payload: PropTypes.arrayOf(
PropTypes.shape({
name: PropTypes.string,
value: PropTypes.number,
payload: PropTypes.shape({
total: PropTypes.number,
}),
}),
),
darkMode: PropTypes.bool,
};

CustomTooltip.defaultProps = {
active: false,
payload: [],
darkMode: false,
};

export default function ProjectStatusDonutChart() {
const darkMode = useSelector(state => state.theme?.darkMode || false);
Expand All @@ -19,32 +65,12 @@ export default function ProjectStatusDonutChart() {
try {
setLoading(true);
setError(null);

// Build query string
const query = [];
if (startDate) query.push(`startDate=${startDate}`);
if (endDate) query.push(`endDate=${endDate}`);
const queryString = query.length ? `?${query.join('&')}` : '';

// Get token from localStorage (Dev Admin session)
const token = localStorage.getItem('token');

const res = await axios.get(`http://localhost:4500/api/projects/status${queryString}`, {
headers: { Authorization: token },
const data = await fetchProjectStatusSummary({
startDate: startDate || undefined,
endDate: endDate || undefined,
});

// TEMPORARY MOCK DATA - for testing purposes
/*setStatusData({
totalProjects: 50,
activeProjects: 20,
completedProjects: 20,
delayedProjects: 10,
});
return;*/

setStatusData(res.data);
setStatusData(data);
} catch (err) {
// console.error(err);
setError('Unable to load project status.');
} finally {
setLoading(false);
Expand All @@ -59,10 +85,12 @@ export default function ProjectStatusDonutChart() {
if (error) return <p>{error}</p>;
if (!statusData) return <p>No data available.</p>;

const total =
statusData.activeProjects + statusData.completedProjects + statusData.delayedProjects;
const pieData = [
{ name: 'Active Projects', value: statusData.activeProjects },
{ name: 'Completed Projects', value: statusData.completedProjects },
{ name: 'Delayed Projects', value: statusData.delayedProjects },
{ name: 'Active Projects', value: statusData.activeProjects, total },
{ name: 'Completed Projects', value: statusData.completedProjects, total },
{ name: 'Delayed Projects', value: statusData.delayedProjects, total },
];

// SHOW MESSAGE WHEN THERE IS NO DATA
Expand Down Expand Up @@ -144,7 +172,7 @@ export default function ProjectStatusDonutChart() {
/>
</Pie>

<Tooltip />
<Tooltip content={<CustomTooltip darkMode={darkMode} />} />
<Legend verticalAlign="bottom" align="center" />
</PieChart>
</ResponsiveContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,25 @@
font-weight: 500;
}

.tooltip {
padding: 10px 14px;
border-radius: 8px;
box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
font-size: 13px;
line-height: 1.5;
z-index: 10;
pointer-events: none;
}

.tooltipName {
margin: 0 0 4px;
font-weight: 600;
font-size: 14px;
}

.tooltipValue {
margin: 0;
}
/* DARK MODE */
.dark {
background: #1b2a41;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@
justify-content: center;
}

/* Merged duplicate hover/active selectors */
.detail-item:hover,
.detail-item.active {
background: #111827;
Expand All @@ -279,6 +280,8 @@
.detail-item.active span {
color: #fff !important;
}
.detail-item:hover .detail-pct,
.detail-item.active .detail-pct { color: #93c5fd !important; } /* keep contrast on hover */

/* Map children into the grid */
.detail-dot {
Expand Down Expand Up @@ -545,6 +548,7 @@
}

/* --- Ensure detail cards always show a visible background --- */
/* Merged all .chart-details .detail-item selectors */
.chart-details .detail-item {
background-color: #f1f5f9; /* stronger than #f8fafc, more visible */
border: 1px solid #e2e8f0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@
}

.lbMessagingContactName {
font-size: 15px;
font-weight: 500;
}

Expand Down
Loading
Loading