Fix QA error icons

Pass service itself in to QAItem constructor for purpose of fetching
data. Store string as `title` property on the service.
This commit is contained in:
SilentSpike
2020-02-12 21:25:13 +00:00
parent 9364b1d637
commit 3ee32776a7
4 changed files with 13 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ export class QAItem {
constructor(loc, service, itemType, id, props) {
// Store required properties
this.loc = loc;
this.service = service;
this.service = service.title;
this.itemType = itemType;
// All issues must have an ID for selection, use generic if none specified
@@ -33,7 +33,7 @@ export class QAItem {
return this;
}
// Generic handling for services without nice IDs
// Generic handling for newly created QAItems
static id() {
return this.nextId--;
}

View File

@@ -118,6 +118,8 @@ function preventCoincident(loc, bumpUp) {
}
export default {
title: 'improveOSM',
init(context) {
context.data().get('qa_data')
.then(d => _impOsmData = d.improveOSM);
@@ -209,7 +211,7 @@ export default {
// One-ways can land on same segment in opposite direction
loc = preventCoincident(loc, false);
let d = new QAItem(loc, 'improveOSM', k, itemId, {
let d = new QAItem(loc, this, k, itemId, {
issueKey: k, // used as a category
identifier: { // used to post changes
wayId,
@@ -246,7 +248,7 @@ export default {
let loc = pointAverage(feature.points);
loc = preventCoincident(loc, false);
let d = new QAItem(loc, 'improveOSM', `${k}-${geoType}`, itemId, {
let d = new QAItem(loc, this, `${k}-${geoType}`, itemId, {
issueKey: k,
identifier: { x, y }
});
@@ -282,7 +284,7 @@ export default {
const via_node = ids[3];
const to_way = ids[2].split(':')[1];
let d = new QAItem(loc, 'improveOSM', k, itemId, {
let d = new QAItem(loc, this, k, itemId, {
issueKey: k,
identifier: id,
objectId: via_node,

View File

@@ -255,6 +255,8 @@ function parseError(capture, idType) {
export default {
title: 'keepRight',
init(context) {
context.data().get('keepRight')
.then(d => _krData = d);
@@ -381,7 +383,7 @@ export default {
coincident = _cache.rtree.search(bbox).length;
} while (coincident);
let d = new QAItem(loc, 'keepRight', itemType, id, {
let d = new QAItem(loc, this, itemType, id, {
comment,
description,
whichType,

View File

@@ -61,6 +61,8 @@ function preventCoincident(loc) {
}
export default {
title: 'osmose',
init(context) {
context.data().get('qa_data')
.then(d => {
@@ -135,7 +137,7 @@ export default {
let loc = issue.geometry.coordinates; // lon, lat
loc = preventCoincident(loc);
let d = new QAItem(loc, 'osmose', itemType, id, { item });
let d = new QAItem(loc, this, itemType, id, { item });
// Setting elems here prevents UI detail requests
if (item === 8300 || item === 8360) {