diff --git a/public/report_icon.png b/public/report_icon.png new file mode 100644 index 0000000000..bc653730c0 Binary files /dev/null and b/public/report_icon.png differ diff --git a/src/components/TeamMemberTasks/TeamMemberTask.jsx b/src/components/TeamMemberTasks/TeamMemberTask.jsx index 5d770bd0d9..5dc051630a 100644 --- a/src/components/TeamMemberTasks/TeamMemberTask.jsx +++ b/src/components/TeamMemberTasks/TeamMemberTask.jsx @@ -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... @@ -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; @@ -226,7 +234,28 @@ const TeamMemberTask = React.memo( )} {canGetWeeklySummaries && } - + + { + canSeeReports && + + reportsicon + + } + { + canSeeReports && + + {completedTasks.length}. + + }