Skip to content

Commit

Permalink
refactor: Upgrade to model-2.0.62 - letter-sound peer reviews
Browse files Browse the repository at this point in the history
ref #1627
  • Loading branch information
jo-elimu committed Nov 1, 2023
1 parent 63f0cf9 commit 8828450
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String handleSubmit(
);
}

// Update the letterSoundCorrespondence's peer review status
// Update the peer review status
int approvedCount = 0;
int notApprovedCount = 0;

Check warning on line 80 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L79-L80

Added lines #L79 - L80 were not covered by tests
for (LetterSoundCorrespondencePeerReviewEvent peerReviewEvent : letterSoundPeerReviewEventDao.readAll(letterSoundContributionEvent)) {
Expand All @@ -87,13 +87,13 @@ public String handleSubmit(
}
logger.info("approvedCount: " + approvedCount);
logger.info("notApprovedCount: " + notApprovedCount);
LetterSoundCorrespondence letterSoundCorrespondence = letterSoundContributionEvent.getLetterSoundCorrespondence();
LetterSoundCorrespondence letterSound = letterSoundContributionEvent.getLetterSoundCorrespondence();

Check warning on line 90 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L87-L90

Added lines #L87 - L90 were not covered by tests
if (approvedCount >= notApprovedCount) {
letterSoundCorrespondence.setPeerReviewStatus(PeerReviewStatus.APPROVED);
letterSound.setPeerReviewStatus(PeerReviewStatus.APPROVED);

Check warning on line 92 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L92

Added line #L92 was not covered by tests
} else {
letterSoundCorrespondence.setPeerReviewStatus(PeerReviewStatus.NOT_APPROVED);
letterSound.setPeerReviewStatus(PeerReviewStatus.NOT_APPROVED);

Check warning on line 94 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L94

Added line #L94 was not covered by tests
}
letterSoundDao.update(letterSoundCorrespondence);
letterSoundDao.update(letterSound);

Check warning on line 96 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L96

Added line #L96 was not covered by tests

return "redirect:/content/letter-sound/edit/" + letterSoundContributionEvent.getLetterSoundCorrespondence().getId() + "#contribution-events";

Check warning on line 98 in src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/ai/elimu/web/content/peer_review/LetterSoundPeerReviewEventCreateController.java#L98

Added line #L98 was not covered by tests
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<content:title>
<fmt:message key="pending.review" /> (${fn:length(letterSoundCorrespondenceContributionEventsPendingPeerReview)})
<fmt:message key="pending.review" /> (${fn:length(letterSoundContributionEventsPendingPeerReview)})
</content:title>

<content:section cssId="letterSoundCorrespondencePeerReviewsPendingPage">
<content:section cssId="letterSoundPeerReviewsPendingPage">
<div class="section row">
<c:if test="${empty letterSoundCorrespondenceContributionEventsPendingPeerReview}">
<c:if test="${empty letterSoundContributionEventsPendingPeerReview}">
<p>
You have no pending peer-reviews 🎉
</p>
</c:if>
<c:if test="${not empty letterSoundCorrespondenceContributionEventsPendingPeerReview}">
<c:if test="${not empty letterSoundContributionEventsPendingPeerReview}">
<p>
Press "Peer-review" to peer-review a letter-sound correspondence:
</p>
Expand All @@ -24,51 +24,51 @@
<th><fmt:message key="peer.review" /></th>
</thead>
<tbody>
<c:forEach var="letterSoundCorrespondenceContributionEvent" items="${letterSoundCorrespondenceContributionEventsPendingPeerReview}">
<c:set var="letterSoundCorrespondence" value="${letterSoundCorrespondenceContributionEvent.letterSoundCorrespondence}" />
<c:forEach var="letterSoundContributionEvent" items="${letterSoundContributionEventsPendingPeerReview}">
<c:set var="letterSound" value="${letterSoundContributionEvent.letterSound}" />
<tr>
<td style="font-size: 2em;">
" <c:forEach var="letter" items="${letterSoundCorrespondence.letters}"><a href="<spring:url value='/content/letter/edit/${letter.id}' />">${letter.text} </a> </c:forEach> "
" <c:forEach var="letter" items="${letterSound.letters}"><a href="<spring:url value='/content/letter/edit/${letter.id}' />">${letter.text} </a> </c:forEach> "
</td>
<td style="font-size: 2em;">
</td>
<td style="font-size: 2em;">
/ <c:forEach var="sound" items="${letterSoundCorrespondence.sounds}"><a href="<spring:url value='/content/sound/edit/${sound.id}' />">${sound.valueIpa}</a> </c:forEach> /
/ <c:forEach var="sound" items="${letterSound.sounds}"><a href="<spring:url value='/content/sound/edit/${sound.id}' />">${sound.valueIpa}</a> </c:forEach> /
</td>
<td>
<a href="<spring:url value='/content/contributor/${letterSoundCorrespondenceContributionEvent.contributor.id}' />">
<a href="<spring:url value='/content/contributor/${letterSoundContributionEvent.contributor.id}' />">
<div class="chip">
<c:choose>
<c:when test="${not empty letterSoundCorrespondenceContributionEvent.contributor.imageUrl}">
<img src="${letterSoundCorrespondenceContributionEvent.contributor.imageUrl}" />
<c:when test="${not empty letterSoundContributionEvent.contributor.imageUrl}">
<img src="${letterSoundContributionEvent.contributor.imageUrl}" />
</c:when>
<c:when test="${not empty letterSoundCorrespondenceContributionEvent.contributor.providerIdWeb3}">
<img src="http://62.75.236.14:3000/identicon/<c:out value="${letterSoundCorrespondenceContributionEvent.contributor.providerIdWeb3}" />" />
<c:when test="${not empty letterSoundContributionEvent.contributor.providerIdWeb3}">
<img src="http://62.75.236.14:3000/identicon/<c:out value="${letterSoundContributionEvent.contributor.providerIdWeb3}" />" />
</c:when>
<c:otherwise>
<img src="<spring:url value='/static/img/placeholder.png' />" />
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${not empty letterSoundCorrespondenceContributionEvent.contributor.firstName}">
<c:out value="${letterSoundCorrespondenceContributionEvent.contributor.firstName}" />&nbsp;<c:out value="${letterSoundCorrespondenceContributionEvent.contributor.lastName}" />
<c:when test="${not empty letterSoundContributionEvent.contributor.firstName}">
<c:out value="${letterSoundContributionEvent.contributor.firstName}" />&nbsp;<c:out value="${letterSoundContributionEvent.contributor.lastName}" />
</c:when>
<c:when test="${not empty letterSoundCorrespondenceContributionEvent.contributor.providerIdWeb3}">
${fn:substring(letterSoundCorrespondenceContributionEvent.contributor.providerIdWeb3, 0, 6)}...${fn:substring(letterSoundCorrespondenceContributionEvent.contributor.providerIdWeb3, 38, 42)}
<c:when test="${not empty letterSoundContributionEvent.contributor.providerIdWeb3}">
${fn:substring(letterSoundContributionEvent.contributor.providerIdWeb3, 0, 6)}...${fn:substring(letterSoundContributionEvent.contributor.providerIdWeb3, 38, 42)}
</c:when>
</c:choose>
</div>
</a>
</td>
<td>
#${letterSoundCorrespondenceContributionEvent.revisionNumber} (<fmt:formatNumber maxFractionDigits="0" value="${letterSoundCorrespondenceContributionEvent.timeSpentMs / 1000 / 60}" /> min)
#${letterSoundContributionEvent.revisionNumber} (<fmt:formatNumber maxFractionDigits="0" value="${letterSoundContributionEvent.timeSpentMs / 1000 / 60}" /> min)
</td>
<td>
<fmt:formatDate value="${letterSoundCorrespondenceContributionEvent.time.time}" pattern="yyyy-MM-dd HH:mm" />
<fmt:formatDate value="${letterSoundContributionEvent.time.time}" pattern="yyyy-MM-dd HH:mm" />
</td>
<td>
<a href="<spring:url value='/content/letter-sound/edit/${letterSoundCorrespondenceContributionEvent.letterSoundCorrespondence.id}#peer-review' />" target="_blank"><fmt:message key="peer.review" /></a>
<a href="<spring:url value='/content/letter-sound/edit/${letterSoundContributionEvent.letterSound.id}#peer-review' />" target="_blank"><fmt:message key="peer.review" /></a>
</td>
</tr>
</c:forEach>
Expand Down

0 comments on commit 8828450

Please sign in to comment.