Commit Graph

263 Commits

Author SHA1 Message Date
Bryan Housel efcd6b6bc2 Consolidate idle functions into idle.js, defer validation after merge 2019-04-12 10:49:21 -04:00
Bryan Housel 0dd262d1dd Don't dispatch 'change' on history.merged, dispatch 'merge' only
Change performs an expensive immediate redraw, and merge can schedule
a redraw for later.
2019-04-12 09:56:18 -04:00
Bryan Housel 35049ab40a Replace getErrors/getWarnings with getIssues/getIssuesBySeverity
The idea here is that the validator will now hold onto lots of issues,
but the calling code will only want some small subset of them
(edited/everything) (inview/everywhere) and can pass these as options
so that we don't need filtering code spread throughtout the app.
2019-04-11 14:48:23 -04:00
Bryan Housel 81127d71f3 Cache disabled() results in straighten action for consistent response
What could happen was:
- user could right click on a line
- this would trigger `disabled()` checks for each operation buttons
- the line was not fully downloaded, so would return `disabled()` 'not_downloaded'
  (and also start download of the missing tiles)
- then the tooltip would pop into existence, calling `tooltip()`
- which calls `disabled()` again
- but this time it's fine and the `disabled()` is false
- so you'd see a greyed out button but the tooltip said everyting is ok and
  you can click the button anyway

I fixed this by just caching the disabled test.  This is probably ok anyway
because these tests can be expensive, and then the user will see a consistent
message like "The line is not yet fully downloaded".

