mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 22:03:37 +02:00
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:
@@ -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;
|
||||
}
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user