Commit Graph

27 Commits

Author SHA1 Message Date
Bryan Housel
e3e7cd3003 Memoize presetCollection.item (it's an Array.find)
Also add tests for `matchAllGeometry`
2020-02-05 10:32:20 -05:00
Bryan Housel
0fe766d9a4 WIP on external presets
- preset data is no longer bundled into iD.js
- some code pathways commented out re: external presets
- many changes so that tests can run without presets at start, or async
- still need to make sure fallbacks are always there (point, line, area, etc)
2020-02-05 09:38:26 -05:00
Quincy Morgan
6bb2997306 Enable changing the preset of multiple selected features (re: #7276)
Fix issue where preset tag reference wouldn't load
Change "Change feature" tooltip to more accurate "Change feature type"
2020-01-21 15:19:51 -05:00
Quincy Morgan
8b1c9fe323 Add notCountryCodes presets property to blacklist certain presets from certain countries
Show "Cycle & Foot Path" preset in all countries except France (re: #6836)
2019-09-17 13:54:59 -04:00
Bryan Housel
b09b43f6d3 Trim the user's string when preset searching
(closes #6383)
2019-05-19 21:37:09 -04:00
Quincy Morgan
b12e7277df Add countryCodes property to preset schema
Copy countryCodes from name suggestion index
Use countryCodes to filter the preset search results (close #6124)
2019-03-28 11:44:05 -04:00
Bryan Housel
5b4aa529de Replace lodash uniq
(re: 6087)
2019-03-27 02:43:25 -04:00
Bryan Housel
1ce4f0ad6a Remove lodash without
(re: #6087)
2019-03-25 21:56:54 -04:00
Bryan Housel
7e6f68a1b2 Remove lodash some
(re: #6087)
2019-03-23 00:07:52 -04:00
Bryan Housel
ff4f8f005f Remove lodash find and findIndex
(re: #6087)
2019-03-22 17:31:41 -04:00
Bryan Housel
11bfeaabfc Add browser-polyfills, remove lodash assign, compact, values
(re: #6087)
2019-03-22 17:14:41 -04:00
Quincy Morgan
7e92f6aa89 Combine vertex and point geometries into a single Point fallback preset 2019-03-18 12:36:20 -04:00
Quincy Morgan
d99fe79b6e Always show generic presets when searching 2019-03-04 17:47:20 -05:00
Quincy Morgan
4a82604cab Add search-to-add functionality 2019-02-28 15:00:00 -05:00
Bryan Housel
17bbc3d5a2 Slightly improve suggestion placement, preset search performance
- avoid lodash _filter when native filter is ok for arrays
- for suggestions use `originalName` instead of adding/removing the en-dash
- bump up importance of leading suggestions, but do a strict leading search

more on that last point:
For normal presets, we count a string as leading if it follows a space.
e.g. "office" will match "Law Office"
We don't really want this for suggestion presets though
e.g. "bell" should not match "Taco Bell"
2019-01-29 21:56:23 -05:00
Max Grossman
8f33a85a12 make collection.index function to handle failing tests 2018-12-17 17:16:10 -05:00
Bryan Housel
622621ca89 Improve suggestion combo behavior in the name field
- adds minItems(1) so it will match
- displays up to 10 suggestions
- correctly removes old tags by setting the `undefined`
- adjust the name distance scoring
- only shows name suggestions if the preset can benefit from them
  (i.e. a generic/fallback or a preset that has some suggestions in the index)
2018-11-21 11:15:03 -05:00
Bryan Housel
d53e473474 Convert lodah-es and d3 to named imports for presets 2017-09-25 14:20:24 -04:00
Bryan Housel
0d35c5ed59 Give preset priority in preset list when search matches name exactly
(closes #4325)
2017-09-10 12:56:14 -04:00
Bryan Housel
87618f9a6b Make it so preset.init() can be called again to reset the datastructures
(this is mostly so I can reset recent.collection for the walkthrough)
2017-04-11 22:34:02 -04:00
Bryan Housel
5e7919e78c Consider matchScore when sorting the preset list 2017-03-12 19:01:15 -04:00
Bryan Housel
3102a4ae6a Rename all the things to include pseudonamespaces 2016-10-04 19:06:20 -04:00
Tom MacWright
604d1e2719 import lodash (#3257) 2016-07-19 12:04:16 -04:00
Bryan Housel
0b3df36da0 Replace diacritics when doing fuzzy searches
(closes #3159)
2016-07-07 23:54:00 -04:00
Kushan Joshi
25485c40fb external modules for presets 2016-06-22 12:34:43 +05:30
Kushan Joshi
320434e8bb Add internal modules to preset 2016-06-22 12:34:43 +05:30
Beau Gunderson
4dbce64b7d migrate presets to ES6 modules for #3118 2016-06-14 20:44:05 -07:00