mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Port changeset tag improvement to ImproveOSM QA
Also marked the `closed:` tags as readonly since these are filled in automatically. - Gives a count of each error type closed instead of making a list of joined coordinates which quickly fills the maximum value length. - This is more useful since a changeset already gives the area worked on while these counts give insight into the type of changes made. - Similar to iD own validation tags
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user