diff --git a/modules/services/improveOSM.js b/modules/services/improveOSM.js index c84260eef..e170f930d 100644 --- a/modules/services/improveOSM.js +++ b/modules/services/improveOSM.js @@ -215,7 +215,7 @@ export default { comments: null, error_subtype: '', error_type: k, - icon: 'fas-arrow-circle-up', //TODO: Change arrow based on direction? + icon: '', //TODO: Find suitable icon identifier: { // this is used to post changes to the error wayId: feature.wayId, fromNodeId: feature.fromNodeId, @@ -387,10 +387,10 @@ export default { that.removeError(d); + // No pretty identifier, so we just use coordinates if (d.newStatus === 'SOLVED') { - //TODO the identifiers are ugly and can't be used frontend, use error position instead? - // or perhaps don't track this at all? - //_erCache.closed[d.error_type + ':' + d.identifier] = true; + var closedID = d.loc[1].toFixed(5) + '/' + d.loc[0].toFixed(5); + _erCache.closed[d.error_type + ':' + closedID] = true; } return callback(err, d); @@ -430,5 +430,10 @@ export default { delete _erCache.data[error.id]; updateRtree(encodeErrorRtree(error), false); // false = remove + }, + + // Used to populate `closed:improveosm` changeset tag + getClosedIDs: function() { + return Object.keys(_erCache.closed).sort(); } }; \ No newline at end of file diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 46201e30c..f1706fdc7 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -109,6 +109,12 @@ export function uiCommit(context) { tags['closed:keepright'] = krClosed.join(';').substr(0, 255); } } + if (services.improveOSM) { + var iOsmClosed = services.improveOSM.getClosedIDs(); + if (iOsmClosed.length) { + tags['closed:improveosm'] = iOsmClosed.join(';').substr(0, 255); + } + } _changeset = _changeset.update({ tags: tags }); @@ -461,4 +467,4 @@ export function uiCommit(context) { return utilRebind(commit, dispatch, 'on'); -} +} \ No newline at end of file