Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Validata
validata-ui
Commits
7537e77e
Commit
7537e77e
authored
Nov 27, 2018
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Amend report
parent
9ba601f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
40 deletions
+48
-40
validata_ui/templates/validation_report.html
validata_ui/templates/validation_report.html
+45
-38
validata_ui/views.py
validata_ui/views.py
+3
-2
No files found.
validata_ui/templates/validation_report.html
View file @
7537e77e
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
font-size
:
1.2em
;
font-size
:
1.2em
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
@media
print
{
@media
print
{
.hidden-print
{
.hidden-print
{
display
:
none
;
display
:
none
;
...
@@ -93,60 +94,77 @@
...
@@ -93,60 +94,77 @@
<h2>
La table est invalide
</h2>
<h2>
La table est invalide
</h2>
<p
class=
"text"
>
{{ report.table['error-stats']['total'] }} erreur(s) détectée(s).
</p>
{% set structure_errors = report.table['error-stats']['structure-errors'] %}
{% if structure_errors['nb'] != 0 %}
Erreur(s) de structure ({{ structure_errors['nb'] }}) :
<ul>
{% for elt in structure_errors['distribution'] %}
<li>
{{ elt[0] }} ({{ elt[1] }})
</li>
{% endfor %}
</ul>
{% endif %}
{% if report.table.do_display_body_errors %}
{% set value_errors = report.table['error-stats']['value-errors'] %}
{% if value_errors %}
{% if value_errors['nb'] != 0 %}
Erreur(s) de valeur ({{ value_errors['nb'] }}) :
<ul>
{% for elt in value_errors['distribution'] %}
<li>
{{ elt[0] }} ({{ elt[1] }})
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
{% endif %}
{# table checks #}
{# table checks #}
{% if report.table.errors.structure %}
{% if report.table.errors.structure %}
<div>
<div>
<h3>
Problèmes de s
tructure
</h3>
<h3>
S
tructure
</h3>
{% for err in report.table.errors.structure %}
{% for err in report.table.errors.structure %}
<div
class=
"alert alert-danger"
>
<div
class=
"alert alert-danger"
>
{{ err.message | safe}}
{{ err.message | safe}}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
{% else %}
<p
class=
"text"
>
Aucune erreur de structure
</p>
{% endif %}
{% endif %}
<!-- row checks -->
<!-- row checks -->
{# We do display body errors! #}
{% if report.table.do_display_body_errors %}
<h3>
Contenu
</h3>
{# No errors - display preview #}
{% if not report.table.errors.body %}
{% if not report.table.errors.body %}
<h3>
Problèmes de contenu
</h3>
<p
class=
"text"
>
<p
class=
"text"
>
Aucune erreur de contenu
Aucune erreur de contenu
</p>
</p>
{{ tables.preview(source_data) }}
{{ tables.preview(source_data) }}
{% else %}
{# display errors #}
{{ tables.body_errors(report, source_data) }}
{% endif %}
{% endif %}
{% if report.table.errors.body %}
{# do not display errors #}
{% else %}
{% if not report.table.display_body_errors %}
<p
class=
"text"
>
Veuillez corriger ce(s) erreur(s) pour visualiser les problèmes de contenu.
</p>
<p
class=
"text"
>
<p
class=
"text"
>
<a
href=
"#"
id=
"show_body_errors"
>
Affichez
Veuillez corriger ce(s) erreur(s) pour visualiser les éventuels problèmes de contenu.
tout de même les problèmes de contenu
</a>
</p>
</p>
<div
class=
"alert alert-warning"
>
Attention, en cas de problèmes de structure signalés ci-dessus, certains messages d'erreurs ne seront pas
pertinents
</div>
<div
id=
"body_errors"
style=
"display: none"
>
{{ tables.body_errors(report, source_data) }}
</div>
{% else %}
<div>
{{ tables.body_errors(report, source_data) }}
</div>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% endblock %}
{% block footer %}
{% block footer %}
<script>
<script>
$
(
function
()
{
$
(
function
()
{
...
@@ -156,18 +174,7 @@
...
@@ -156,18 +174,7 @@
placement
:
'
auto
'
,
placement
:
'
auto
'
,
trigger
:
'
hover
'
trigger
:
'
hover
'
});
});
// Show body errors
$
(
'
#show_body_errors
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#body_errors
'
).
show
();
$
(
this
).
remove
();
})
})
})
</script>
</script>
{#
{% endblock %}
{{ report.table.errors.structure|length }} erreur(s) détectée(s)
\ No newline at end of file
{{ report.table.errors.body|length }} erreur(s) détectée(s)
#}
{% endblock %}
validata_ui/views.py
View file @
7537e77e
...
@@ -139,8 +139,9 @@ def create_validata_report(goodtables_report, schema):
...
@@ -139,8 +139,9 @@ def create_validata_report(goodtables_report, schema):
report
[
'table'
][
'errors'
][
'body'
].
append
(
err
)
report
[
'table'
][
'errors'
][
'body'
].
append
(
err
)
# Checks if there are structure errors different to invalid-column-delimiter
# Checks if there are structure errors different to invalid-column-delimiter
report
[
'table'
][
'display_body_errors'
]
=
all
(
err
[
'code'
]
==
'invalid-column-delimiter'
structure_errors
=
report
[
'table'
][
'errors'
][
'structure'
]
for
err
in
report
[
'table'
][
'errors'
][
'structure'
])
report
[
'table'
][
'do_display_body_errors'
]
=
len
(
structure_errors
)
==
0
or
\
all
(
err
[
'code'
]
==
'invalid-column-delimiter'
for
err
in
structure_errors
)
# Group body errors by row id
# Group body errors by row id
rows
=
[]
rows
=
[]
...
...
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