Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Validata
validata-ui
Commits
4f37e535
Commit
4f37e535
authored
Oct 03, 2018
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display body errors only if no structure errors
parent
8034f2fb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
31 deletions
+37
-31
validata_ui_next/templates/validation_report.html
validata_ui_next/templates/validation_report.html
+11
-11
validata_ui_next/views.py
validata_ui_next/views.py
+26
-20
No files found.
validata_ui_next/templates/validation_report.html
View file @
4f37e535
...
...
@@ -45,8 +45,6 @@
{% if report.table.errors.structure %}
<div>
<h3>
Problèmes de structure
</h3>
{{ report.table.errors.structure|length }} erreur(s) détectée(s)
{% for err in report.table.errors.structure %}
<div
class=
"alert alert-danger"
>
{{ err.message | safe}}
...
...
@@ -58,9 +56,12 @@
<!-- row checks -->
{% if report.table.errors.body %}
{% if not report.table.display_body_errors %}
Merci de corriger ce(s) erreur(s) pour visualiser les erreurs de contenu.
{% else %}
<div>
<h3>
Problèmes de contenu
</h3>
{{ report.table.errors.body|length }} erreur(s) détectée(s)
<div
class=
"table-responsive-sm"
>
<table
class=
"table-sm table-bordered table-striped table-hover"
>
<thead
class=
"thead-light"
>
...
...
@@ -100,18 +101,11 @@
</tbody>
</table>
</div>
{% endif %}
{% endif %}
</div>
<!--
<pre>
{{ report_str | safe }}
</pre>
-->
{% endif %}
{% endblock %}
{% block footer %}
...
...
@@ -127,4 +121,10 @@
})
})
</script>
{#
{{ report.table.errors.structure|length }} erreur(s) détectée(s)
{{ report.table.errors.body|length }} erreur(s) détectée(s)
#}
{% endblock %}
\ No newline at end of file
validata_ui_next/views.py
View file @
4f37e535
...
...
@@ -156,6 +156,12 @@ def create_validata_report(goodtables_report, schema):
else
:
report
[
'table'
][
'errors'
][
'body'
].
append
(
err
)
# If there are structure errors different to invalid-column-delimiter
# => don't display body errors
report
[
'table'
][
'display_body_errors'
]
=
all
(
err
[
'code'
]
==
'invalid-column-delimiter'
for
err
in
report
[
'table'
][
'errors'
][
'structure'
])
if
report
[
'table'
][
'display_body_errors'
]:
# and group body errors by row id
rows
=
[]
current_row_id
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment