Add generic QA error

I've converted the improveOSM errors to use this new generic QA error
structure which should allow for more general code to be used in
behaviour and UI.

Sidebar preview is currently broken, but will be fixed shortly.
This commit is contained in:
SilentSpike
2019-02-03 12:54:05 +00:00
parent 3f2abbe7c6
commit 20ed8b50c9
10 changed files with 168 additions and 62 deletions
+3 -3
View File
@@ -5,7 +5,7 @@ import {
select as d3_select
} from 'd3-selection';
import { osmEntity, osmNote, krError, iOsmError } from '../osm';
import { osmEntity, osmNote, krError, qaError } from '../osm';
import { utilKeybinding, utilRebind } from '../util';
@@ -113,7 +113,7 @@ export function behaviorHover(context) {
selector = '.data' + datum.__featurehash__;
} else if (
datum instanceof iOsmError ||
datum instanceof qaError ||
datum instanceof krError
) {
entity = datum;
@@ -187,4 +187,4 @@ export function behaviorHover(context) {
return utilRebind(behavior, dispatch, 'on');
}
}
+5 -5
View File
@@ -19,8 +19,8 @@ import {
import {
osmEntity,
osmNote,
iOsmError,
krError
krError,
qaError
} from '../osm';
@@ -171,11 +171,11 @@ export function behaviorSelect(context) {
context
.selectedNoteID(datum.id)
.enter(modeSelectNote(context, datum.id));
} else if (datum instanceof iOsmError & !isMultiselect) { // clicked an improveOSM error
} else if (datum instanceof krError & !isMultiselect) { // clicked a krError error
context
.selectedErrorID(datum.id)
.enter(modeSelectError(context, datum.id, datum.source));
} else if (datum instanceof krError & !isMultiselect) { // clicked a krError error
} else if (datum instanceof qaError & !isMultiselect) { // clicked an external QA error
context
.selectedErrorID(datum.id)
.enter(modeSelectError(context, datum.id, datum.source));
@@ -241,4 +241,4 @@ export function behaviorSelect(context) {
return behavior;
}
}