Skip to content

Commit 53e605b

Browse files
Merge pull request #2205 from OneCommunityGlobal/Diya_Fix_TimeLoggedStars
Diya fix(weeklyReport): Fixed Stars Visible on Hours Logged
2 parents 91d82ff + 99db09d commit 53e605b

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/helpers/reporthelper.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ const reporthelper = function () {
175175
results.forEach((result) => {
176176
// create Array(4) to hold totalSeconds for each week
177177
result.totalSeconds = [0, 0, 0, 0];
178+
result.totalTangibleSeconds = [0, 0, 0, 0];
178179

179180
if (!result.timeEntries || result.timeEntries.length === 0) return;
180181
const isSingleWeekRequest = startWeekIndex === endWeekIndex;
@@ -192,12 +193,20 @@ const reporthelper = function () {
192193
if (index >= 0 && index < 4) {
193194
result.totalSeconds[index] =
194195
(result.totalSeconds[index] || 0) + (entry.totalSeconds || 0);
196+
if (entry.isTangible) {
197+
result.totalTangibleSeconds[index] =
198+
(result.totalTangibleSeconds[index] || 0) + (entry.totalSeconds || 0);
199+
}
195200
}
196201
});
197202

198203
result.totalSeconds = result.totalSeconds.map((seconds) =>
199204
seconds === 0 ? undefined : seconds,
200205
);
206+
result.totalTangibleSeconds = result.totalTangibleSeconds.map((seconds) =>
207+
seconds === 0 ? undefined : seconds,
208+
);
209+
201210
if (result.endDate) {
202211
result.finalWeekIndex = absoluteDifferenceInWeeks(result.endDate, pstEnd);
203212
} else {

0 commit comments

Comments
 (0)