Skip to content

Commit

Permalink
added report icon and completed tasknumbers in taskmemebers dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramaruva committed Jan 17, 2025
1 parent a14cdc5 commit ed8b1c1
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
Binary file added public/report_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 30 additions & 1 deletion src/components/TeamMemberTasks/TeamMemberTask.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ const TeamMemberTask = React.memo(
showWhoHasTimeOff && (onTimeOff || goingOnTimeOff),
);

const completedTasks = user.tasks.filter(
task =>
task.resources?.some(
resource => resource.userID === user.personId && resource.completedTask,
),
);
console.log(completedTasks,"completedtasks");
const thisWeekHours = user.totaltangibletime_hrs;

// these need to be changed to actual permissions...
Expand All @@ -87,6 +94,7 @@ const TeamMemberTask = React.memo(
// ^^^

const canGetWeeklySummaries = dispatch(hasPermission('getWeeklySummaries'));
const canSeeReports = rolesAllowedToResolveTasks.includes(userRole)||dispatch(hasPermission('getReports'));
const canUpdateTask = dispatch(hasPermission('updateTask'));
const canRemoveUserFromTask = dispatch(hasPermission('removeUserFromTask'));
const numTasksToShow = isTruncated ? NUM_TASKS_SHOW_TRUNCATE : activeTasks.length;
Expand Down Expand Up @@ -226,7 +234,28 @@ const TeamMemberTask = React.memo(
)}

{canGetWeeklySummaries && <GoogleDocIcon link={userGoogleDocLink} />}


{
canSeeReports &&
<Link
className='team-member-tasks-user-report-link'
to= {`/peoplereport/${user?.personId}`}
>
<img
src ="/report_icon.png"
alt='reportsicon'
className='team-member-tasks-user-report-link-image'
/>
</Link>
}
{
canSeeReports &&
<Link
to= {`/peoplereport/${user?.personId}`}
>
<span class="team-member-tasks-number">{completedTasks.length}</span>.
</Link>
}
<Warning
username={user.name}
userName={user}
Expand Down
17 changes: 17 additions & 0 deletions src/components/TeamMemberTasks/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
width: 50%;
}

.team-member-tasks-user-report-link .team-member-tasks-user-report-link-image{
width: 20px;
height: 20px;
margin: 0 0 5px 5px;
}
.deadlineCount {
position: absolute;
text-align: center;
Expand All @@ -105,6 +110,18 @@
justify-content: space-around;
}

.team-member-tasks-number{
display: inline-block;
text-align: center;
vertical-align: middle;
background: #ff4d4f;
border-radius: 50%;
color: #fff;
height: 22px;
font-size: 14px;
width: 22px;
margin: 0 0 5px 5px;
}
.dashboard-team-clocks{
color: #339CFF !important;
}
Expand Down

0 comments on commit ed8b1c1

Please sign in to comment.