Tag changeset with Osmose issue closed counts

This seems more useful than tagging with a list of joined coordinates
which quickly becomes truncated due to tag value length.

Adds a tag per issue type similar to iDs own validation.
This commit is contained in:
SilentSpike
2019-12-30 13:08:13 +00:00
parent d4723ec9e2
commit a068cdfc59
2 changed files with 11 additions and 9 deletions
+8 -6
View File
@@ -219,9 +219,11 @@ export default {
that.removeError(d);
if (d.newStatus === '/done') {
// No pretty identifier, so we just use coordinates
var closedID = d.loc[1].toFixed(5) + '/' + d.loc[0].toFixed(5);
_erCache.closed[d.error_type + ':' + closedID] = true;
// No error identifier, so we give a count of each category
if (!(d.item in _erCache.closed)) {
_erCache.closed[d.item] = 0;
}
_erCache.closed[d.item] += 1;
}
if (callback) callback(null, d);
})
@@ -266,8 +268,8 @@ export default {
updateRtree(encodeErrorRtree(error), false); // false = remove
},
// Used to populate `closed:osmose` changeset tag
getClosedIDs: function() {
return Object.keys(_erCache.closed).sort();
// Used to populate `closed:osmose:*` changeset tags
getClosedCounts: function() {
return _erCache.closed;
}
};
+3 -3
View File
@@ -150,9 +150,9 @@ export function uiCommit(context) {
}
}
if (services.osmose) {
var osmoseClosed = services.osmose.getClosedIDs();
if (osmoseClosed.length) {
tags['closed:osmose'] = osmoseClosed.join(';').substr(0, 255);
var osmoseClosed = services.osmose.getClosedCounts();
for (var issueType in osmoseClosed) {
tags['closed:osmose:' + issueType] = osmoseClosed[issueType].toString().substr(0, 255);
}
}