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
fe575f7f
Commit
fe575f7f
authored
Nov 19, 2018
by
Pierre Dittgen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Message adjustments
parent
9350a521
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
validata_ui/static/css/validata.css
validata_ui/static/css/validata.css
+9
-0
validata_ui/views.py
validata_ui/views.py
+12
-3
No files found.
validata_ui/static/css/validata.css
0 → 100644
View file @
fe575f7f
/* Custom CSS rules for Validata-UI */
/* Validation report
Customize h2 display in popovers
*/
div
.popover
h2
{
font-size
:
1.4em
;
font-weight
:
bold
;
}
\ No newline at end of file
validata_ui/views.py
View file @
fe575f7f
...
...
@@ -66,10 +66,21 @@ def improve_errors(errors):
# markdown to HTML (with default values for 'title' and 'content')
# Use default values to insure right error display in validation report
# until validata.validate finished its message migration
# Set default title if no title
if
not
'title'
in
err
:
update_keys
[
'title'
]
=
'[{}]'
.
format
(
err
[
'code'
])
if
not
'message'
in
err
or
err
[
'message'
]
is
None
:
# Convert message to markdown only if no content
# => for pre-checks errors
if
'message'
in
err
and
not
'content'
in
err
:
update_keys
[
'message'
]
=
commonmark
(
err
[
'message'
])
# Else, default message
elif
not
'message'
in
err
or
err
[
'message'
]
is
None
:
update_keys
[
'message'
]
=
'[{}]'
.
format
(
err
[
'code'
])
# Message content
md_content
=
'*content soon available*'
if
not
'content'
in
err
else
err
[
'content'
]
update_keys
[
'content'
]
=
commonmark
(
md_content
)
...
...
@@ -138,8 +149,6 @@ def create_validata_report(goodtables_report, schema):
rows
=
[]
current_row_id
=
0
for
err
in
report
[
'table'
][
'errors'
][
'body'
]:
if
not
'row-number'
in
err
:
print
(
'ERR'
,
err
)
row_id
=
err
[
'row-number'
]
del
err
[
'row-number'
]
del
err
[
'context'
]
...
...
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