Skip to content
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
80848f5
Nirali Projects and team reports merge conflicts
May 7, 2026
ef97d3d
Initial Commit for the volunteer's report
Apr 25, 2026
eaa0d99
Import changes
May 6, 2026
0ad8439
Nirali changes in API Call for volunteering report
May 6, 2026
21e4d99
Nirali changes in API Call for volunteering report
May 6, 2026
1d4933e
Nirali changes in API Call for volunteering report
May 6, 2026
70a9015
Nirali changes in API Call for volunteering report
May 6, 2026
35790b6
Projects and team sonar qube changes
May 7, 2026
7b3cb34
Nirali Projects and team sonar qube changes
May 7, 2026
bd04ed8
Nirali Projects and team sonar qube changes
May 7, 2026
f51e8d6
Nirali Projects and team sonar qube changes
May 7, 2026
ea70733
Nirali Projects and team sonar qube changes
May 7, 2026
ef5a2e2
Nirali Projects and team sonar qube changes
May 7, 2026
899a6f5
Nirali Projects and team sonar qube changes
May 7, 2026
621a8d7
Nirali Projects and team sonar qube changes
May 7, 2026
ea21733
Nirali Projects and team sonar qube changes
May 7, 2026
53d9a41
Nirali Projects and team sonar qube changes
May 7, 2026
30b93b2
Nirali Projects and team reports merge conflicts
May 7, 2026
287ba64
Initial Commit for the volunteer's report
Apr 25, 2026
beb8073
Import changes
May 6, 2026
d24463e
Nirali changes in API Call for volunteering report
May 6, 2026
21d56de
Nirali changes in API Call for volunteering report
May 6, 2026
d5945f0
Nirali changes in API Call for volunteering report
May 6, 2026
154c916
Nirali changes in API Call for volunteering report
May 6, 2026
38d5888
Projects and team sonar qube changes
May 7, 2026
1f29a07
Nirali Projects and team sonar qube changes
May 7, 2026
447aa8f
Nirali Projects and team sonar qube changes
May 7, 2026
64049ae
Nirali Projects and team sonar qube changes
May 7, 2026
34fbbf7
Nirali Projects and team sonar qube changes
May 7, 2026
71ca8c1
Nirali Projects and team sonar qube changes
May 7, 2026
1dc37c3
Nirali Projects and team sonar qube changes
May 7, 2026
17381ac
Nirali Projects and team sonar qube changes
May 7, 2026
4d4db7c
Nirali Projects and team sonar qube changes
May 7, 2026
30ee372
Nirali Projects and team sonar qube changes
May 7, 2026
79cada7
Nirali changes for merge conflicts
Jul 7, 2026
97afc04
Nirali changes for merge conflicts
Nirali164 Jul 7, 2026
e1b65f7
Merge branch 'development' of https://github.com/OneCommunityGlobal/H…
Nirali164 Jul 11, 2026
d744493
Changes for sonar test failure
Nirali164 Jul 12, 2026
fd3a5b7
Changes for sonar test failure
Nirali164 Jul 12, 2026
3e4974a
Changes for sonar test failure
Nirali164 Jul 12, 2026
d5e5bcd
Changes for sonar test failure
Nirali164 Jul 12, 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
5 changes: 5 additions & 0 deletions .husky-disabled/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run test
134 changes: 93 additions & 41 deletions src/components/Reports/ProjectTable.jsx
Original file line number Diff line number Diff line change
@@ -1,49 +1,101 @@
import React from 'react';
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'reactstrap';
import { boxStyle, boxStyleDark } from '~/styles';
import { Link } from 'react-router-dom';