If the user clicks off the line and back onto it, iD will reenter select mode,
rebuild the menu, redo the disabled test, and they will see the button enabled.
2019-04-10 10:19:23 -04:00
Bryan Housel e30090996b Add loadTileAtLoc to fetch data tile for a specific location
(closes #4890)

This lets iD request needed tiles outside of the viewport, for example to
properly straighten lines or validate features that may have unloaded
connections.
2019-04-09 23:49:31 -04:00
Bryan Housel 95a1bbaf97 Add downloaded debug flag and visualization for tiles downloaded 2019-04-08 22:06:47 -04:00
Bryan Housel df1a2ea361 Prevent some actions on features that extend beyond the loaded map
(closes #2248)
2019-04-08 21:26:58 -04:00
Bryan Housel 207cbd30dc Pacify eslint 2019-04-08 12:33:19 -04:00
Bryan Housel 7556df7265 Make sure to return the current version of entity from tree.intersects
Since d5e427289, the tree head graph will not update if only tags have
changed - it requires an addition, deletion, or geometry change.

This makes the tree a little more efficient, but we do need to make
sure to return the current entities to the caller.
2019-04-08 12:28:02 -04:00
Bryan Housel 8d66289cba Run validation when switching fields, or when applying an issue fix 2019-04-07 23:10:20 -04:00
Bryan Housel e377270372 WIP: introduce validatedGraph, try on mode change not history change 2019-04-06 13:39:19 -04:00
Bryan Housel 1bcc0f613c WIP: fix caches, replace id() function with plain id property 2019-04-05 17:41:04 -04:00
Bryan Housel 78acd999c8 WIP: switch from validating everything to validating differences 2019-04-05 13:29:57 -04:00
Bryan Housel f17ebee402 Use Set, simplify util functions to collect entities with children 2019-04-05 11:05:04 -04:00
Bryan Housel 6508edf820 Avoid anonymous functions as validators
Givnig them names makes it easier to understand in the profiler
2019-04-05 09:50:22 -04:00
Bryan Housel 8b1c0551cc WIP: understand state held by the validator, avoid translations
- Make sure all state variables prefixed with `_`
- Add explicit `init`/`reset` methods
  (graph/entity refs should never persist through a save to OSM)
- Thinking of how best cache validation results
2019-04-05 09:28:36 -04:00
Bryan Housel d5e427289f Avoid delete/reinsert on the coreTree when not needed
(re: #6140)
2019-04-04 10:02:15 -04:00
Bryan Housel 86de378de5 Add didChange object to track what kind of things changed in the diff 2019-04-03 17:43:04 -04:00
Bryan Housel 561ffc402a Remove annotatedChange events (we'll replace with something else) 2019-04-03 11:56:56 -04:00
Bryan Housel 7c01e63efa Remove unnecessary cloning from history walkthrough stuff
(re: #6087)
2019-03-30 09:09:33 -04:00
Bryan Housel cda8f657ac Swap fast-deep-equal for lodash isEqual
(re: #6087)
2019-03-29 22:17:29 -04:00
Bryan Housel d5abe468b9 Remove rest of the lodash iterators: map, reduce, forEach
(re: #6087)
2019-03-29 15:14:21 -04:00
Bryan Housel 0d79e3e616 Remove lodash cloneDeep and forOwn from context.js
(re: #6087)

Tests in Phantom run twice as fast now!
2019-03-29 12:57:37 -04:00
Bryan Housel 4a8c20c56e Remove lodash forEach
(re: 6087)
2019-03-28 19:50:20 -04:00
Bryan Housel d18b951c67 Remove lodash flatten and flattenDeep
(re: #6087)
2019-03-28 10:04:46 -04:00
Quincy Morgan 6fb8fcb86b Make map pan to the location of the undone edit when undoing instead of the location of the edit before that (close #5831) 2019-03-27 18:02:21 -04:00
Bryan Housel 3d80e6505f Remove lodash chunk, groupBy
(re: #6087)
2019-03-27 16:18:41 -04:00
Bryan Housel 0edd10001e Removing more lodash: isEmpty, isNumber, some map/reduce/forEach
(re: #6087)
2019-03-27 13:32:35 -04:00
Bryan Housel 5b4aa529de Replace lodash uniq
(re: 6087)
2019-03-27 02:43:25 -04:00
Bryan Housel 5e1ff74199 Replace lodash difference, intersects, union
(re: 6087)
2019-03-27 01:22:11 -04:00
Bryan Housel 4821bf0a68 Remove lodash omit
(re: #6087)
2019-03-26 14:12:45 -04:00
Bryan Housel 5b9707004f Remove lodash includes from graph, switch parentWays/parentRels to Set
(re: #6087)
2019-03-26 11:55:38 -04:00
Bryan Housel 9e4cf126c3 Remove unneeded utilGetPrototypeOf and just use Object.getPrototypeOf 2019-03-25 22:16:58 -04:00
Bryan Housel 1ce4f0ad6a Remove lodash without
(re: #6087)
2019-03-25 21:56:54 -04:00
Bryan Housel daaab30d13 Add workaround for Array.from when running in PhantomJS
https://github.com/openstreetmap/iD/issues/6087#issuecomment-476219308

Also added `npm run phantom` to test workarounds like this quickly
2019-03-25 12:47:55 -04:00
Bryan Housel b5c2918a24 Remove lodash without and others from history imageryUsed
(re: #6087)

I ran into some trouble here, it looks like `Array.from()` polyfill
doesn't work for Sets in PhantomJS
2019-03-24 01:50:54 -04:00
Bryan Housel 5280d07bad Remove lodash reject (re: #6087) 2019-03-23 12:51:13 -04:00
Bryan Housel 76e0d13729 Remove lodash every and filter
(re: #6087)
2019-03-23 01:22:56 -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 4addd0e216 Add presets for basic indoor features (close #6082)
Don't use deprecated presets to determine area keys
2019-03-22 11:40:03 -04:00
Quincy Morgan 9d940fffdb Fix issue where untagged multipolygon member lines would render as lines instead of area edges
Show recents in the ribbon again
2019-03-20 15:05:35 -04:00
Quincy Morgan 7d0080a642 Persist the photo overlay layers via the URL query string (re: #5813) 2019-03-14 16:48:08 -04:00
Quincy Morgan c65a4d038e Add photo overlay filter options for hiding flat and pano photos (close #5433) 2019-03-14 14:24:21 -04:00
Quincy Morgan 213d0ee3e8 Move preset favoriting functions from core/context.js to presets/index.js
Make recent presets persistent and compatible with favorite presets
2019-03-07 16:49:29 -05:00
Quincy Morgan ba185d2ee6 Make Point, Line, and Area the default favorite presets 2019-03-07 13:32:14 -05:00
Quincy Morgan efac17810c Check for valid indices when reordering favorites 2019-03-07 11:22:19 -05:00
Quincy Morgan c3d1dc43d4 Add valid geometry check for saved favorite presets 2019-03-07 11:17:41 -05:00
Quincy Morgan a38da25dc4 RTL layout support for previous commit
Add check to make sure saved favorite presets are valid
2019-03-07 11:16:01 -05:00
Quincy Morgan 78590466ba Merge branch 'master' into add-feature-search-bar 2019-03-06 15:50:31 -05:00