Skip to content

Commit

Permalink
Fix: Hide report in HTML Formatter when the status is error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesus David García Gomez authored and molant committed Sep 7, 2018
1 parent 58b3479 commit 1203ba3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
@@ -1,6 +1,5 @@
<div id="scan-error" class="scan-error">
<p>
There was an error and we were only able to partially complete the scan. View the results below or
<% if(result.isScanner) { %><a href="/scanner/">perform another scan</a><% } else { %>run webhint again<% } %>.
There was an error and we were not able to complete the scan. <% if(result.isScanner) { %><a href="/scanner/">Perform another scan</a><% } else { %>Run webhint again<% } %>.
<p>
</div>
11 changes: 7 additions & 4 deletions packages/formatter-html/src/views/partials/scan-result.ejs
Expand Up @@ -11,11 +11,11 @@
<div class="scan-overview--details">
<div class="scan-overview--warnings">
<p class="scan-overview__subheader">warnings</p>
<p class="scan-overview__body--red" id="total-warnings"><%= result.warnings %></p>
<p class="scan-overview__body--red" id="total-warnings"><%= result.status !== 'error' ? result.warnings : '-'; %></p>
</div>
<div class="scan-overview--errors">
<p class="scan-overview__subheader">errors</p>
<p class="scan-overview__body--red" id="total-errors"><%= result.errors %></p>
<p class="scan-overview__body--red" id="total-errors"><%= result.status !== 'error' ? result.errors : '-'; %></p>
</div>
<div class="scan-overview--time">
<p class="scan-overview__subheader">scan time</p>
Expand All @@ -42,7 +42,8 @@
<% } %>
</div>
</div>
<div class="layout layout--fifths">
<% if(result.status !== 'error') { %>
<div class="layout layout--fifths" id="categories-summary">
<% result.categories.forEach((category) => { -%>
<div class="module">
<div class="rule-tile <% if (category.errors !== 0 || category.warnings !== 0) { %>rule-tile--failed<% } else if (utils.noPending(category)) { %>rule-tile--passed<% } %>">
Expand All @@ -62,9 +63,10 @@
</div>
<% }) %>
</div>
<% } %>
<% if (result.status === 'error') { %>
<%- include('scan-error-message', { result }) %>
<% } %>
<% } else { %>
<section id="results-container" class="section container" role="main" aria-labelledby="errors-warnings" aria-live="polite">
<h2 id="errors-warnings">Errors &amp; Warnings</h2>
<div class="layout layout--sidebar--alt">
Expand Down Expand Up @@ -96,6 +98,7 @@
</div>
</div>
</section>
<% } %>
<section class="section container">
<p class="subtitle">Have an issue or problem with the scanner?</p>
<p>File an issue on
Expand Down

0 comments on commit 1203ba3

Please sign in to comment.