From 24022416cb76e9026360fb2aeef6f74104cefd4b Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 9 Feb 2019 16:28:27 +0000 Subject: [PATCH] Fix negative number of trips in ImproveOSM issues See https://github.com/openstreetmap/iD/pull/5739#issuecomment-460786055 --- data/core.yaml | 3 ++- dist/locales/en.json | 3 ++- modules/services/improveOSM.js | 7 ++++++- modules/ui/improveOSM_details.js | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 702efd306..180b4e8cc 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -684,6 +684,7 @@ en: mr: title: Missing Geometry description: '{num_trips} recorded trips in this area suggest there may be unmapped {geometry_type} here.' + description_alt: 'Data from a 3rd party suggests there may be unmapped {geometry_type} here.' tr: title: Missing Turn Restriction description: '{num_passed} of {num_trips} recorded trips (travelling {travel_direction}) make a turn from {from_way} to {to_way} at {junction}. There may be a missing "{turn_restriction}" restriction.' @@ -1547,4 +1548,4 @@ en: wikidata: identifier: "Identifier" label: "Label" - description: "Description" + description: "Description" \ No newline at end of file diff --git a/dist/locales/en.json b/dist/locales/en.json index 1d2f99e37..bd24533d7 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -828,7 +828,8 @@ }, "mr": { "title": "Missing Geometry", - "description": "{num_trips} recorded trips in this area suggest there may be unmapped {geometry_type} here." + "description": "{num_trips} recorded trips in this area suggest there may be unmapped {geometry_type} here.", + "description_alt": "Data from a 3rd party suggests there may be unmapped {geometry_type} here." }, "tr": { "title": "Missing Turn Restriction", diff --git a/modules/services/improveOSM.js b/modules/services/improveOSM.js index 9d3b51ab7..1d6ad7f0d 100644 --- a/modules/services/improveOSM.js +++ b/modules/services/improveOSM.js @@ -267,6 +267,11 @@ export default { geometry_type: t('QA.improveOSM.geometry_types.' + geoType) }; + // -1 trips indicates data came from a 3rd party + if (feature.numberOfTrips === -1) { + d.desc = t('QA.improveOSM.error_types.mr.description_alt', d.replacements); + } + _erCache.data[d.id] = d; _erCache.rtree.insert(encodeErrorRtree(d)); }); @@ -476,4 +481,4 @@ export default { getClosedIDs: function() { return Object.keys(_erCache.closed).sort(); } -}; +}; \ No newline at end of file diff --git a/modules/ui/improveOSM_details.js b/modules/ui/improveOSM_details.js index efa27ef9b..9f016e4df 100644 --- a/modules/ui/improveOSM_details.js +++ b/modules/ui/improveOSM_details.js @@ -17,6 +17,9 @@ export function uiImproveOsmDetails(context) { var unknown = t('inspector.unknown'); if (!d) return unknown; + + if (d.desc) return d.desc; + var errorType = d.error_key; var et = dataEn.QA.improveOSM.error_types[errorType]; @@ -124,4 +127,4 @@ export function uiImproveOsmDetails(context) { return improveOsmDetails; -} +} \ No newline at end of file