From c11b661ef344dded9497790a794db0f582e4fbad Mon Sep 17 00:00:00 2001 From: Martin Raifer Date: Thu, 15 May 2025 11:24:05 +0200 Subject: [PATCH] fix oneway field showing "Assumed to be Yes" if cycled through MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …back to the default state. This was a slight regression from the refactoring in #10730: In an intermeditate step, the entity has `oneway=yes`, which should actually be ignored when determining if an entity has an implicit oneway state. --- CHANGELOG.md | 1 + modules/ui/fields/check.js | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04cb4d714..ccf5cdf59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :white_check_mark: Validation #### :bug: Bugfixes * Refresh numeric input fields after leaving focus with the value that is stored in the tag ([#11027]) +* Fix oneway field falsely showing "Assumed to be Yes" if cycled through all options back to the default state #### :earth_asia: Localization #### :hourglass: Performance #### :mortar_board: Walkthrough / Help diff --git a/modules/ui/fields/check.js b/modules/ui/fields/check.js index 378b9f0eb..2556e35d2 100644 --- a/modules/ui/fields/check.js +++ b/modules/ui/fields/check.js @@ -1,13 +1,15 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; - import { select as d3_select } from 'd3-selection'; +import { omit } from 'lodash-es'; import { utilRebind } from '../../util/rebind'; import { t } from '../../core/localizer'; import { actionReverse } from '../../actions/reverse'; import { svgIcon } from '../../svg/icon'; +import { utilCheckTagDictionary } from '../../util'; +import { osmOneWayTags } from '../../osm/tags'; export { uiFieldCheck as uiFieldDefaultCheck }; export { uiFieldCheck as uiFieldOnewayCheck }; @@ -60,7 +62,7 @@ export function uiFieldCheck(field, context) { // where implied oneway tag exists (e.g. `junction=roundabout`) #2220, #1841 if (field.id === 'oneway') { var entity = context.entity(_entityIDs[0]); - if (entity.type === 'way' && entity.isOneWay()) { + if (entity.type === 'way' && !!utilCheckTagDictionary(entity.tags, omit(osmOneWayTags, 'oneway'))) { _impliedYes = true; texts[0] = t.html('_tagging.presets.fields.oneway_yes.options.undefined'); }