Skip to content

Commit cf9b8d6

Browse files
chore: merged development
2 parents 6711e0f + 8bdd4dd commit cf9b8d6

24 files changed

Lines changed: 904 additions & 643 deletions

src/components/LeaderBoard/Leaderboard.jsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,22 @@ function LeaderBoard({
176176

177177
useEffect(() => {
178178
const checkAbbreviatedView = () => {
179-
const isAbbrev = window.innerWidth < window.screen.width * 0.75;
179+
const isAbbrev = window.innerWidth < 1500;
180180
setIsAbbreviatedView(isAbbrev);
181181
};
182182

183-
checkAbbreviatedView(); // run on mount
184-
window.addEventListener('resize', checkAbbreviatedView);
183+
let timer;
184+
const debouncedCheck = () => {
185+
clearTimeout(timer);
186+
timer = setTimeout(checkAbbreviatedView, 200); // increase to 200ms
187+
};
185188

186-
return () => window.removeEventListener('resize', checkAbbreviatedView);
189+
checkAbbreviatedView();
190+
window.addEventListener('resize', debouncedCheck);
191+
return () => {
192+
window.removeEventListener('resize', debouncedCheck);
193+
clearTimeout(timer);
194+
};
187195
}, []);
188196

189197
const updateOrganizationData = (usersTaks, contUsers) => {
@@ -691,7 +699,7 @@ function LeaderBoard({
691699
className={`leaderboard table-fixed ${
692700
darkMode ? 'text-light dark-mode bg-yinmn-blue' : ''
693701
} ${isAbbreviatedView ? 'abbreviated-mode' : ''}`}
694-
style={{ minWidth: '500px' }}
702+
style={{ width: '100%', tableLayout: isAbbreviatedView ? 'fixed' : 'auto' }}
695703
>
696704
<thead className="responsive-font-size">
697705
<tr className={darkMode ? 'bg-space-cadet' : ''} style={darkModeStyle}>
@@ -701,12 +709,18 @@ function LeaderBoard({
701709
<th style={darkModeStyle}>
702710
<div className="d-flex align-items-center">
703711
<span className="mr-2">{isAbbreviatedView ? 'Name' : 'Name'}</span>
704-
<span style={{ position: 'relative', top: '2px' }}>
712+
<span
713+
style={{
714+
position: 'relative',
715+
top: isAbbreviatedView ? '-13px' : '2px',
716+
left: isAbbreviatedView ? '10px' : '0px',
717+
}}
718+
>
705719
<EditableInfoModal
706720
areaName="Leaderboard"
707721
areaTitle="Team Members Navigation"
708722
role={loggedInUser.role}
709-
fontSize={18}
723+
fontSize={isAbbreviatedView ? 13 : 18}
710724
isPermissionPage
711725
darkMode={darkMode}
712726
className="p-2"
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
.leaderboard {
22
font-size: 1rem;
3-
} /*1rem = 16px*/
3+
}
44

55
.my-custom-scrollbar {
66
overflow-y: auto;
77
margin-bottom: 1rem;
88
}
99

10-
.leaderboard thead th {
11-
top: 0;
12-
border-top: 10px solid #dee2e6;
13-
border-top-width: 1px;
14-
border-top-style: solid;
15-
border-top-color: rgb(222, 226, 230);
16-
}
17-
18-
.leaderboard tbody tr td,
19-
.leaderboard thead tr th {
20-
text-align: left !important;
21-
}
22-
2310
.dark-leaderboard-row {
2411
background-color: #3a506b;
2512
color: white;
@@ -29,6 +16,7 @@
2916
background-color: #3a506b;
3017
color: white;
3118
}
19+
3220
.dark-leaderboard-row:hover {
3321
background-color: #111831;
3422
}
@@ -38,6 +26,7 @@
3826
color: black;
3927
display: table-row;
4028
}
29+
4130
.light-leaderboard-row th {
4231
background-color: white;
4332
color: black;
@@ -47,52 +36,63 @@
4736
background-color: #f0f8ff;
4837
}
4938

39+
.table-fixed tbody td {
40+
white-space: normal; /* Allow text wrapping within cells */
41+
}
42+
43+
.table-fixed {
44+
font-size: 0.93rem;
45+
overflow-wrap: break-word;
46+
}
47+
48+
.leaderboard thead th {
49+
top: 0;
50+
border-top: 1px solid rgb(222 226 230);
51+
}
52+
53+
.leaderboard tbody tr td,
54+
.leaderboard thead tr th {
55+
text-align: left !important;
56+
}
57+
5058

5159
/* Small devices (landscape phones, 544px and up) */
52-
@media (max-width: 544px) {
60+
@media (545px <= width <= 1119px) {
5361
.leaderboard {
5462
font-size: 0.7rem;
55-
} /*1rem = 16px*/
63+
}
5664

5765
.my-custom-scrollbar {
5866
max-height: 500px;
59-
overflow: scroll;
67+
overflow: auto;
6068
margin-bottom: 1rem;
6169
}
6270

6371
.leaderboard thead th {
72+
white-space: nowrap;
6473
top: 0;
65-
border-top: 10px solid #dee2e6;
66-
border-top-width: 1px;
67-
border-top-style: solid;
68-
border-top-color: rgb(222, 226, 230);
74+
border-top: 1px solid rgb(222 226 230);
6975
}
7076
}
77+
7178
.row {
7279
width: 97%;
7380
}
7481

75-
.table-fixed tbody td {
76-
white-space: normal; /* Allow text wrapping within cells */
77-
}
78-
79-
.table-fixed {
80-
font-size: 0.93rem;
81-
word-break: break-word;
82-
}
83-
84-
.animation {
85-
animation: l-animation 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
86-
}
8782
@keyframes l-animation {
8883
0% {
8984
transform: rotate(0deg);
9085
}
86+
9187
100% {
9288
transform: rotate(360deg);
9389
}
9490
}
9591

92+
.animation {
93+
animation: l-animation 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
94+
}
95+
9696
.leaderboardTotalsTitle {
9797
color: #339cff;
9898
font-weight: bold;
@@ -103,13 +103,12 @@
103103
flex-direction: column;
104104
}
105105

106-
@media screen and (max-width: 544px) {
106+
@media (width <= 980px) {
107107
.responsive-font-size {
108-
font-size: 0.75rem !important;
108+
font-size: 0.5rem !important;
109109
}
110110
}
111111

112-
113112
.leaderboard.abbreviated-mode thead th {
114113
font-size: 0.75rem;
115114
white-space: nowrap;
@@ -120,6 +119,7 @@
120119
padding: 0.5rem 0.3rem;
121120
vertical-align: middle;
122121
}
122+
123123
.trophyTextWhite {
124124
color: #fff;
125125
}

src/components/LeaderBoard/__tests__/Leaderboard.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe('Leaderboard page structure', () => {
139139

140140
it('displays correct Total Time label and value', () => {
141141
renderWithProvider(<Leaderboard {...props} />);
142-
const header = screen.getByText('Total Time');
142+
const header = screen.getByRole('columnheader', { name: /Tot(al|\.) Time/i });
143143
expect(header).toBeInTheDocument();
144144

145145
const timeValue = screen.getByTitle('Tangible + Intangible time = Total time');

src/components/Projects/WBS/SingleTask/SingleTask.jsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -94,64 +94,64 @@ function SingleTask(props) {
9494
<table className={`table table-bordered ${darkMode ? 'dark-mode text-light' : ''}`}>
9595
<thead className={darkMode ? 'bg-space-cadet' : ''}>
9696
<tr>
97-
<th scope="col" data-tip="Action" colSpan="1">
97+
<th scope="col" data-tip="Action" colSpan="1" style={{ textAlign: 'center' }}>
9898
Action
9999
</th>
100-
<th scope="col" data-tip="task-num" colSpan="1">
100+
<th scope="col" data-tip="task-num" colSpan="1" style={{ textAlign: 'center' }}>
101101
#
102102
</th>
103-
<th scope="col" data-tip="Task Name" style={{ minWidth: '200px' }}>
103+
<th scope="col" data-tip="Task Name" style={{ minWidth: '200px' }} >
104104
Task Name
105105
</th>
106-
<th scope="col" data-tip="Priority">
106+
<th scope="col" data-tip="Priority" style={{ textAlign: 'center' }}>
107107
<i className="fa fa-star" aria-hidden="true" />
108108
</th>
109-
<th scope="col" data-tip="Resources">
109+
<th scope="col" data-tip="Resources" style={{ textAlign: 'center' }}>
110110
<i className="fa fa-users" aria-hidden="true" />
111111
</th>
112-
<th scope="col" data-tip="Assigned">
112+
<th scope="col" data-tip="Assigned" style={{ textAlign: 'center' }}>
113113
<i className="fa fa-user-circle-o" aria-hidden="true" />
114114
</th>
115-
<th scope="col" data-tip="Status">
115+
<th scope="col" data-tip="Status" style={{ textAlign: 'center' }}>
116116
<i className="fa fa-tasks" aria-hidden="true" />
117117
</th>
118-
<th scope="col" data-tip="Hours-Best">
118+
<th scope="col" data-tip="Hours-Best" style={{ textAlign: 'center' }}>
119119
<i className="fa fa-hourglass-start" aria-hidden="true" />
120120
</th>
121-
<th scope="col" data-tip="Hours-Worst">
121+
<th scope="col" data-tip="Hours-Worst" style={{ textAlign: 'center' }}>
122122
<i className="fa fa-hourglass" aria-hidden="true" />
123123
</th>
124-
<th scope="col" data-tip="Hours-Most">
124+
<th scope="col" data-tip="Hours-Most" style={{ textAlign: 'center' }}>
125125
<i className="fa fa-hourglass-half" aria-hidden="true" />
126126
</th>
127-
<th scope="col" data-tip="Estimated Hours">
127+
<th scope="col" data-tip="Estimated Hours" style={{ textAlign: 'center' }}>
128128
<i className="fa fa-clock-o" aria-hidden="true" />
129129
</th>
130-
<th scope="col" data-tip="Hours-Logged">
130+
<th scope="col" data-tip="Hours-Logged" style={{ textAlign: 'center' }}>
131131
<i className="fa fa-hourglass-end" aria-hidden="true" />
132132
</th>
133-
<th scope="col" data-tip="Start Date">
133+
<th scope="col" data-tip="Start Date" style={{ textAlign: 'center' }}>
134134
<i className="fa fa-calendar-check-o" aria-hidden="true" />
135135
{' '}
136136
Start
137137
</th>
138-
<th scope="col" data-tip="Due Date">
138+
<th scope="col" data-tip="Due Date" style={{ textAlign: 'center' }}>
139139
<i className="fa fa-calendar-times-o" aria-hidden="true" />
140140
{' '}
141141
End
142142
</th>
143-
<th scope="col" data-tip="Links">
143+
<th scope="col" data-tip="Links" style={{ textAlign: 'center' }}>
144144
<i className="fa fa-link" aria-hidden="true" />
145145
</th>
146-
<th scope="col" data-tip="Details">
146+
<th scope="col" data-tip="Details" style={{ textAlign: 'center' }}>
147147
<i className="fa fa-question" aria-hidden="true" />
148148
</th>
149149
</tr>
150150
</thead>
151151
<tbody className={darkMode ? 'bg-yinmn-blue' : ''}>
152152
<tr>
153153
<th scope="row">
154-
<div className="d-flex flex-column align-items-start">
154+
<div className="d-flex flex-column align-items-center">
155155
<EditTaskModal
156156
key={`editTask_${task._id}`}
157157
parentNum={task.num}
@@ -188,7 +188,7 @@ function SingleTask(props) {
188188
)}
189189
</div>
190190
</th>
191-
<th scope="row">{task.num}</th>
191+
<th scope="row" style={{ textAlign: 'center', verticalAlign: 'middle' }}>{task.num}</th>
192192
<td>{task.taskName}</td>
193193
<td>{task.priority}</td>
194194
<td>

src/components/Reports/PeopleReport/selectors.jsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,36 @@ export const peopleTasksPieChartViewData = (state) => {
3939
const completedUserEntries = allUserEntries.filter(e => e.isActive === true);
4040

4141
const projectHours = {};
42+
const projectNames = {};
43+
4244
allUserEntries.forEach(entry => {
43-
const { projectId } = entry;
44-
if (!projectId) return;
45+
const { projectId, taskId, projectName } = entry;
46+
if (!projectId || taskId) return;
4547
const time = (entry.hours || 0) + (entry.minutes || 0) / 60;
4648
projectHours[projectId] = (projectHours[projectId] || 0) + time;
49+
if (projectName) projectNames[projectId] = projectName;
50+
});
51+
52+
const hoursLoggedToProjectsOnly = Object.entries(projectHours).map(([projectId, totalTime]) => {
53+
const project = (userProjects?.projects || []).find(p => p.projectId === projectId);
54+
return {
55+
projectId,
56+
projectName: project?.projectName || projectNames[projectId] || `Unknown (${projectId.slice(-6)})`,
57+
totalTime,
58+
};
4759
});
4860

49-
const hoursLoggedToProjectsOnly = (userProjects?.projects || []).map(project => ({
50-
projectId: project.projectId,
51-
projectName: project.projectName,
52-
totalTime: projectHours[project.projectId] || 0,
53-
}));
61+
const userTasks = state.userTask?.tasks || [];
5462

5563
const taskHours = {};
56-
completedUserEntries.forEach(entry => {
64+
allUserEntries.forEach(entry => {
5765
if (entry.taskId == null) return;
5866
const taskKey = entry.taskId;
59-
const taskName = entry.taskName || 'Unnamed Task';
67+
const taskName = entry.taskName || `Task in "${entry.projectName || 'Unknown Project'}"`;
6068
const time = (entry.hours || 0) + (entry.minutes || 0) / 60;
6169

6270
if (!taskHours[taskKey]) {
63-
taskHours[taskKey] = {
64-
totalTime: 0,
65-
projectId: entry.projectId,
66-
taskName,
67-
};
71+
taskHours[taskKey] = { totalTime: 0, projectId: entry.projectId, taskName };
6872
}
6973
taskHours[taskKey].totalTime += time;
7074
});

src/components/TeamMemberTasks/ReviewButton.jsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,6 @@ function ReviewButton({ user, task, updateTask }) {
451451
const buttonFormat = () => {
452452
if (user.personId === myUserId && reviewStatus === 'Unsubmitted') {
453453
return (
454-
// <Button
455-
// className={style['reviewBtn']}
456-
// color="primary"
457-
// onClick={toggleModal}
458-
// style={darkMode ? boxStyleDark : boxStyle}
459-
// disabled={isSubmitting}
460-
// >
461-
// Submit for Review
462-
// </Button>
463454
<button
464455
className={`${style.reviewBtn} btn btn-primary`}
465456
onClick={toggleModal}

0 commit comments

Comments
 (0)