Skip to content

Commit

Permalink
Merge pull request #2774 from objectcomputing/develop
Browse files Browse the repository at this point in the history
Update release v0.8.x from develop
  • Loading branch information
mkimberlin authored Nov 14, 2024
2 parents cb941b1 + 19e16b7 commit 8bca818
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id "jacoco"
}

version "0.8.9"
version "0.8.10"
group "com.objectcomputing.checkins"

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -222,28 +217,27 @@ public ReportHours getReportHours() {
private List<Feedback> getFeedbackType(FeedbackType type) {
List<Feedback> feedback = new ArrayList<Feedback>();

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<FeedbackRequest> requests =
feedbackRequestServices.findByValues(null, memberId, null,
null, null, null, null);

reviewPeriod.getPeriodStartDate().toLocalDate(), null, null, null);
List<FeedbackRequest> filtered = new LinkedList<>();
// Iterate over each request and find the template. Determine the purpose
// of the template.
ReviewPeriod reviewPeriod = reviewPeriodServices.findById(reviewPeriodId);
Map<UUID, String> templates = new HashMap<UUID, String>();
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());
Expand All @@ -260,13 +254,14 @@ private List<Feedback> 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());
Expand All @@ -280,7 +275,7 @@ private List<Feedback> getFeedbackType(FeedbackType type) {
String templateTitle = templates.get(templateId);
List<Feedback.Answer> feedbackAnswers =
new ArrayList<Feedback.Answer>();
for (FeedbackRequest request: requests) {
for (FeedbackRequest request: filtered) {
if (request.getTemplateId().equals(templateId)) {
UUID recipientId = request.getRecipientId();
MemberProfile recipient = memberProfileServices.getById(
Expand Down
2 changes: 1 addition & 1 deletion web-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "web-ui",
"version": "0.8.9",
"version": "0.8.10",
"private": true,
"type": "module",
"dependencies": {
Expand Down

0 comments on commit 8bca818

Please sign in to comment.