diff --git a/CHANGELOG.md b/CHANGELOG.md index f1d47f0a1..93d8e98a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,8 +61,10 @@ _Breaking developer changes, which may affect downstream projects or sites that #### :rocket: Presets * Don't inherit fields which the current preset already has a dedicated field for * Take location into account when setting a presets default values from regional fields +* Roads with `motorroad=yes` show implied access restrictions (`foot=no`, `bicycle=no`, `horse=no`) ([id-tagging-schema#609], [#9333]) #### :hammer: Development +[#9333]: https://github.com/openstreetmap/iD/pull/9333 [#10299]: https://github.com/openstreetmap/iD/issues/10299 [#10392]: https://github.com/openstreetmap/iD/issues/10392 [#10394]: https://github.com/openstreetmap/iD/pull/10394 @@ -71,6 +73,7 @@ _Breaking developer changes, which may affect downstream projects or sites that [#10843]: https://github.com/openstreetmap/iD/pull/10843 [#10852]: https://github.com/openstreetmap/iD/issues/10852 [#10885]: https://github.com/openstreetmap/iD/issues/10885 +[id-tagging-schema#609]: https://github.com/openstreetmap/id-tagging-schema/issues/609 [@0xatulpatil]: https://github.com/0xatulpatil [@MohamedAli00949]: https://github.com/MohamedAli00949 diff --git a/modules/ui/fields/access.js b/modules/ui/fields/access.js index 0693252af..576f9a113 100644 --- a/modules/ui/fields/access.js +++ b/modules/ui/fields/access.js @@ -312,12 +312,19 @@ export function uiFieldAccess(field, context) { if (tags[accessField]) { return tags[accessField]; } + // implied access + // motorroad: https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions + if (tags.motorroad === 'yes' && (accessField === 'foot' || accessField === 'bicycle' || accessField === 'horse')) { + return 'no'; + } + // inherited access if (tags.vehicle && (accessField === 'bicycle' || accessField === 'motor_vehicle')) { return tags.vehicle; } if (tags.access) { return tags.access; } + // default access by road/barrier type for (const key in placeholdersByTag) { if (tags[key]) { if (placeholdersByTag[key][tags[key]] && diff --git a/test/spec/ui/fields/access.js b/test/spec/ui/fields/access.js index af7d13fbd..049bb1fc0 100644 --- a/test/spec/ui/fields/access.js +++ b/test/spec/ui/fields/access.js @@ -121,6 +121,16 @@ describe('iD.uiFieldAccess', function() { expect(selection.selectAll('.preset-input-access-bicycle').attr('placeholder')).to.equal('destination'); }); + it('sets foot, bicycle and horse placeholder to "no" when there a "motorroad=yes" tag (#9333)', function() { + var access = iD.uiFieldAccess(field, context); + selection.call(access); + + access.tags({highway: 'primary', motorroad: 'yes'}); + expect(selection.selectAll('.preset-input-access-foot').attr('placeholder')).to.equal('no'); + expect(selection.selectAll('.preset-input-access-bicycle').attr('placeholder')).to.equal('no'); + expect(selection.selectAll('.preset-input-access-horse').attr('placeholder')).to.equal('no'); + }); + it('sets correct placeholder on a multi selection', function() { var access = iD.uiFieldAccess(field, context); selection.call(access);