diff --git a/data/core.yaml b/data/core.yaml index f177a42b5..b78f77db0 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -1150,59 +1150,48 @@ en: warning: warning disconnected_highway: message: "{highway} is disconnected from other highways." - tooltip: "Roads should be connected to other roads or building entrances." + tip: Roads should be connected to other roads or building entrances. old_multipolygon: message: "{multipolygon} has misplaced tags." - tooltip: "Multipolygons should be tagged on their relation, not their outer way." + tip: Multipolygons should be tagged on their relation, not their outer way. untagged_feature: - message: "{feature} has no tags." - tooltip: "Select a feature type that describes what this is." + message: "{feature} has no descriptive tags." + tip: Features must have tags that define what they are. many_deletions: message: "You're deleting {n} features: {p} nodes, {l} lines, {a} areas, {r} relations. Are you sure you want to do this? This will delete them from the map that everyone else sees on openstreetmap.org." tag_suggests_area: message: "The tag {tag} suggests line should be area, but it is not an area." deprecated_tags: message: '{feature} has outdated tags: {tags}' - tooltip: Some tags become deprecated over time and should be replaced. + tip: Some tags become deprecated over time and should be replaced. generic_name: message: '{feature} has the generic name "{name}".' - tooltip: Names should be the official, on-the-ground titles of features. - building-building_crossing: - message: "{building} intersect {building1} on the same layer." - tooltip: "Buildings should not intersect except on separate layers." - building-highway_crossing: - message: "{highway} crosses {building} without a bridge, tunnel, or entrance." - tooltip: "Highways crossing buildings should be connected with an entrance or use separate layers." - building-railway_crossing: - message: "{railway} crosses {building} without a bridge or tunnel." - tooltip: "Railways crossing buildings should use separate layers." - building-water_crossing: - message: "{water} crosses {building} without a culvert." - tooltip: "Waterways crossing buildings should use separate layers." - highway-highway_crossing: - message: "{highway} crosses {highway2} without a bridge, tunnel, or intersection." - tooltip: "Crossing highways should be connected or use separate layers." - highway-railway_crossing: - message: "{highway} crosses {railway} without a bridge, tunnel, or level crossing." - tooltip: "Highways crossing railways should be connected or use separate layers." - highway-water_crossing: - message: "{highway} crosses {water} without a bridge, tunnel, or ford." - tooltip: "Highways crossing waterways should be connected with a ford or use separate layers." - railway-railway_crossing: - message: "{railway} crosses {railway2} without a bridge, tunnel, or connection." - tooltip: "Crossing railways should be connected or use separate layers." - railway-water_crossing: - message: "{railway} crosses {water} without a bridge or tunnel." - tooltip: "Railways crossing waterways should use separate layers." - water-water_crossing: - message: "{water} crosses {water2} without a culvert or connection." - tooltip: "Crossing waterways should be connected or use separate layers." + tip: Names should be the official, on-the-ground titles of features. crossing_ways: - message: Crossing ways without connection - tooltip: "Roads are crossing other roads, buildings, railroads, or waterways without connection nodes or a bridge tag." + message: "{feature} crosses {feature2} without enough context." + building-building: + tip: Buildings should not intersect except on separate layers. + building-highway: + tip: Highways crossing buildings should use bridges, tunnels, coverings, or entrances. + building-railway: + tip: Railways crossing buildings should use bridges or tunnels. + building-water: + tip: Waterways crossing buildings should use tunnels or separate layers. + highway-highway: + tip: Crossing highways should use bridges, tunnels, or intersections. + highway-railway: + tip: Highways crossing railways should use bridges, tunnels, or level crossings. + highway-water: + tip: Highways crossing water should use bridges, tunnels, or fords. + railway-railway: + tip: Crossing railways should be connected or use bridges or tunnels. + railway-water: + tip: Railways crossing water should use bridges or tunnels. + water-water: + tip: Crossing waterways should be connected or use tunnels. highway_almost_junction: message: "{highway} is very close but not connected to {highway2}." - tooltip: "Intersecting highways must share a junction vertex." + tip: Intersecting highways should share a junction vertex. fix: delete_feature: title: Delete this feature diff --git a/dist/locales/en.json b/dist/locales/en.json index 7775b2472..58ecbf2b2 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1394,15 +1394,15 @@ }, "disconnected_highway": { "message": "{highway} is disconnected from other highways.", - "tooltip": "Roads should be connected to other roads or building entrances." + "tip": "Roads should be connected to other roads or building entrances." }, "old_multipolygon": { "message": "{multipolygon} has misplaced tags.", - "tooltip": "Multipolygons should be tagged on their relation, not their outer way." + "tip": "Multipolygons should be tagged on their relation, not their outer way." }, "untagged_feature": { - "message": "{feature} has no tags.", - "tooltip": "Select a feature type that describes what this is." + "message": "{feature} has no descriptive tags.", + "tip": "Features must have tags that define what they are." }, "many_deletions": { "message": "You're deleting {n} features: {p} nodes, {l} lines, {a} areas, {r} relations. Are you sure you want to do this? This will delete them from the map that everyone else sees on openstreetmap.org." @@ -1412,59 +1412,48 @@ }, "deprecated_tags": { "message": "{feature} has outdated tags: {tags}", - "tooltip": "Some tags become deprecated over time and should be replaced." + "tip": "Some tags become deprecated over time and should be replaced." }, "generic_name": { "message": "{feature} has the generic name \"{name}\".", - "tooltip": "Names should be the official, on-the-ground titles of features." - }, - "building-building_crossing": { - "message": "{building} intersect {building1} on the same layer.", - "tooltip": "Buildings should not intersect except on separate layers." - }, - "building-highway_crossing": { - "message": "{highway} crosses {building} without a bridge, tunnel, or entrance.", - "tooltip": "Highways crossing buildings should be connected with an entrance or use separate layers." - }, - "building-railway_crossing": { - "message": "{railway} crosses {building} without a bridge or tunnel.", - "tooltip": "Railways crossing buildings should use separate layers." - }, - "building-water_crossing": { - "message": "{water} crosses {building} without a culvert.", - "tooltip": "Waterways crossing buildings should use separate layers." - }, - "highway-highway_crossing": { - "message": "{highway} crosses {highway2} without a bridge, tunnel, or intersection.", - "tooltip": "Crossing highways should be connected or use separate layers." - }, - "highway-railway_crossing": { - "message": "{highway} crosses {railway} without a bridge, tunnel, or level crossing.", - "tooltip": "Highways crossing railways should be connected or use separate layers." - }, - "highway-water_crossing": { - "message": "{highway} crosses {water} without a bridge, tunnel, or ford.", - "tooltip": "Highways crossing waterways should be connected with a ford or use separate layers." - }, - "railway-railway_crossing": { - "message": "{railway} crosses {railway2} without a bridge, tunnel, or connection.", - "tooltip": "Crossing railways should be connected or use separate layers." - }, - "railway-water_crossing": { - "message": "{railway} crosses {water} without a bridge or tunnel.", - "tooltip": "Railways crossing waterways should use separate layers." - }, - "water-water_crossing": { - "message": "{water} crosses {water2} without a culvert or connection.", - "tooltip": "Crossing waterways should be connected or use separate layers." + "tip": "Names should be the official, on-the-ground titles of features." }, "crossing_ways": { - "message": "Crossing ways without connection", - "tooltip": "Roads are crossing other roads, buildings, railroads, or waterways without connection nodes or a bridge tag." + "message": "{feature} crosses {feature2} without enough context.", + "building-building": { + "tip": "Buildings should not intersect except on separate layers." + }, + "building-highway": { + "tip": "Highways crossing buildings should use bridges, tunnels, coverings, or entrances." + }, + "building-railway": { + "tip": "Railways crossing buildings should use bridges or tunnels." + }, + "building-water": { + "tip": "Waterways crossing buildings should use tunnels or separate layers." + }, + "highway-highway": { + "tip": "Crossing highways should use bridges, tunnels, or intersections." + }, + "highway-railway": { + "tip": "Highways crossing railways should use bridges, tunnels, or level crossings." + }, + "highway-water": { + "tip": "Highways crossing water should use bridges, tunnels, or fords." + }, + "railway-railway": { + "tip": "Crossing railways should be connected or use bridges or tunnels." + }, + "railway-water": { + "tip": "Railways crossing water should use bridges or tunnels." + }, + "water-water": { + "tip": "Crossing waterways should be connected or use tunnels." + } }, "highway_almost_junction": { "message": "{highway} is very close but not connected to {highway2}.", - "tooltip": "Intersecting highways must share a junction vertex." + "tip": "Intersecting highways should share a junction vertex." }, "fix": { "delete_feature": { diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index 50e67bbba..6f10ae7f1 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -223,28 +223,34 @@ export function validationHighwayCrossingOtherWays(context) { var crossing = crosses[j]; // use the entities with the tags that define the feature type - var entities = _map(crossing.ways, function(way) { + var entities = crossing.ways.sort(function(entity1, entity2) { + var type1 = getFeatureTypeForCrossingCheck(entity1, graph); + var type2 = getFeatureTypeForCrossingCheck(entity2, graph); + if (type1 === type2) { + return utilDisplayLabel(entity1, context) > utilDisplayLabel(entity2, context); + } else if (type1 === 'water') { + return true; + } else if (type2 === 'water') { + return false; + } + return type1 < type2; + }); + entities = _map(entities, function(way) { return getFeatureWithFeatureTypeTagsForWay(way, graph); }); - entities = entities.sort(function(entity1, entity2) { - return utilDisplayLabel(entity1, context) > utilDisplayLabel(entity2, context); - }); - var crossingTypeID = crossing.featureTypes.sort().join('-') + '_crossing'; + var crossingTypeID = crossing.featureTypes.sort().join('-'); - var messageDict = {}; - messageDict[crossing.featureTypes[0]] = utilDisplayLabel(entities[0], context); - var key2 = crossing.featureTypes[1]; - if (crossing.featureTypes[0] === crossing.featureTypes[1]) { - key2 += '2'; - } - messageDict[key2] = utilDisplayLabel(entities[1], context); + var messageDict = { + feature: utilDisplayLabel(entities[0], context), + feature2: utilDisplayLabel(entities[1], context) + }; issues.push(new validationIssue({ type: ValidationIssueType.crossing_ways, severity: ValidationIssueSeverity.warning, - message: t('issues.'+crossingTypeID+'.message', messageDict), - tooltip: t('issues.'+crossingTypeID+'.tooltip'), + message: t('issues.crossing_ways.message', messageDict), + tooltip: t('issues.crossing_ways.'+crossingTypeID+'.tip'), entities: entities, info: {'ways': crossing.ways}, coordinates: crossing.cross_point, diff --git a/modules/validations/deprecated_tag.js b/modules/validations/deprecated_tag.js index 4eaa835c0..a588cbfe0 100644 --- a/modules/validations/deprecated_tag.js +++ b/modules/validations/deprecated_tag.js @@ -31,7 +31,7 @@ export function validationDeprecatedTag(context) { type: ValidationIssueType.deprecated_tags, severity: ValidationIssueSeverity.warning, message: t('issues.deprecated_tags.message', { feature: featureLabel, tags: tagsLabel }), - tooltip: t('issues.deprecated_tags.tooltip'), + tooltip: t('issues.deprecated_tags.tip'), entities: [change], hash: tagsLabel, info: { diff --git a/modules/validations/disconnected_highway.js b/modules/validations/disconnected_highway.js index c8efb4c9b..d06597a89 100644 --- a/modules/validations/disconnected_highway.js +++ b/modules/validations/disconnected_highway.js @@ -40,7 +40,7 @@ export function validationDisconnectedHighway(context) { type: ValidationIssueType.disconnected_highway, severity: ValidationIssueSeverity.warning, message: t('issues.disconnected_highway.message', {highway: entityLabel}), - tooltip: t('issues.disconnected_highway.tooltip'), + tooltip: t('issues.disconnected_highway.tip'), entities: [entity], })); } diff --git a/modules/validations/generic_name.js b/modules/validations/generic_name.js index fa2ec56e8..84e0050eb 100644 --- a/modules/validations/generic_name.js +++ b/modules/validations/generic_name.js @@ -56,7 +56,7 @@ export function validationGenericName(context) { type: ValidationIssueType.generic_name, severity: ValidationIssueSeverity.warning, message: t('issues.generic_name.message', {feature: preset.name(), name: generic}), - tooltip: t('issues.generic_name.tooltip'), + tooltip: t('issues.generic_name.tip'), entities: [change], fixes: [ new validationIssueFix({ diff --git a/modules/validations/highway_almost_junction.js b/modules/validations/highway_almost_junction.js index 46f151c1c..f68b2c2ba 100644 --- a/modules/validations/highway_almost_junction.js +++ b/modules/validations/highway_almost_junction.js @@ -152,7 +152,7 @@ export function validationHighwayAlmostJunction(context) { highway: utilDisplayLabel(endHighway, context), highway2: utilDisplayLabel(edgeHighway, context) }), - tooltip: t('issues.highway_almost_junction.tooltip'), + tooltip: t('issues.highway_almost_junction.tip'), entities: [endHighway, node, edgeHighway], coordinates: extendableNodes[j].node.loc, info: { diff --git a/modules/validations/issue_manager.js b/modules/validations/issue_manager.js index 88638cac4..00719487b 100644 --- a/modules/validations/issue_manager.js +++ b/modules/validations/issue_manager.js @@ -48,16 +48,17 @@ export function IssueManager(context) { var changes = context.history().changes(); var entitiesToCheck = changes.created.concat(changes.modified); + var graph = context.graph(); entitiesToCheck = _uniq(_flattenDeep(_map(entitiesToCheck, function(entity) { var entities = [entity]; if (entity.type === 'node') { // validate ways if their nodes have changed - entities = entities.concat(context.graph().parentWays(entity)); + entities = entities.concat(graph.parentWays(entity)); } entities = _map(entities, function(entity) { if (entity.type !== 'relation') { // validate relations if their geometries have changed - return [entity].concat(context.graph().parentRelations(entity)); + return [entity].concat(graph.parentRelations(entity)); } return entity; }); diff --git a/modules/validations/missing_tag.js b/modules/validations/missing_tag.js index 1f3d9d92a..f45bc6091 100644 --- a/modules/validations/missing_tag.js +++ b/modules/validations/missing_tag.js @@ -33,21 +33,21 @@ export function validationMissingTag(context) { type: ValidationIssueType.missing_tag, severity: ValidationIssueSeverity.error, message: t('issues.untagged_feature.message', {feature: entityLabel}), - tooltip: t('issues.untagged_feature.tooltip'), + tooltip: t('issues.untagged_feature.tip'), entities: [change], fixes: [ + new validationIssueFix({ + title: t('issues.fix.select_preset.title'), + action: function() { + context.ui().sidebar.showPresetList(); + } + }), new validationIssueFix({ title: t('issues.fix.delete_feature.title'), action: function() { var id = this.issue.entities[0].id; operationDelete([id], context)(); } - }), - new validationIssueFix({ - title: t('issues.fix.select_preset.title'), - action: function() { - context.ui().sidebar.showPresetList(); - } }) ] })); diff --git a/modules/validations/old_multipolygon.js b/modules/validations/old_multipolygon.js index 12f43a2e4..a7433a09b 100644 --- a/modules/validations/old_multipolygon.js +++ b/modules/validations/old_multipolygon.js @@ -24,7 +24,7 @@ export function validationOldMultipolygon(context) { type: ValidationIssueType.old_multipolygon, severity: ValidationIssueSeverity.warning, message: t('issues.old_multipolygon.message', {multipolygon: multipolygonLabel}), - tooltip: t('issues.old_multipolygon.tooltip'), + tooltip: t('issues.old_multipolygon.tip'), entities: [entity, mistaggedMultipolygon], fixes: [ new validationIssueFix({