From a671998bff8b852440a70d04be8214e714bc435d Mon Sep 17 00:00:00 2001 From: Michael Kimberlin Date: Thu, 14 Nov 2024 10:31:24 -0600 Subject: [PATCH 1/2] Took a slightly different approach to filtering feedback on the merit report --- .../services/reports/ReportDataCollation.java | 33 ++++++++----------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/server/src/main/java/com/objectcomputing/checkins/services/reports/ReportDataCollation.java b/server/src/main/java/com/objectcomputing/checkins/services/reports/ReportDataCollation.java index 73913bffa..3c000e3fc 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/reports/ReportDataCollation.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/reports/ReportDataCollation.java @@ -26,12 +26,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.UUID; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.Set; -import java.util.HashMap; +import java.util.*; import java.time.LocalDate; import java.time.Month; import java.nio.ByteBuffer; @@ -222,28 +217,27 @@ public ReportHours getReportHours() { private List getFeedbackType(FeedbackType type) { List feedback = new ArrayList(); + ReviewPeriod reviewPeriod = reviewPeriodServices.findById(reviewPeriodId); // Get the list of requests for the member and review period. // We will need to cross-reference the templates. LocalDateRange dateRange = getDateRange(); List requests = feedbackRequestServices.findByValues(null, memberId, null, - null, null, null, null); - + reviewPeriod.getPeriodStartDate().toLocalDate(), null, null, null); + List filtered = new LinkedList<>(); // Iterate over each request and find the template. Determine the purpose // of the template. - ReviewPeriod reviewPeriod = reviewPeriodServices.findById(reviewPeriodId); Map templates = new HashMap(); for (FeedbackRequest request: requests) { // Make sure we haven't already considered this template. // Also, require that the request either be directly associated with // our review period or that the request was submitted within the time // range of our review period. - if (!templates.containsKey(request.getTemplateId()) && - ((request.getReviewPeriodId() != null && + if ((request.getReviewPeriodId() != null && request.getReviewPeriodId().equals(reviewPeriod.getId())) || - (request.getSubmitDate() != null && - dateInRange(request.getSubmitDate(), dateRange.start, - dateRange.end)))) { + (request.getStatus().equalsIgnoreCase("submitted") && + request.getSendDate() != null && + request.getSendDate().isBefore(reviewPeriod.getCloseDate().toLocalDate()))) { try { FeedbackTemplate template = feedbackTemplateServices.getById(request.getTemplateId()); @@ -260,13 +254,14 @@ private List getFeedbackType(FeedbackType type) { reviewPeriod.getReviewTemplateId()); break; case FeedbackType.feedback: - use = !template.getIsReview() && request.getStatus().equalsIgnoreCase("submitted") && - request.getSendDate() != null && request.getSendDate().isAfter(reviewPeriod.getPeriodStartDate().toLocalDate()) && - request.getSendDate().isBefore(reviewPeriod.getCloseDate().toLocalDate()); + use = !template.getIsReview(); break; } if (use) { - templates.put(template.getId(), template.getTitle()); + filtered.add(request); + if(!templates.containsKey(template.getId())) { + templates.put(template.getId(), template.getTitle()); + } } } catch(NotFoundException ex) { LOG.error(ex.toString()); @@ -280,7 +275,7 @@ private List getFeedbackType(FeedbackType type) { String templateTitle = templates.get(templateId); List feedbackAnswers = new ArrayList(); - for (FeedbackRequest request: requests) { + for (FeedbackRequest request: filtered) { if (request.getTemplateId().equals(templateId)) { UUID recipientId = request.getRecipientId(); MemberProfile recipient = memberProfileServices.getById( From 19e16b76918e9d0fe30753d8ab951938b06fc2c1 Mon Sep 17 00:00:00 2001 From: Michael Kimberlin Date: Thu, 14 Nov 2024 12:07:45 -0600 Subject: [PATCH 2/2] Version bump --- server/build.gradle | 2 +- web-ui/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/build.gradle b/server/build.gradle index 54a3b0f28..8c70f18a6 100755 --- a/server/build.gradle +++ b/server/build.gradle @@ -7,7 +7,7 @@ plugins { id "jacoco" } -version "0.8.9" +version "0.8.10" group "com.objectcomputing.checkins" repositories { diff --git a/web-ui/package.json b/web-ui/package.json index 829635551..db08625fc 100644 --- a/web-ui/package.json +++ b/web-ui/package.json @@ -1,6 +1,6 @@ { "name": "web-ui", - "version": "0.8.9", + "version": "0.8.10", "private": true, "type": "module", "dependencies": {