Commit Graph

122 Commits

Author SHA1 Message Date
Quincy Morgan 60f7dc7c0b Replace presets property of context with singleton
Remove utilPreset
2020-04-01 13:08:45 -07:00
Quincy Morgan a1af118f0e Ensure locales and presets are loaded before the UI loads (close #7406)
Consolidate localization behavior and init to a coreLocalizer function and singleton
Explicitly support `en-US` locale
Rename coreData to coreFileFetcher and export a singleton rather than using a property of coreContext
Add `apiConnections` property of coreContext to simplify adding a source switcher
Replace some init functions with re-callable, promise-supporting `ensureLoaded` functions
Make coreContext itself load the UI if a container has been specified at init time
Fix code tests
2020-03-31 12:23:31 -07:00
Quincy Morgan da882c1e80 Don't reselect trivial points after merging 2020-03-23 13:23:40 -07:00
Quincy Morgan 5125c04a58 Fix issue where merging a point matching a fallback preset into an area could discard tag values (close #7446) 2020-03-23 12:47:14 -07:00
Quincy Morgan 6087aae21f Remove map convenience functions of context 2020-03-22 10:57:17 -07:00
Quincy Morgan 73d8a7f4b0 Fix code test 2020-03-21 14:32:46 -07:00
Quincy Morgan 3c0b926ec7 Replace coreContext.geometry function with a more explicit coreGraph.geometry function 2020-03-21 14:23:44 -07:00
Quincy Morgan 1041f89716 Fix line continuing 2020-03-16 13:43:24 -07:00
Bryan Housel 13ead25654 Merge branch 'external_presets' into 2.x
(re: #4994)
2020-02-05 21:32:51 -05:00
Quincy Morgan 4194194e14 Prefix file variables in operations/orthogonalize.js with underscores
Simplify multiple disabled reasons code for circularize and orthogonalize operaitons
2020-02-05 10:10:12 -05:00
Quincy Morgan 4ff634b90f Enable the circularize operation for multiple selected features (close #7326) 2020-02-05 09:57:33 -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 960d0d58a9 Allow squaring multiple features at once (close #6565) 2019-12-12 13:56:46 -05:00
Quincy Morgan 291187cbd7 Enable reversing multiple selected lines or points at once (close #6810) 2019-09-17 13:38:47 -04:00
Quincy Morgan c229326aad Allow using the Reverse operation on directional nodes (close #6850) 2019-09-17 10:57:55 -04:00
Quincy Morgan d1ad5a431f Don't check if data is downloaded for operations in the walkthrough 2019-05-10 12:44:02 -04:00
Bryan Housel 901cab57da Remove _disabled caches for operations
(re: #6296, reverts 81127d7)
see https://github.com/openstreetmap/iD/issues/6296#issuecomment-489259027
(I'll find another way to deal with the menu not matching the tooltip)
2019-05-07 10:32:12 -04:00
Bryan Housel 966f5c3586 Add explicit validation calls to each operation
This is cleaner than adding hooks to transitionable actions, or performing validation
on every history change.  We want validation to run after each operation, but not
while the user is drawing lines or typing in fields.
2019-05-06 14:49:46 -04:00
Bryan Housel 59c34e2537 Perform orthagonalization fixes without a transition
We can just set `action.transitionable = false` to make the action instant.
Also removes the `onCompletion` handlers. They shouldn't really be needed,
because the validator will run after the fix is applied (and at other times).
2019-05-06 10:23:30 -04:00
Quincy Morgan e71470acf6 Remove disabled state cacheing for the delete operation 2019-05-03 13:31:28 -07:00
Quincy Morgan a772808e04 Remove cacheing of disabled state for certain operations to avoid stale state (close #6296) 2019-05-03 13:23:24 -07:00
Quincy Morgan ecc217f5d8 Add validation rule to flag impossible oneway highways and waterways (close #6216) 2019-04-26 12:04:43 -07:00
Quincy Morgan d01bb78707 Reduce circular dependencies caused by importing from indexes, the location of the validation models, and the location of areaKeys (close #6237) 2019-04-24 13:45:59 -07:00
Bryan Housel 05949608aa Support straightening of points
(closes #6217)

- Split `actionStraighten` into `actionStraightenWay` and `actionStraightenNodes`
- Now `operationStraighten` chooses the correct action depending on selected entities
- Also move `getSmallestSurroundingRectangle` from `actionReflect` to `geo.js`
2019-04-24 01:55:43 -04:00
Quincy Morgan 34fcd01f98 Add validation warning for unsquare buildings 2019-04-23 15:50:52 -07:00
Bryan Housel bd2a33d845 Merge branch 'validation_and_change_perf' 2019-04-23 01:30:26 -04:00
Quincy Morgan e04d860f62 Convert "Detach" operation into "Extract" operation that also works on areas (close #6203) 2019-04-22 14:46:01 -07:00
Bryan Housel e4fc821eb0 Just use reduce 2019-04-22 09:49:17 -04:00
Bryan Housel 3557e3c711 Don't allow disconnecting a way if parts extend to undownloaded tiles
(re: #2248, #4245)
2019-04-20 00:02:46 -04:00
Bryan Housel 51c1088c1b Merge branch 'master' into validation_and_change_perf 2019-04-19 15:18:23 -04:00
Quincy Morgan 130e9909f6 Allow disconnecting an entire way from other ways at once (close #4245) 2019-04-19 11:54:13 -07:00
Bryan Housel 4d66cacb27 Nodes needs Array.length not Set.size 2019-04-19 11:04:41 -04:00
Bryan Housel 0a77a494aa Merge branch 'master' into validation_and_change_perf 2019-04-10 14:22:20 -04:00
Bryan Housel f309e925d8 Memoize disabled for all the other operations too
see 81127d71f
2019-04-10 11:28:41 -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
Quincy Morgan 89d8f887be Allow disconnecting multiple selected vertices at once (close #6164) 2019-04-09 14:04:52 -07: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
J Guthrie ac29803b6f Fix eslint error 2019-04-08 16:38:10 +01:00
J Guthrie 4d24db597e Small refactor to improve efficiency 2019-04-08 16:28:01 +01:00
J Guthrie 7edebb897f Only allow disconnect when selected ways relate to selected node 2019-04-08 12:41:05 +01:00
Quincy Morgan 8779e1a6dc Add Downgrade operation to remove most tags from features but retain address and building tags instead of immediate deletion 2019-04-02 11:09:08 -04:00
Bryan Housel 3896b2282f Remove lodash isNaN, isNumber, isString, bind, uniqBy
(re: 6087)
2019-03-27 23:11:45 -04:00
Bryan Housel 3d80e6505f Remove lodash chunk, groupBy
(re: #6087)
2019-03-27 16:18:41 -04:00
Quincy Morgan 4cc8d796a6 Prevent deleting features with Wikidata tags (close #5853) 2019-03-27 16:02:02 -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 1ce4f0ad6a Remove lodash without
(re: #6087)
2019-03-25 21:56:54 -04:00
Bryan Housel 76e0d13729 Remove lodash every and filter
(re: #6087)
2019-03-23 01:22:56 -04:00
Bryan Housel 7a6c63fcc5 Remove lodash extend (re: #6087) 2019-03-23 00:38:39 -04:00