diff --git a/modules/services/improveOSM.js b/modules/services/improveOSM.js index 71c5f9897..281052a08 100644 --- a/modules/services/improveOSM.js +++ b/modules/services/improveOSM.js @@ -436,9 +436,11 @@ export default { } else { that.removeError(d); if (d.newStatus === 'SOLVED') { - // No pretty identifier, so we just use coordinates - var closedID = d.loc[1].toFixed(5) + '/' + d.loc[0].toFixed(5); - _erCache.closed[key + ':' + closedID] = true; + // No error identifier, so we give a count of each category + if (!(d.error_key in _erCache.closed)) { + _erCache.closed[d.error_key] = 0; + } + _erCache.closed[d.error_key] += 1; } } if (callback) callback(null, d); @@ -486,7 +488,7 @@ export default { }, // Used to populate `closed:improveosm` changeset tag - getClosedIDs: function() { - return Object.keys(_erCache.closed).sort(); + getClosedCounts: function() { + return _erCache.closed; } -}; +}; \ No newline at end of file diff --git a/modules/ui/commit.js b/modules/ui/commit.js index b2a764a88..dc2af6da2 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -25,7 +25,11 @@ var readOnlyTags = [ /^host$/, /^locale$/, /^warnings:/, - /^resolved:/ + /^resolved:/, + /^closed:note$/, + /^closed:keepright$/, + /^closed:improveosm:/, + /^closed:osmose:/ ]; // treat most punctuation (except -, _, +, &) as hashtag delimiters - #4398 @@ -134,6 +138,7 @@ export function uiCommit(context) { // assign tags for closed issues and notes var osmClosed = osm.getClosedIDs(); + var issueType; if (osmClosed.length) { tags['closed:note'] = osmClosed.join(';').substr(0, tagCharLimit); } @@ -144,15 +149,15 @@ export function uiCommit(context) { } } if (services.improveOSM) { - var iOsmClosed = services.improveOSM.getClosedIDs(); - if (iOsmClosed.length) { - tags['closed:improveosm'] = iOsmClosed.join(';').substr(0, tagCharLimit); + var iOsmClosed = services.improveOSM.getClosedCounts(); + for (issueType in iOsmClosed) { + tags['closed:improveosm:' + issueType] = iOsmClosed[issueType].toString().substr(0, tagCharLimit); } } if (services.osmose) { var osmoseClosed = services.osmose.getClosedCounts(); - for (var issueType in osmoseClosed) { - tags['closed:osmose:' + issueType] = osmoseClosed[issueType].toString().substr(0, 255); + for (issueType in osmoseClosed) { + tags['closed:osmose:' + issueType] = osmoseClosed[issueType].toString().substr(0, tagCharLimit); } } @@ -591,4 +596,4 @@ export function uiCommit(context) { return utilRebind(commit, dispatch, 'on'); -} \ No newline at end of file +}