mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
Clarify wording of old_multipolygon issue and tooltip
Add quick fix for old_multipolygon issue
This commit is contained in:
+5
-2
@@ -1152,8 +1152,8 @@ en:
|
||||
message: "{highway} is disconnected from other highways."
|
||||
tooltip: "Roads should be connected to other roads or building entrances."
|
||||
old_multipolygon:
|
||||
message: Multipolygon tags on outer way
|
||||
tooltip: "This style of multipolygon is deprecated. Please assign the tags to the parent multipolygon instead of the outer way."
|
||||
message: "{multipolygon} has misplaced tags."
|
||||
tooltip: "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."
|
||||
@@ -1221,6 +1221,9 @@ en:
|
||||
remove_name:
|
||||
title: Remove the name
|
||||
undo_redo: Removed a generic name.
|
||||
move_tags:
|
||||
title: Move the tags
|
||||
undo_redo: Moved tags.
|
||||
intro:
|
||||
done: done
|
||||
ok: OK
|
||||
|
||||
Vendored
+6
-2
@@ -1397,8 +1397,8 @@
|
||||
"tooltip": "Roads should be connected to other roads or building entrances."
|
||||
},
|
||||
"old_multipolygon": {
|
||||
"message": "Multipolygon tags on outer way",
|
||||
"tooltip": "This style of multipolygon is deprecated. Please assign the tags to the parent multipolygon instead of the outer way."
|
||||
"message": "{multipolygon} has misplaced tags.",
|
||||
"tooltip": "Multipolygons should be tagged on their relation, not their outer way."
|
||||
},
|
||||
"untagged_feature": {
|
||||
"message": "{feature} has no tags.",
|
||||
@@ -1490,6 +1490,10 @@
|
||||
"remove_name": {
|
||||
"title": "Remove the name",
|
||||
"undo_redo": "Removed a generic name."
|
||||
},
|
||||
"move_tags": {
|
||||
"title": "Move the tags",
|
||||
"undo_redo": "Moved tags."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -101,9 +101,12 @@ export function uiEntityIssues(context) {
|
||||
|
||||
issue.select('.label')
|
||||
.on('click', function() {
|
||||
context.map().centerZoomEase(d.loc(), Math.max(context.map().zoom(), 18));
|
||||
if (list.style('display') === 'none') {
|
||||
list.style('display', 'block');
|
||||
var loc = d.loc();
|
||||
if (loc) {
|
||||
context.map().centerZoomEase(loc, Math.max(context.map().zoom(), 18));
|
||||
}
|
||||
} else {
|
||||
list.style('display', 'none');
|
||||
}
|
||||
|
||||
@@ -130,7 +130,10 @@ export function uiIssues(context) {
|
||||
.placement('bottom')
|
||||
)
|
||||
.on('click', function(d) {
|
||||
context.map().centerZoomEase(d.loc(), Math.max(context.map().zoom(), 18));
|
||||
var loc = d.loc();
|
||||
if (loc) {
|
||||
context.map().centerZoomEase(loc, Math.max(context.map().zoom(), 18));
|
||||
}
|
||||
if (d.entities) {
|
||||
context.enter(modeSelect(
|
||||
context,
|
||||
|
||||
@@ -1,25 +1,49 @@
|
||||
import { t } from '../util/locale';
|
||||
import { osmIsSimpleMultipolygonOuterMember } from '../osm';
|
||||
import { utilDisplayLabel } from '../util';
|
||||
import {
|
||||
ValidationIssueType,
|
||||
ValidationIssueSeverity,
|
||||
validationIssue,
|
||||
validationIssueFix
|
||||
} from './validation_issue';
|
||||
import {
|
||||
actionChangeTags
|
||||
} from '../actions';
|
||||
|
||||
export function validationOldMultipolygon() {
|
||||
export function validationOldMultipolygon(context) {
|
||||
|
||||
return function validation(changes, graph) {
|
||||
var issues = [];
|
||||
for (var i = 0; i < changes.created.length; i++) {
|
||||
var entity = changes.created[i];
|
||||
var parent = osmIsSimpleMultipolygonOuterMember(entity, graph);
|
||||
if (parent) {
|
||||
var mistaggedMultipolygon = osmIsSimpleMultipolygonOuterMember(entity, graph);
|
||||
if (mistaggedMultipolygon) {
|
||||
var multipolygonLabel = utilDisplayLabel(mistaggedMultipolygon, context);
|
||||
issues.push(new validationIssue({
|
||||
type: ValidationIssueType.old_multipolygon,
|
||||
severity: ValidationIssueSeverity.warning,
|
||||
message: t('issues.old_multipolygon.message'),
|
||||
message: t('issues.old_multipolygon.message', {multipolygon: multipolygonLabel}),
|
||||
tooltip: t('issues.old_multipolygon.tooltip'),
|
||||
entities: [parent],
|
||||
entities: [entity, mistaggedMultipolygon],
|
||||
fixes: [
|
||||
new validationIssueFix({
|
||||
title: t('issues.fix.move_tags.title'),
|
||||
action: function() {
|
||||
var outerWay = this.issue.entities[0];
|
||||
var multipolygon = this.issue.entities[1];
|
||||
context.perform(
|
||||
function(graph) {
|
||||
multipolygon = multipolygon.mergeTags(outerWay.tags);
|
||||
graph = graph.replace(multipolygon);
|
||||
graph = actionChangeTags(outerWay.id, {})(graph);
|
||||
return graph;
|
||||
},
|
||||
t('issues.fix.move_tags.undo_redo')
|
||||
);
|
||||
}
|
||||
})
|
||||
]
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user