From a53f1c0f67577dfca4c04f9283010b0889352a01 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Tue, 31 Dec 2019 19:36:27 +0000 Subject: [PATCH] Add support for Osmose unnecessary tag error type --- css/65_data.css | 4 ++++ data/core.yaml | 6 ++++++ data/qa_errors.json | 9 ++++++++- dist/locales/en.json | 8 ++++++++ modules/services/osmose.js | 12 ++++++++++-- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/css/65_data.css b/css/65_data.css index 181d656fa..ff62cb7b1 100644 --- a/css/65_data.css +++ b/css/65_data.css @@ -200,6 +200,10 @@ color: #3DE736; } +.osmose.category-9010 { + color: #976432; +} + /* Custom Map Data (geojson, gpx, kml, vector tile) */ .layer-mapdata { pointer-events: none; diff --git a/data/core.yaml b/data/core.yaml index c4c0b2421..fbc6491c9 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -933,6 +933,12 @@ en: 3: 'surveillance camera' 4: 'fire hydrant' 5: 'set of traffic signals' + 9010-9010001: + title: 'Unnecessary Tag' + description: '{0} is redundantly tagged with "{1}".' + 9010-9010003: + title: 'Descriptive Name' + description: '{0} appears to have a descriptive name: "{1}".' improveOSM: title: ImproveOSM Detection geometry_types: diff --git a/data/qa_errors.json b/data/qa_errors.json index 08ecf6c73..230e565f4 100644 --- a/data/qa_errors.json +++ b/data/qa_errors.json @@ -53,7 +53,8 @@ "7090", "5070", "8300", - "8360" + "8360", + "9010" ], "errorTypes": { "0-1": { @@ -250,6 +251,12 @@ }, "8360-5": { "icon": "temaki-traffic_signals" + }, + "9010-9010001": { + "icon": "make-waste-basket" + }, + "9010-9010003": { + "icon": "temaki-plaque" } } } diff --git a/dist/locales/en.json b/dist/locales/en.json index 37d9a553c..d396d060b 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1169,6 +1169,14 @@ "7090-3": { "title": "Disconnected Highway Feature", "description": "{0} is highway feature or barrier with no connected highway." + }, + "9010-9010001": { + "title": "Unnecessary Tag", + "description": "{0} is redundantly tagged with \"{1}\"." + }, + "9010-9010003": { + "title": "Descriptive Name", + "description": "{0} appears to have a descriptive name: \"{1}\"." } } }, diff --git a/modules/services/osmose.js b/modules/services/osmose.js index 6855e471e..71d9ba24b 100644 --- a/modules/services/osmose.js +++ b/modules/services/osmose.js @@ -174,7 +174,7 @@ export default { }); }, - // todo: &item=1090%2C1110%2C1120%2C3010%2C3020%2C3032%2C3050%2C3060%2C3091%2C3092%2C3150%2C3180%2C3190%2C3200%2C3210%2C4010%2C4030%2C5010%2C5020%2C5030%2C5040%2C5050%2C5080%2C6030%2C9000%2C9001%2C9004%2C9005%2C9010 + // todo: &item=1090%2C1110%2C1120%2C3010%2C3020%2C3032%2C3050%2C3060%2C3091%2C3092%2C3150%2C3180%2C3190%2C3200%2C3210%2C4010%2C4030%2C5010%2C5020%2C5030%2C5040%2C5050%2C5080%2C6030%2C9000%2C9001 loadErrorDetail(d, callback) { // Error details only need to be fetched once if (d.elems !== undefined) { @@ -199,7 +199,8 @@ export default { '3090-3090': /Incorrect date "(.+)"/i, '5070-50703': /"(.+)"=".+" unexpected symbol char \(.+, (.+)\)/i, '5070-50704': /Umbalanced (.+)/i, - '5070-50705': /Unexpected char (.+)/i + '5070-50705': /Unexpected char (.+)/i, + '9010-9010003': /(.+)/ }; if (d.error_type in special) { let [, ...details] = special[d.error_type].exec(data.subtitle); @@ -208,6 +209,13 @@ export default { if (d.error_type === '5070-50703') { d.replacements[2] = String.fromCharCode(details[1]); } + } else if (d.error_type === '9010-9010001') { + // This error has a rare subtitle variant + let details = /(.+) is unnecessary/i.exec(data.subtitle); + if (details == null) { + details = /\. Remove (.+)/i.exec(data.subtitle); + } + d.replacements.push(details[1]); } this.replaceError(d);