198 Commits

Author SHA1 Message Date
Martin Raifer
aa96a67c65 use lodash-es everywhere, replace custom clamp methods with lodash 2025-04-21 14:43:35 +02:00
Martin Raifer
79362ea7a8 filter empty strings from preset aliases 2025-03-17 14:01:11 +01:00
Martin Raifer
74dc459a4a drop unused import 2025-03-17 12:12:26 +01:00
Martin Raifer
8b1c37bdaf take location into account for default values from regional fields 2025-03-17 11:33:42 +01:00
Martin Raifer
78f94632d7 don't inherit fields for tags that the preset already has a field for
this is useful if a preset wants to inherit some fields from another preset, but wants to replace some of the fields with special versions of the field (e.g. a `…_yes` field for an added default value), or to change the `fields`/`moreFields` classification of a field
2025-03-17 11:33:42 +01:00
Kyle Hensel
c3c0e23ba8 fix unsolvable validator error for presets with locationSet 2024-09-09 20:57:26 +10:00
Martin Raifer
8274384311 Fix validator suggesting to add empty *:wikipedia tags to NSI presets (fixes #10140) 2024-02-29 10:30:18 +01:00
Martin Raifer
4829f8a1da drop *:wikipedia tags when selecting a NSI-based, fixes #9103 2024-02-16 14:32:58 +01:00
Martin Raifer
b00a7e31ec don't consider traffic_calming features as areas
prerequisite for https://github.com/openstreetmap/id-tagging-schema/pull/1076
2024-01-24 13:48:29 +01:00
Kyℓe Hensel
53a510628c fix crash when selecting some presets (#9738) 2023-07-07 15:15:15 +02:00
Martin Raifer
5a3a2d876e show inherited fields from global parents
fixes regression from 43784e2ef
2023-05-26 19:44:27 +02:00
Martin Raifer
43784e2eff take entity loc into account when resolving fields via parent preset, fixes #9524
this necessary when a regional preset (e.g. from NSI) is supposed to inherit fields from a parent preset, but the direct parent does NOT apply at the location of the entity to be added/edited. In that case we need to search for a potential regional variant of the parent preset.
2023-05-25 19:19:09 +02:00
Martin Raifer
dc9b6a3acb only treat traffic_calming=island as an area tag
this is required for a proper fix of https://github.com/openstreetmap/id-tagging-schema/issues/733
2023-01-18 19:15:16 +01:00
Martin Raifer
5f1360ed0f don't suggest to "connect the ends" if a feature with area tags matches a line preset
For example, when a feature tagged as `highway=primary` (line preset) and `man_made=bridge` (area preset) is mapped as an unclosed way, converting it to an area (by closing the way by connecting the endpoints) does not improve the situation, as then the other tag doesn't fit to the geometry anymore.

closes #7037
2022-11-04 12:23:15 +01:00
Martin Raifer
58f597165b match shortest possible name or alias when sorting presets
improves preset matching in cases like https://github.com/openstreetmap/id-tagging-schema/issues/632
2022-11-04 10:06:20 +01:00
Bryan Housel
2b2a71f597 Don't pre-resolve and index complex locationSets into GeoJSON.
This was taking a lot of time at app startup.

Instad now we resolve and index only the include and exclude parts.
We can still determine the valid locationSets at runtime in `locationSetsAt()`
by checking the `_locationIncludedIn` and `_locationExcludedIn` caches.

This also upgrades the locationManger to an ES6 class.

This also includes some hacky code in nsi.js so that the NSI will continue to work.
The NSI matcher can build its own location index, but it doesn't need to do this.
We monkeypatch a few of the matcher collections to work with the new LocationManager.
2022-10-28 10:49:01 -04:00
Martin Raifer
dd30a39d74 fix logic bug, extend test coverage 2022-10-27 17:07:32 +02:00
Martin Raifer
96bac0650b on preset change: don't drop tags if ∃ a matching field in the new preset
closes #9341
closes #9104
2022-10-27 13:06:00 +02:00
Martin Raifer
674421eec7 implement fetching string references
see https://github.com/openstreetmap/id-tagging-schema/pull/598
2022-10-07 12:04:23 +02:00
Martin Raifer
aee8258570 fix tests 2022-09-23 19:18:10 +02:00
Martin Raifer
e9eb0a0b3a include matching preset of selected object in preset selection list
see https://github.com/openstreetmap/iD/issues/9298#issuecomment-1250929094
2022-09-23 15:12:22 +02:00
Martin Raifer
4f34e28431 don't return hidden presets in recent 2022-09-23 15:07:56 +02:00
Martin Raifer
209cc23d92 don't inject html code in preset names 2022-06-24 19:11:00 +02:00
Martin Raifer
9576e95d83 change label of ui fields from raw html to a callback function
fixes #9159
2022-06-23 10:49:38 +02:00
Martin Raifer
8f79932ab1 prevent html injection in combobox dopdowns
and use returned wikidata label language for html `lang` metadata
2022-06-06 12:47:14 +02:00
Martin Raifer
4a55249dee fix code style issues 2022-05-25 13:45:55 +02:00
Martin Raifer
29d4ab6866 search presets by tag "key=value" syntax
closes #8869
2022-05-25 10:58:08 +02:00
Martin Raifer
d486ab197d sort preset search results by matching aliases, add tests 2022-05-25 10:25:29 +02:00
Martin Raifer
8796a412f8 support aliases in preset search
closes #6139
2022-05-24 17:15:01 +02:00
Martin Raifer
2ca52e75ce Do not overwrite existing *=no tags by a preset's addTags 2022-05-24 14:18:17 +02:00
Martin Raifer
04a07092d2 Handle more "hybrid" area+line tags as area-by-default, fixes #8985 2022-02-16 15:56:28 +01:00
Martin Raifer
09d98b7095 slighty penalize non-searchable presets
as a tie-breaker in case a searchable preset also matches the same object,
see https://github.com/openstreetmap/id-tagging-schema/issues/399#issuecomment-1039902506
2022-02-15 12:25:27 +01:00
Milos Brzakovic (E-Search)
18f7e91b50 matchTags - improve indexing data structure 2021-10-25 12:10:20 +02:00
Milos Brzakovic (E-Search)
dee8cdfe07 matchTags- don't do locationsAt if locID is +Q2 2021-10-21 11:03:44 +02:00
Milos Brzakovic (E-Search)
599d2df19b matchTags - don't calculcate valid locations unless needed
mismatched_geometry - small optimization
2021-10-20 09:49:00 +02:00
Bryan Housel
ec787f81ad Location-aware preset matching 2021-03-23 12:39:14 -04:00
Bryan Housel
3cf5f69082 Allow missing locationSetID on presets, fields, categories
This simplifies the code a bit, just treat it as worldwide if missing
2021-03-12 12:27:50 -05:00
Bryan Housel
f95e7db8c9 Create the categories like the presets
The lack of locationSet was causing them to not show up, which indirectly
broke the tutorial at the step where user needs to pick the road category.
2021-03-12 12:04:52 -05:00
Bryan Housel
4228b65602 Support more *:wikidata tags for field locking and pin styling 2021-01-18 17:18:37 -05:00
Bryan Housel
f39f73e3ae Make sure suggestion preset terms get used in the search 2021-01-18 15:02:07 -05:00
Bryan Housel
868db8819f Have mergeLocationSets work on Objects, add locationSetID property
This means less work for the other parts of the code,
now they don't need to chain that extra step after the promise.
2021-01-09 10:34:58 -05:00
Bryan Housel
271e1c2e19 Use locationManager to filter fields/presets/defaults 2021-01-08 16:06:57 -05:00
Bryan Housel
0ad7de0f10 Move the location index and resolver into a global coreLocations 2021-01-08 11:29:51 -05:00
Bryan Housel
9eb6f8781f Update presetIndex to resolve and index locationSets
Added a deferred work queue to do this with requestIdleCallback in the background
2021-01-06 16:26:12 -05:00
Quincy Morgan
af4acaec79 Don't clear power output tag when changing between power presets (close #8159) 2020-12-21 13:17:18 -05:00
Quincy Morgan
6cd81df1a2 Fix preset search result sorting (re: #8242) 2020-12-21 11:26:34 -05:00
Quincy Morgan
2591a13f9c Honor diacritics on preset search value but still compare to stripped preset names (re: #8242) 2020-12-21 11:14:10 -05:00
Quincy Morgan
d57ed85e98 Merge branch develop 2020-12-16 11:43:36 -05:00
Quincy Morgan
b3ad282f40 Ignore diacritics when searching presets (close #8242) 2020-12-09 17:12:43 -05:00
Quincy Morgan
cb7f1c2b3c Update to id-tagging-schema v3.0.0
Add UI for translatable combo fields
2020-12-08 15:23:51 -05:00