Skip to content

Commit

Permalink
Merge pull request #31 from EsupPortail/testing
Browse files Browse the repository at this point in the history
fix nexu sign image & null on send CC && null on show repeatable step & nbToSig, bouncycastel > 1.68 & jcifs-ng
  • Loading branch information
dlemaignent authored Apr 30, 2021
2 parents a79d10a + 2f7efd6 commit 0e0415a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 13 deletions.
10 changes: 7 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<name>esup-signature</name>
<properties>
<start-class>org.esupportail.esupsignature.EsupSignatureApplication</start-class>
<bouncycastle.version>1.66</bouncycastle.version>
<bouncycastle.version>1.68</bouncycastle.version>
<java.version>13</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.7.30</slf4j.version>
Expand All @@ -33,6 +33,10 @@
<name>Spring Maven Release Repository</name>
<url>https://maven.springframework.org/release</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>cefdigital</id>
<name>cefdigital</name>
Expand Down Expand Up @@ -621,9 +625,9 @@
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>eu.agno3.jcifs</groupId>
<groupId>com.github.AgNO3</groupId>
<artifactId>jcifs-ng</artifactId>
<version>2.1.5</version>
<version>3db3e62157</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public interface SignRequestRepository extends CrudRepository<SignRequest, Long>
Long countByToken(String token);
@Query("select s from SignRequest s join s.parentSignBook.liveWorkflow.currentStep.recipients r where s.status = 'pending' and r.user.eppn = :recipientUserEppn and r.signed is false")
List<SignRequest> findByRecipientUserToSign(@Param("recipientUserEppn") String recipientUserEppn);
@Query("select count(s.id) from SignRequest s join s.parentSignBook.liveWorkflow.currentStep.recipients r where s.status = 'pending' and r.user.eppn = :recipientUserEppn and r.signed is false")
@Query("select count(s.id) from SignRequest s where s.status = 'pending' and key(s.recipientHasSigned).user.eppn = :recipientUserEppn and key(s.recipientHasSigned).signed = false")
Long countByRecipientUserToSign(@Param("recipientUserEppn") String recipientUserEppn);
List<SignRequest> findByCreateByEppn(String createByEppn);
List<SignRequest> findByCreateByEppnAndStatus(String createByEppn, SignRequestStatus status);
Expand All @@ -38,4 +38,5 @@ public interface SignRequestRepository extends CrudRepository<SignRequest, Long>
SignRequest findSignRequestByCommentsContains(Comment comment);
List<SignRequest> findByTitle(String title);
List<SignRequest> findByParentSignBookTitle(String title);
List<SignRequest> findByStatus(SignRequestStatus status);
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ public void copySignRequestParams(SignRequest signRequest, List<SignRequestParam
signRequestParams.setExtraText(signRequestParamses.get(i).getExtraText());
liveWfSignRequestParams.add(signRequestParams);
} else {
liveWfSignRequestParams.get(i).setSignImageNumber(signRequestParamses.get(i).getSignImageNumber());
liveWfSignRequestParams.get(i).setSignPageNumber(signRequestParamses.get(i).getSignPageNumber());
liveWfSignRequestParams.get(i).setxPos(signRequestParamses.get(i).getxPos());
liveWfSignRequestParams.get(i).setyPos(signRequestParamses.get(i).getyPos());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ public SignRequest getById(long id) {
return signRequest;
}

public Long nbToSignSignRequests(String userEppn) {
return signRequestRepository.countByRecipientUserToSign(userEppn);
}

public List<SignRequest> getSignRequestsByToken(String token) {
return signRequestRepository.findByToken(token);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void sendCompletedCCMail(SignBook signBook) throws EsupSignatureMailExcep
mimeMessage.setSubject("Une demande signature que vous suivez est terminée");
mimeMessage.setFrom(mailConfig.getMailFrom());
List<User> viewersArray = new ArrayList<>(signBook.getViewers());
if(signBook.getLiveWorkflow().getWorkflow() != null && signBook.getLiveWorkflow().getWorkflow().getSendAlertToAllRecipients()) {
if(signBook.getLiveWorkflow().getWorkflow() != null && signBook.getLiveWorkflow().getWorkflow().getSendAlertToAllRecipients() != null && signBook.getLiveWorkflow().getWorkflow().getSendAlertToAllRecipients()) {
List<LiveWorkflowStep> liveWorkflowSteps = signBook.getLiveWorkflow().getLiveWorkflowSteps();
for (LiveWorkflowStep liveWorkflowStep : liveWorkflowSteps) {
List<Recipient> recipients = liveWorkflowStep.getRecipients();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void globalAttributes(@ModelAttribute("userEppn") String userEppn, @Model
}
model.addAttribute("nbDatas", dataService.getNbCreateByAndStatus(userEppn));
model.addAttribute("nbSignRequests", signRequestService.getNbByCreateAndStatus(userEppn));
model.addAttribute("nbToSign", signBookService.nbToSignSignBooks(userEppn));
model.addAttribute("nbToSign", signRequestService.nbToSignSignRequests(userEppn));
}

public void parseRoles(User user) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class SignUi {
}

initListeners() {
$("#checkValidateSignButtonNexu").on('click', e => this.launchSign(false));
$("#checkValidateSignButtonEnd").on('click', e => this.launchSign(false));
$("#checkValidateSignButtonNext").on('click', e => this.launchSign(true));
$("#launchInfiniteSignButton").on('click', e => this.insertStep());
Expand Down
11 changes: 4 additions & 7 deletions src/main/resources/templates/user/signrequests/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,16 +260,13 @@ <h3>L'application NexU n'a pas été détectée</h3>
</a>
</div>
<div id="nexu_ready_alert" style="display: none;">
<div class="alert alert-success float-left mt-1 mb-1 col-12">
<div class="alert alert-success mt-1 mb-1 col-12">
L’application NexU est fonctionnelle
<br/>
<small>Vous pouvez utiliser une clé matérielle ou un keystore</small>
</div>
<button id="checkValidateSignButtonEnd" class="mb-1 btn btn-success" title="Signer"
th:value="${signRequest.id}" autofocus>Signer et retourner à l'accueil
</button>
<button id="checkValidateSignButtonNext" th:if="${nextSignRequest != null}" class="mb-1 btn btn-success float-right" title="Signer"
th:value="${signRequest.id}" autofocus>Signer et aller à la suivante <i class="fas fa-arrow-alt-circle-right"></i>
<button id="checkValidateSignButtonNexu" class="mb-1 btn btn-success float-right" title="Signer"
th:value="${signRequest.id}" autofocus>Signer le document
</button>
</div>
</div>
Expand Down Expand Up @@ -329,7 +326,7 @@ <h5 class="modal-title" id="signAllModalLabel">Confirmer la signature des docume
</div>
</div>

<div th:if="${signRequest.parentSignBook.liveWorkflow.currentStep != null && signRequest.parentSignBook.liveWorkflow.currentStep.repeatable}" class="modal fade" id="stepRepeatableModal" tabindex="-1" role="dialog"
<div th:if="${signRequest.parentSignBook.liveWorkflow.currentStep != null && signRequest.parentSignBook.liveWorkflow.currentStep.repeatable != null && signRequest.parentSignBook.liveWorkflow.currentStep.repeatable}" class="modal fade" id="stepRepeatableModal" tabindex="-1" role="dialog"
aria-labelledby="signModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
Expand Down

0 comments on commit 0e0415a

Please sign in to comment.