z-sort errors above warnings

This commit is contained in:
Bryan Housel
2019-01-10 21:47:37 -05:00
parent ae8dffa43c
commit 623f96449e
2 changed files with 7 additions and 1 deletions

View File

@@ -328,6 +328,7 @@ export default {
// try to handle error type directly, fallback to parent error type.
var whichType = errorTemplate ? errorType : parentErrorType;
var whichTemplate = errorTypes[whichType];
// Rewrite a few of the errors at this point..
// This is done to make them easier to linkify and translate.
@@ -376,6 +377,7 @@ export default {
which_type: whichType,
error_type: errorType,
parent_error_type: parentErrorType,
severity: whichTemplate.severity || 'error',
object_id: props.object_id,
object_type: props.object_type,
schema: props.schema,

View File

@@ -175,7 +175,11 @@ export function svgKeepRight(projection, context, dispatch) {
function sortY(a, b) {
return (a.id === selectedID) ? 1 : (b.id === selectedID) ? -1 : b.loc[1] - a.loc[1];
return (a.id === selectedID) ? 1
: (b.id === selectedID) ? -1
: (a.severity === 'error' && b.severity !== 'error') ? 1
: (b.severity === 'error' && a.severity !== 'error') ? -1
: b.loc[1] - a.loc[1];
}
}