function ProjectTable({ projects, darkMode }) {
// Display project lists
let ProjectsList = [];
if (projects.length > 0) {
ProjectsList = projects.map((project, index) => (
<tr data-testid={`project-row-${project._id}`} key={project._id}>
<th scope="row" className={darkMode ? 'text-light' : ''}>
<div>{index + 1}</div>
</th>
<td>
<Link to={`/projectreport/${project._id}`} className={darkMode ? 'text-light' : ''}>{project.projectName}</Link>
</td>
<td>
{project.isActive ? (
<div className="isActive">
<i className="fa fa-circle" data-testid="status-icon" aria-hidden="true" />
</div>
) : (
<div className="isNotActive">
<i className="fa fa-circle-o" data-testid="status-icon" aria-hidden="true" />
</div>
)}
</td>
</tr>
));
}
const [currentPage, setCurrentPage] = useState(1);
const itemsPerPage = 10;

const totalPages = Math.ceil(projects?.length / itemsPerPage);

const paginatedProjects = projects?.slice(
(currentPage - 1) * itemsPerPage,
currentPage * itemsPerPage,
);

const ProjectsList = paginatedProjects.map((project, index) => (
<tr data-testid={`project-row-${project._id}`} key={project._id}>
<th scope="row" className={darkMode ? 'text-light' : ''}>
<div>{(currentPage - 1) * itemsPerPage + index + 1}</div>
</th>
<td>
<Link to={`/projectreport/${project._id}`} className={darkMode ? 'text-light' : ''}>
{project.projectName}
</Link>
</td>
<td>
{project.isActive ? (
<div className="isActive">
<i className="fa fa-circle" data-testid="status-icon" aria-hidden="true" />
</div>
) : (
<div className="isNotActive">
<i className="fa fa-circle-o" data-testid="status-icon" aria-hidden="true" />
</div>
)}
</td>
</tr>
));

return (
<table className={`table ${darkMode ? 'bg-yinmn-blue' : 'table-bordered'}`} style={darkMode ? boxStyleDark : boxStyle}>
<thead>
<tr className={darkMode ? 'bg-space-cadet text-light' : ''}>
<th scope="col" id="projects__order">
#
</th>
<th scope="col">Project Name</th>
<th scope="col" id="projects__active">
Active
</th>
</tr>
</thead>
<tbody className={darkMode ? 'dark-mode' : ''}>{ProjectsList}</tbody>
</table>
<>
<table
className={`table ${darkMode ? 'bg-yinmn-blue' : 'table-bordered'}`}
style={darkMode ? boxStyleDark : boxStyle}
>
<thead>
<tr className={darkMode ? 'bg-space-cadet text-light' : ''}>
<th scope="col" id="projects__order">#</th>
<th scope="col">Project Name</th>
<th scope="col" id="projects__active">Active</th>
</tr>
</thead>
<tbody className={darkMode ? 'dark-mode' : ''}>{ProjectsList}</tbody>
</table>

{totalPages > 1 && (
<div className="d-flex justify-content-center align-items-center mt-3 gap-2">
<Button
size="sm"
disabled={currentPage === 1}
onClick={() => setCurrentPage(prev => prev - 1)}
>
Previous
</Button>

<span className={darkMode ? 'text-light' : ''}>
Page {currentPage} of {totalPages}
</span>

<Button
size="sm"
disabled={currentPage === totalPages}
onClick={() => setCurrentPage(prev => prev + 1)}
>
Next
</Button>
</div>
)}
</>
);
}
export default ProjectTable;

ProjectTable.propTypes = {
projects: PropTypes.arrayOf(
PropTypes.shape({
_id: PropTypes.string.isRequired,
projectName: PropTypes.string.isRequired,
isActive: PropTypes.bool.isRequired,
}),
),
darkMode: PropTypes.bool,
};

ProjectTable.defaultProps = {
projects: [],
darkMode: false,
};

export default ProjectTable;
76 changes: 65 additions & 11 deletions src/components/Reports/Reports.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import TotalPeopleReport from './TotalReport/TotalPeopleReport';
import TotalProjectReport from './TotalReport/TotalProjectReport';
import TotalTeamReport from './TotalReport/TotalTeamReport';
import ViewReportByDate from './ViewReportsByDate/ViewReportsByDate';
import VolunteerHoursReport from './VolunteerHoursReport';

const DATE_PICKER_MIN_DATE = '01/01/2010';

