Skip to content
Snippets Groups Projects
Commit 3d0b23b1 authored by Martin Lowe's avatar Martin Lowe :flag_ca:
Browse files

Iss #146 - Update status UI to list successfully validated users

Resolves #146
parent ea150714
No related branches found
No related tags found
1 merge request!165Iss #146 - Update status UI to list successfully validated users
...@@ -50,6 +50,21 @@ public class EclipseQuteTemplateExtensions { ...@@ -50,6 +50,21 @@ public class EclipseQuteTemplateExtensions {
return statuses.stream().flatMap(s -> s.getErrors().stream()).collect(Collectors.toList()); 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> * <p>
* Obfuscates an email for public consumption, showing the first letter of the email address, and the domain of the * Obfuscates an email for public consumption, showing the first letter of the email address, and the domain of the
......
{#include eclipse_header} {#eclipse_base title='Git ECA Validation'}
{#title}Git ECA Validation{/} {#content_prewrap}
{/include}
{#include eclipse_breadcrumb /} {#include eclipse_breadcrumb /}
<div class="container" id="main-page-content"> <div class="container" id="main-page-content">
<div id="main-content-row" class="row"> <div id="main-content-row" class="row">
<section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20"> <section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20">
<h1>Git ECA Validation Status</h1> <h1>Git ECA Validation Status</h1>
{/}
{#content}
<p>{message}</p> <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> <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> <h2>Helpful links</h2>
...@@ -16,7 +18,11 @@ ...@@ -16,7 +18,11 @@
<li><a href="https://github.com/apps/eclipse-eca-validation/installations/select_target">Install the application</a> <li><a href="https://github.com/apps/eclipse-eca-validation/installations/select_target">Install the application</a>
{/if} {/if}
</ul> </ul>
{/}
{#content_postwrap}
</section> </section>
</div> </div>
</div> </div>
{#include eclipse_footer /} {/}
\ No newline at end of file {/}
\ No newline at end of file
{#include eclipse_header} {#eclipse_base title='Git ECA Validation'}
{#title}Git ECA Validation{/} {#precontent}
{/include} {#include eclipse_breadcrumb}{/}
{#include eclipse_breadcrumb /}
{|<style> {|<style>
.panel.list-group>div { .panel.list-group>div {
background-color: white; background-color: white;
...@@ -29,9 +28,13 @@ ...@@ -29,9 +28,13 @@
text-decoration: underline; text-decoration: underline;
} }
</style>|} </style>|}
{/}
{#content_prewrap}
<div class="container" id="main-page-content"> <div class="container" id="main-page-content">
<div id="main-content-row" class="row"> <div id="main-content-row" class="row">
{/}
{#content}
<section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20"> <section id="main-content" class="col-md-18 col-sm-16 margin-bottom-20">
<div id="toast-target"> <div id="toast-target">
</div> </div>
...@@ -77,6 +80,22 @@ ...@@ -77,6 +80,22 @@
<a href="{repoUrl}" target="_blank" rel="noopener" class="btn btn-primary margin-top-10">Project repository</a> <a href="{repoUrl}" target="_blank" rel="noopener" class="btn btn-primary margin-top-10">Project repository</a>
</div> </div>
</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} {#if statuses.getErrorCount > 0}
<div class="row"> <div class="row">
<div class="col-md-24 margin-bottom-20"> <div class="col-md-24 margin-bottom-20">
...@@ -142,12 +161,6 @@ ...@@ -142,12 +161,6 @@
</div> </div>
</div> </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}
{#if statuses.0.provider == ProviderType:GITHUB && pullRequestNumber != null && fullRepoName != null} {#if statuses.0.provider == ProviderType:GITHUB && pullRequestNumber != null && fullRepoName != null}
<div> <div>
...@@ -201,8 +214,13 @@ ...@@ -201,8 +214,13 @@
</section> </section>
</div> </div>
</aside> </aside>
{/}
{#content_postwrap}
</div> </div>
</div> </div>
{/}
{#post_content}
<script src="https://hcaptcha.com/1/api.js?hl=en" async="async" defer="defer"></script> <script src="https://hcaptcha.com/1/api.js?hl=en" async="async" defer="defer"></script>
{| {|
<script> <script>
...@@ -306,4 +324,5 @@ ...@@ -306,4 +324,5 @@
}); });
</script>|} </script>|}
{#include eclipse_footer /} {/}
\ No newline at end of file {/eclipse_base}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment