Skip to content

Commit

Permalink
Merge pull request #927 from OneCommunityGlobal/Anirudh_endDatedisplay
Browse files Browse the repository at this point in the history
Anirudh - Fetch end date field from dashboardhelper
  • Loading branch information
one-community authored Jun 17, 2024
2 parents 0e0b44f + 39ec17f commit f9417ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions src/helpers/dashboardhelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ const dashboardhelper = function () {
name: 1,
weeklycommittedHours: 1,
role: 1,
endDate: 1,
timeEntryData: {
$filter: {
input: '$timeEntryData',
Expand Down Expand Up @@ -84,6 +85,7 @@ const dashboardhelper = function () {
$project: {
personId: 1,
weeklycommittedHours: 1,
endDate: 1,
totalSeconds: {
$cond: [
{
Expand Down Expand Up @@ -190,7 +192,9 @@ const dashboardhelper = function () {
weeklySummaries: 1,
timeOffFrom: 1,
timeOffTill: 1,
},
endDate: 1,
}

);
} else {
// 'Core Team', 'Owner' //All users
Expand All @@ -205,6 +209,8 @@ const dashboardhelper = function () {
weeklySummaries: 1,
timeOffFrom: 1,
timeOffTill: 1,
endDate: 1,

},
);
}
Expand Down Expand Up @@ -254,10 +260,11 @@ const dashboardhelper = function () {
: false,
weeklycommittedHours: teamMember.weeklycommittedHours,
totaltangibletime_hrs:
(timeEntryByPerson[teamMember._id.toString()]?.tangibleSeconds || 0) / 3600,
(timeEntryByPerson[teamMember._id.toString()]?.tangibleSeconds ?? 0) / 3600,
totalintangibletime_hrs:
(timeEntryByPerson[teamMember._id.toString()]?.intangibleSeconds || 0) / 3600,
totaltime_hrs: (timeEntryByPerson[teamMember._id.toString()]?.totalSeconds || 0) / 3600,
(timeEntryByPerson[teamMember._id.toString()]?.intangibleSeconds ?? 0) / 3600,
totaltime_hrs: (timeEntryByPerson[teamMember._id.toString()]?.totalSeconds ?? 0) / 3600,

percentagespentintangible:
timeEntryByPerson[teamMember._id.toString()] &&
timeEntryByPerson[teamMember._id.toString()]?.totalSeconds !== 0 &&
Expand All @@ -268,6 +275,7 @@ const dashboardhelper = function () {
: 0,
timeOffFrom: teamMember.timeOffFrom || null,
timeOffTill: teamMember.timeOffTill || null,
endDate: teamMember.endDate || null,
};
leaderBoardData.push(obj);
});
Expand Down Expand Up @@ -592,6 +600,7 @@ const dashboardhelper = function () {
percentagespentintangible: (intangibleSeconds / tangibleSeconds) * 100,
timeOffFrom: user.timeOffFrom,
timeOffTill: user.timeOffTill,
endDate: user.endDate || null,
},
];
} catch (err) {
Expand Down

0 comments on commit f9417ca

Please sign in to comment.