Commit Graph

39 Commits

Author SHA1 Message Date
Martin Raifer 85022dcc6c render operations texts with lang attribute 2022-06-23 19:23:16 +02:00
Quincy Morgan 79688ce2d9 Show count and use plural forms for more operation strings (re: #8014) 2020-09-22 09:10:49 -04:00
Quincy Morgan 5f93da5a59 Add a reusable function for calculating the combined extent of multiple entities (re: #7706) 2020-06-16 13:17:43 -04:00
Quincy Morgan fd41e5fd75 Add specific error feedback for disabled straighten operation for multiple selected features 2020-06-08 11:16:25 -04:00
Quincy Morgan e8a227fc59 Allow straightening a selected line between two points if the two points are visible, regardless of how long the line is 2020-06-08 10:08:52 -04:00
Quincy Morgan ab3717bbc8 Disable the Straighten operation when not enough of the selection is visible (close #7675)
Add specific straighten tooltip and annotation labels for multiple selected lines
2020-06-05 14:59:27 -04:00
Quincy Morgan db9eed2434 Move the edit menu logic to uiInit
Make context the first argument of operation objects
Add Paste operation to edit menu when opening the context menu on a blank area of the map (close #2508)
2020-05-14 15:49:35 -04: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 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
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
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
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 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 f6c284a3be Minor code cleanups, swap some math for existing functions 2019-03-22 15:29:48 -04:00
J Guthrie 97dc659b0f Fixed linting - moved function out of loop 2019-03-22 15:29:48 -04:00
J Guthrie 9d452c9ffe Fix lint issue 2019-03-22 15:29:48 -04:00
J Guthrie c3295cc174 Remove left over logging statements 2019-03-22 15:29:48 -04:00
J Guthrie 470d6c257d Update to work on ways going in opposite directions 2019-03-22 15:29:48 -04:00
J Guthrie df4f25a02c Use lodash _includes instead of standard javascript version 2019-03-22 15:29:48 -04:00
J Guthrie d07418c654 Enforce either 0 or 2 selected vertices 2019-03-22 15:29:47 -04:00
J Guthrie 24f83ba1ae Attempt to fix travis fail 2019-03-22 15:29:47 -04:00
J Guthrie 16513b1194 Update operationStraighten.available() function
- operationStraighten now allows for two vertices to be selected and straightened between
 - Added test cases
2019-03-22 15:29:47 -04:00
J Guthrie c28f0a77fe Implement new functionality 2019-03-22 15:29:47 -04:00
Bryan Housel 3def4db09f Convert lodah-es and d3 to named imports for operations 2017-09-25 13:58:53 -04:00
Bryan Housel 2ce78d6c43 Call annotation as a function instead of a property
This is because, like tooltip(), it doesn't always make sense to call it,
and it should never get called if the operation is not available.
2017-02-15 23:02:13 -05:00
Bryan Housel 028ef3de3f Expose annotations for each operation 2017-02-15 22:01:30 -05:00
Bryan Housel 087a8c62d1 Behaviors for all Operations 2016-12-20 00:28:24 -05:00
Bryan Housel 3102a4ae6a Rename all the things to include pseudonamespaces 2016-10-04 19:06:20 -04:00
Bryan Housel a86f34b4ef Pacify eslint, get build and tests running again 2016-08-26 01:15:07 -04:00
Tom MacWright af776501d3 Require locale, second pass (#3259)
* Require locale, second pass

* Remove t global, remove t where it isn't needed
2016-07-21 16:20:13 -04:00
Tom MacWright 604d1e2719 import lodash (#3257) 2016-07-19 12:04:16 -04:00
Kushan Joshi 52c466bc27 external modules for operations 2016-06-22 12:34:43 +05:30
Kushan Joshi 2db0f636b1 modularize iD.operations 2016-06-16 00:42:43 +05:30