Expand All @@ -51,6 +52,7 @@ class ReportsPage extends Component {
showAddTeamHistory: false,
showAddProjHistory: false,
showContributorsReport: false,
showVolunteerHoursReport: false,
teamNameSearchText: '',
wildCardSearchText: '',
selectedTeamId: 0,
Expand Down Expand Up @@ -109,6 +111,7 @@ class ReportsPage extends Component {
this.onDateChange = this.onDateChange.bind(this);
this.handleClearFilters = this.handleClearFilters.bind(this);
this.showContributorsReport = this.showContributorsReport.bind(this);
this.showVolunteerHoursReport = this.showVolunteerHoursReport.bind(this);
this.handleSearchClick = this.handleSearchClick.bind(this);
}

Expand Down Expand Up @@ -229,7 +232,6 @@ endDate: moment()
}
return false;
});

return filteredList;
};

Expand Down Expand Up @@ -296,7 +298,8 @@ endDate: moment()
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showProjects,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -313,7 +316,8 @@ endDate: moment()
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showTeams,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -330,7 +334,8 @@ endDate: moment()
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showPeople,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -347,7 +352,8 @@ endDate: moment()
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showTotalPeople,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -364,7 +370,8 @@ endDate: moment()
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showTotalTeam,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand Down Expand Up @@ -417,7 +424,8 @@ endDate: moment()
showAddProjHistory: !prevState.showAddProjHistory,
showAddPersonHistory: false,
showAddTeamHistory: false,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -433,7 +441,8 @@ endDate: moment()
showAddProjHistory: false,
showAddPersonHistory: !prevState.showAddPersonHistory,
showAddTeamHistory: false,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -449,7 +458,8 @@ endDate: moment()
showAddProjHistory: false,
showAddPersonHistory: false,
showAddTeamHistory: !prevState.showAddTeamHistory,
showContributorsReport: false
showContributorsReport: false,
showVolunteerHoursReport: false
}));
}

Expand All @@ -466,7 +476,26 @@ endDate: moment()
showAddProjHistory: false,
showAddPersonHistory: false,
showAddTeamHistory: false,
showCharts: !prevState.showContributorsReport
showCharts: !prevState.showContributorsReport,
showVolunteerHoursReport: false
}));
}

showVolunteerHoursReport() {
this.setState(prevState => ({
showVolunteerHoursReport: !prevState.showVolunteerHoursReport,
showProjects: false,
showPeople: false,
showTeams: false,
showTotalProject: false,
showTotalPeople: false,
showTotalTeam: false,
showAddTimeForm: false,
showAddProjHistory: false,
showAddPersonHistory: false,
showAddTeamHistory: false,
showContributorsReport: false,
showCharts: !prevState.showVolunteerHoursReport
}));
}

Expand Down Expand Up @@ -712,6 +741,28 @@ endDate: moment()
/>
</div>
</div>
<div className={styles['total-report-item']}>
<Button
type="button"
color="success"
onClick={this.showVolunteerHoursReport}
>
{this.state.showVolunteerHoursReport
? 'Hide Volunteer Hours Report'
: 'Show Volunteer Hours Report'}
</Button>
<div style={{ display: 'inline-block', marginLeft: 10 }}>
<EditableInfoModal
areaName="volunteerHoursReportInfoPoint"
areaTitle="Volunteer Hours Report"
role={myRole}
fontSize={15}
isPermissionPage
darkMode={darkMode}
defaultText="Track total volunteer hours for nonprofit reporting. View hours by person, team, or project with customizable date ranges."
/>
</div>
</div>
</div>
{myRole !== 'Owner' && (
<div className={styles['lost-time-container']}>
Expand Down Expand Up @@ -895,7 +946,10 @@ endDate: moment()
darkMode={darkMode}
userRole={userRole}
/>
)}
)}
{this.state.showVolunteerHoursReport && (
<VolunteerHoursReport />
)}
{this.state.showAddTimeForm && myRole === 'Owner' && (
<AddLostTime
isOpen={this.state.showAddTimeForm}
Expand Down
Loading
Loading