diff --git a/data/core.yaml b/data/core.yaml index 873bda8d5..4b4f60dea 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -23,7 +23,7 @@ en: undo_redo: Undo / Redo recent: Recent favorites: Favorites - add_feature: Add Feature + add_feature: Add Features title: format: context: "{base} – {context}" @@ -42,8 +42,8 @@ en: description: "Add highways, streets, pedestrian paths, canals or other lines to the map." filter_tooltip: lines add_point: - title: Point - description: "Add restaurants, monuments, postal boxes or other points to the map." + title: Add ALPR + description: "Add an ALPR" filter_tooltip: points add_note: title: Note @@ -57,6 +57,7 @@ en: description: Pan and zoom the map. drag_node: connected_to_hidden: This can't be edited because it is connected to a hidden feature. + editing_existing_not_allowed: Moving existing features is not allowed. operations: _unavailable: Cannot perform “{operation}” on currently selected features. diff --git a/modules/actions/delete_node.js b/modules/actions/delete_node.js index 402fe0cfe..adbd7b7e4 100644 --- a/modules/actions/delete_node.js +++ b/modules/actions/delete_node.js @@ -7,6 +7,11 @@ export function actionDeleteNode(nodeId) { var action = function(graph) { var node = graph.entity(nodeId); + // Prevent deletion of existing nodes (anti-vandalism) + if (node.version) { + throw new Error('Deletion of existing features is not allowed.'); + } + graph.parentWays(node) .forEach(function(parent) { parent = parent.removeNode(nodeId); diff --git a/modules/modes/drag_node.js b/modules/modes/drag_node.js index b229868ce..1334f9b1e 100644 --- a/modules/modes/drag_node.js +++ b/modules/modes/drag_node.js @@ -130,8 +130,9 @@ export function modeDragNode(context) { function start(d3_event, entity) { _wasMidpoint = entity.type === 'midpoint'; var hasHidden = context.features().hasHiddenConnections(entity, context.graph()); - _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden; - + var isNewFeature = !entity.version; + // var isALPR = entity.tags && entity.tags['surveillance:type'] === 'ALPR'; // Allow ALPR editing + _isCancelled = !context.editable() || d3_event.shiftKey || hasHidden || !isNewFeature; if (_isCancelled) { if (hasHidden) { @@ -139,6 +140,11 @@ export function modeDragNode(context) { .duration(4000) .iconName('#iD-icon-no') .label(t.append('modes.drag_node.connected_to_hidden'))(); + } else if (!isNewFeature) { + context.ui().flash + .duration(4000) + .iconName('#iD-icon-no') + .label(t.append('modes.drag_node.editing_existing_not_allowed'))(); } return drag.cancel(); } diff --git a/modules/ui/tools/modes.js b/modules/ui/tools/modes.js index 890fd9047..3f04f8856 100644 --- a/modules/ui/tools/modes.js +++ b/modules/ui/tools/modes.js @@ -59,7 +59,6 @@ export function uiToolDrawModes(context) { var wrap = selection .append('div') - .attr('class', 'joined') .style('display', 'flex'); var debouncedUpdate = _debounce(update, 500, { leading: true, trailing: true });