Skip to content

Commit

Permalink
Merge pull request #68 from mhansma96/main
Browse files Browse the repository at this point in the history
Fix for missing values in JSON/HTML (fixes #64 and #65)
  • Loading branch information
hidde authored Aug 31, 2021
2 parents 447b068 + 8cc87e0 commit 67a2c4e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 2 additions & 0 deletions src/components/pages/Evaluation/ViewReportPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
$evaluationStore.exploreTarget.essentialFunctionality = $exploreStore['ESSENTIAL_FUNCTIONALITY'];
$evaluationStore.exploreTarget.pageTypeVariety = $exploreStore['PAGE_TYPES'];
$evaluationStore.reportFindings.evaluationSpecifics = $summaryStore.EVALUATION_SPECIFICS;
}
</script>
19 changes: 14 additions & 5 deletions src/components/ui/Report.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,18 @@
<p>{TRANSLATED.TEXT_NO_SAMPLE}</p>
{/if}

<h2>{TRANSLATED.LABEL_TECH}</h2>
{#if report.tech != ""}
<p>{report.tech}</p>
{:else}
<p>{TRANSLATED.LABEL_NOT_PROVIDED}</p>
{/if}

<h2>{TRANSLATED.HEADING_SPECIFICS}</h2>
<p>{@html marked(report.specifics) || TRANSLATED.LABEL_NOT_PROVIDED}</p>

<h2>{TRANSLATED.HEADING_RESOURCES}</h2>
<ul>
<h2 class='strip'>{TRANSLATED.HEADING_RESOURCES}</h2>
<ul class='strip'>
<li><a href="https://www.w3.org/WAI/intro/wcag">Web Content Accessibility Guidelines (WCAG)
Overview</a></li>
<li><a href="https://www.w3.org/WAI/WCAG21/quickref/">How to Meet WCAG 2.1 Quick Reference</a></li>
Expand Down Expand Up @@ -242,7 +249,7 @@
import ReportSummary from './Report/ReportSummary.svelte';
import evaluationStore from '@app/stores/evaluationStore.js';
const { sampleStore, summaryStore, translate } = getContext(
const { sampleStore, summaryStore, exploreStore, translate } = getContext(
'app'
);
Expand Down Expand Up @@ -275,7 +282,8 @@
CONFORMANCE_LEVEL: $translate('WCAG.COMMON.CONFORMANCE_LEVEL'),
TEXT_NO_SAMPLE: $translate('PAGES.AUDIT.NO_SAMPLE'),
SUMMARY: $translate('UI.REPORT.SUMMARY'),
ALL_RESULTS: $translate('UI.REPORT.ALL_RESULTS')
ALL_RESULTS: $translate('UI.REPORT.ALL_RESULTS'),
LABEL_TECH: $translate('PAGES.EXPLORE.LABEL_TECH')
};
$: report = {
Expand All @@ -288,7 +296,8 @@
],
specifics: $summaryStore['EVALUATION_SPECIFICS'],
summary: $summaryStore['EVALUATION_SUMMARY'],
title: $summaryStore['EVALUATION_TITLE'] || $translate('PAGES.REPORT.TITLE')
title: $summaryStore['EVALUATION_TITLE'] || $translate('PAGES.REPORT.TITLE'),
tech: $exploreStore['TECHNOLOGIES_RELIED_UPON']
};
let wcagVersions = [...WCAG_VERSIONS].reverse().map((version) => {
Expand Down
4 changes: 2 additions & 2 deletions src/components/ui/Report/ReportAllResults.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<th scope="col">{TRANSLATED.HEADER_SUCCESS_CRITERION}</th>
<th scope="col">{TRANSLATED.HEADER_RESULT}</th>
<th scope="col">{TRANSLATED.HEADER_OBSERVATIONS}</th>
<th scope="col">{TRANSLATED.EDIT}</th>
<th scope="col" class="strip">{TRANSLATED.EDIT}</th>
</tr>
<!--
* Should filter assertions based on test prop;
Expand Down Expand Up @@ -69,7 +69,7 @@
{/each}
{/if}
</td>
<td>
<td class="strip">
<Link to={`/evaluation/audit-sample#criterion-${criterion.num.replaceAll('.','')}`}>
<span class="visuallyhidden">Edit {criterion.num}</span>
<svg
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function downloadFileHTML({ contents, name = 'download.txt', type = 'text
let file;

const removeEls = Array.from(
htmlDocument.querySelectorAll("button, input, aside, footer, .Controls, #site-header, .Nav, a")
htmlDocument.querySelectorAll("button, input, aside, footer, .Controls, #site-header, .Nav, .strip")
);

removeEls.forEach((el) => {
Expand Down

0 comments on commit 67a2c4e

Please sign in to comment.