diff --git a/src/main/java/org/eclipsefoundation/git/eca/config/EclipseQuteTemplateExtensions.java b/src/main/java/org/eclipsefoundation/git/eca/config/EclipseQuteTemplateExtensions.java index c37a561ab593fa3b2e11506ae53807c0f10ad991..b69ccc5dfca3c87e01beef34c390faec58ba7c3f 100644 --- a/src/main/java/org/eclipsefoundation/git/eca/config/EclipseQuteTemplateExtensions.java +++ b/src/main/java/org/eclipsefoundation/git/eca/config/EclipseQuteTemplateExtensions.java @@ -50,6 +50,21 @@ public class EclipseQuteTemplateExtensions { return statuses.stream().flatMap(s -> s.getErrors().stream()).collect(Collectors.toList()); } + /** + * Converts the status list to a list of email addresses that were associated with validated commits. + * + * @param statuses the list of commit statuses for the current validation. + * @return list of email addresses associated with valid requests + */ + static List<String> getUniquePassedMails(List<CommitValidationStatus> statuses) { + return statuses + .stream() + .filter(s -> s.getErrors().isEmpty()) + .map(CommitValidationStatus::getUserMail) + .distinct() + .collect(Collectors.toList()); + } + /** * <p> * Obfuscates an email for public consumption, showing the first letter of the email address, and the domain of the diff --git a/src/main/resources/templates/error.html b/src/main/resources/templates/error.html index 9a1c92daa6067ddebb9feac15ab96aa1bdbd6223..db8549dd8130ae50beee70f4c13081b50971c99c 100644 --- a/src/main/resources/templates/error.html +++ b/src/main/resources/templates/error.html @@ -1,11 +1,13 @@ -{#include eclipse_header} - {#title}Git ECA Validation{/} -{/include} +{#eclipse_base title='Git ECA Validation'} +{#content_prewrap} {#include eclipse_breadcrumb /} <div class="container" id="main-page-content"> <div id="main-content-row" class="row"> <section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20"> <h1>Git ECA Validation Status</h1> +{/} + +{#content} <p>{message}</p> <p>If you think this is an error, please report a new issue to the <a href="https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues">Eclipse Foundation Helpdesk</a></p> <h2>Helpful links</h2> @@ -16,7 +18,11 @@ <li><a href="https://github.com/apps/eclipse-eca-validation/installations/select_target">Install the application</a> {/if} </ul> +{/} + +{#content_postwrap} </section> </div> </div> -{#include eclipse_footer /} \ No newline at end of file +{/} +{/} \ No newline at end of file diff --git a/src/main/resources/templates/simple_fingerprint_ui.html b/src/main/resources/templates/simple_fingerprint_ui.html index 8b861a0c59b5da313eb9951e976d15a88c6715d6..48b83e3248bac909737572db493101a6b7cde4cf 100644 --- a/src/main/resources/templates/simple_fingerprint_ui.html +++ b/src/main/resources/templates/simple_fingerprint_ui.html @@ -1,7 +1,6 @@ -{#include eclipse_header} - {#title}Git ECA Validation{/} -{/include} -{#include eclipse_breadcrumb /} +{#eclipse_base title='Git ECA Validation'} +{#precontent} +{#include eclipse_breadcrumb}{/} {|<style> .panel.list-group>div { background-color: white; @@ -29,9 +28,13 @@ text-decoration: underline; } </style>|} - +{/} +{#content_prewrap} <div class="container" id="main-page-content"> <div id="main-content-row" class="row"> +{/} + +{#content} <section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20"> <div id="toast-target"> </div> @@ -77,6 +80,22 @@ <a href="{repoUrl}" target="_blank" rel="noopener" class="btn btn-primary margin-top-10">Project repository</a> </div> </div> + {#let validEmails=statuses.getUniquePassedMails} + {#if validEmails.size > 0 } + <div class="panel panel-success"> + <div class="panel-heading"><i class="fa fa-check" aria-hidden="true"></i> + Author(s) covered by necessary legal agreements + </div> + <div class="panel-body background-white"> + <ul class="list-group-item-text"> + {#for email in validEmails} + <li>{email.obfuscateEmail}</li> + {/for} + </ul> + </div> + </div> + {/if} + {/let} {#if statuses.getErrorCount > 0} <div class="row"> <div class="col-md-24 margin-bottom-20"> @@ -142,12 +161,6 @@ </div> </div> </div> - {#else} - <div class="panel panel-success"> - <div class="panel-heading"><i class="fa fa-check" aria-hidden="true"></i> - Author(s) covered by necessary legal agreements - </div> - </div> {/if} {#if statuses.0.provider == ProviderType:GITHUB && pullRequestNumber != null && fullRepoName != null} <div> @@ -201,8 +214,13 @@ </section> </div> </aside> +{/} +{#content_postwrap} </div> </div> +{/} + +{#post_content} <script src="https://hcaptcha.com/1/api.js?hl=en" async="async" defer="defer"></script> {| <script> @@ -306,4 +324,5 @@ }); </script>|} -{#include eclipse_footer /} \ No newline at end of file +{/} +{/eclipse_base} \ No newline at end of file