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:
SilentSpike
2020-01-01 11:56:50 +00:00
parent 9fca611ec1
commit d2f9278fe2
2 changed files with 20 additions and 13 deletions
+12 -7
View File
@@ -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');
}
}