Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cove/cove_360/templates/cove_360/components/explore_checking.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ <h2 class="base-card__title">
</div>
{% endif %}


{% if additional_fields_count %}
<div id="additional-fields-tab" style="display:none" class="tab-content">
{% include "cove_360/components/explore/additional_fields.html" %}
Expand All @@ -185,4 +184,60 @@ <h2 class="base-card__title">
<div class="spacer-4"></div>

<script>
window.addEventListener('load', function () {

let validationErrors = [];
let accuracyChecks = [];
let usefulnessChecks = [];

{# Transfer the results data from the template to JS #}

/* Validation errors */
{% with validation_errors=validation_errors_grouped.required error_prefix='required-' %}
{% if validation_errors %}
validationErrors.append("missing-required-fields");
{% endif %}
{% endwith %}

{% with validation_errors=validation_errors_grouped.format error_prefix='format-' %}
{% if validation_errors %}
validationErrors.append("incorrect-formats");
{% endif %}
{% endwith %}

{% if additional_closed_codelist_values %}
validationErrors.append("codelist-errors");
{% endif %}

{% with validation_errors=validation_errors_grouped.other error_prefix='other-' %}
{% if validation_errors %}
validationErrors.append("other-errors");
{% endif %}
{% endwith %}

/* Accuracy checks */
{% for message, json_location, spreadsheet_location in quality_accuracy_checks %}
accuracyChecks.append('{{message.type}}');
{% endfor %}

/* Usefulness checks */
{% for message, json_location, spreadsheet_location in usefulness_checks %}
usefulnessChecks.append('{{message.type}}');
{% endfor %}

/* Send the data to matamo */
for (const validationError of validationErrors){
_paq.push(['trackEvent', 'Validation', validationError]); // eslint-disable-line no-undef
}

for (const accuracyCheck of accuracyChecks){
_paq.push(['trackEvent', 'Accuracy', accuracyCheck]); // eslint-disable-line no-undef
}

for (const usefulnessCheck of usefulnessChecks){
_paq.push(['trackEvent', 'Usefulness', usefulnessCheck]); // eslint-disable-line no-undef
}

_paq.push(['trackPageView']); // eslint-disable-line no-undef
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,6 @@ <h2 class="base-card__title">

<div class="spacer-3"></div>

{% comment %} TODO no longer needed?

<style scoped>
table {
width: 100%;
}

a[disabled] {
pointer-events: none;
opacity: 0.5! important;
}
</style>



<h1 id="report">Report</h1>
{% include "cove_360/components/explore/summary.html" %}
<hr />
{% include "cove_360/components/explore/validity.html" %}
<hr />
{% include "cove_360/components/explore/accuracy.html" %}
<hr />
{% include "cove_360/components/explore/usefulness.html" %}
#}
{% endcomment %}

<script>
window.addEventListener('load', function () {
const selfPublishEnabled = '{{ data_status.publisher.self_publish.enabled }}';
Expand Down