mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Added entity display name or preset name to the disconnected highway message
This commit is contained in:
@@ -623,7 +623,7 @@ en:
|
||||
on_wiki: "{tag} on wiki.osm.org"
|
||||
used_with: "used with {type}"
|
||||
validations:
|
||||
disconnected_highway: Disconnected highway
|
||||
disconnected_highway: "{entityLabel} is disconnected from other highways."
|
||||
disconnected_highway_tooltip: "Roads should be connected to other roads or building entrances."
|
||||
old_multipolygon: Multipolygon tags on outer way
|
||||
old_multipolygon_tooltip: "This style of multipolygon is deprecated. Please assign the tags to the parent multipolygon instead of the outer way."
|
||||
|
||||
2
dist/locales/en.json
vendored
2
dist/locales/en.json
vendored
@@ -760,7 +760,7 @@
|
||||
"used_with": "used with {type}"
|
||||
},
|
||||
"validations": {
|
||||
"disconnected_highway": "Disconnected highway",
|
||||
"disconnected_highway": "{entityLabel} is disconnected from other highways.",
|
||||
"disconnected_highway_tooltip": "Roads should be connected to other roads or building entrances.",
|
||||
"old_multipolygon": "Multipolygon tags on outer way",
|
||||
"old_multipolygon_tooltip": "This style of multipolygon is deprecated. Please assign the tags to the parent multipolygon instead of the outer way.",
|
||||
|
||||
@@ -282,7 +282,7 @@ export function coreHistory(context) {
|
||||
|
||||
validate: function(changes) {
|
||||
return _flatten(_map(Validations, function(fn) {
|
||||
return fn()(changes, _stack[_index].graph);
|
||||
return fn(context)(changes, _stack[_index].graph);
|
||||
}));
|
||||
},
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { t } from '../util/locale';
|
||||
import { utilDisplayName } from '../util';
|
||||
|
||||
|
||||
export function validationDisconnectedHighway() {
|
||||
export function validationDisconnectedHighway(context) {
|
||||
|
||||
function isDisconnectedHighway(entity, graph) {
|
||||
if (!entity.tags.highway) return false;
|
||||
@@ -28,9 +29,18 @@ export function validationDisconnectedHighway() {
|
||||
var entity = changes.created[i];
|
||||
|
||||
if (isDisconnectedHighway(entity, graph)) {
|
||||
var entityLabel = utilDisplayName(entity);
|
||||
if (!entityLabel) {
|
||||
var preset = context.presets().match(entity, graph);
|
||||
if (preset && preset.name()) {
|
||||
entityLabel = preset.name();
|
||||
} else {
|
||||
entityLabel = utilDisplayType(entity.id)
|
||||
}
|
||||
}
|
||||
warnings.push({
|
||||
id: 'disconnected_highway',
|
||||
message: t('validations.disconnected_highway'),
|
||||
message: t('validations.disconnected_highway', {entityLabel: entityLabel}),
|
||||
tooltip: t('validations.disconnected_highway_tooltip'),
|
||||
entity: entity
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user