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 {
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
......
{#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
{#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
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