Commit Graph

101 Commits

Author SHA1 Message Date
Bryan Housel
728036be51 Don't write unsavable changes to localStorage (closes #2705) 2015-06-20 12:21:29 -04:00
Bryan Housel
f4d93c442e Add connection#loadEntityVersion to fetch specific version 2015-06-18 11:46:43 -04:00
John Firebaugh
f8a68c879f Adjust tree for force-rebased entities
Previously, entities that already existed in the rtree prior to the rebase
option would end up duplicated in the tree afterward.

Fixes #2637
2015-05-09 14:38:41 -07:00
Bryan Housel
7adb0ddbfb Smarter revert of new entities, more tests
re: #2611, #537
2015-04-29 22:47:07 -04:00
Bryan Housel
ca02cf4b96 Graph#revert accept id instead of entity ref
trivial test cases (revert across create/update/delete) all pass
2015-04-28 11:22:46 -04:00
Bryan Housel
587d1451be More tests for Graph#revert (reverting new things should remove them) 2015-04-27 12:02:59 -04:00
Bryan Housel
6b18066dd6 Graph#revert (see #537) 2015-04-26 01:07:48 -04:00
Bryan Housel
55c4fce55f Merge pull request #2516 from bhousel/zorrofix
Avoid zorroing connected ways when moving a way
2015-03-20 22:30:34 -04:00
Bryan Housel
56449bc589 Pend some failing tests
They should work but they don't.  No idea why.  PhantomJS issue?
2015-03-03 21:06:28 -05:00
Bryan Housel
cb0e8ab66c Initial support for Multi Fetch GET
It will also be much faster to fetch the remote entities in batches
rather than one at a time through LoadEntity.

One bonus/hazard with Multi Fetch GET is that it will get deleted entities
with `visible=false`, rather than returning a HTTP Status Code 410 (Gone).

This will be the only way that we can really do proper undeletion
(Incrementing the current version by 1 is not guaranteed to work.  And
if a way is moved, fetching way/full will tell us whether the childnodes
are part of the way, but not necessarily whether they exist or not.)

We must be careful never to merge deleted entities into the real graph.
e.g, a deleted node will not have a 'loc' attribute, so code that assumes
every node must have a `loc` will be broken.

So because deleted entities are very special, the output from `loadMultiple`
should only be used for conflict resolution for now.
2015-03-03 20:54:09 -05:00
samanpwbb
d141827c3e Merge branch 'master' into conflict-resolution-ui 2015-02-06 19:08:50 -05:00
Bryan Housel
147e369c3b Add graph#overwrite (same as pop followed by perform)
to remove some of the overhead in creating difference and dispatching
change event multiple times..
2015-02-02 22:01:49 -05:00
Bryan Housel
ed4929273d Return entities from iD.Connection via callbacks
(instead of dispatching `load` event to merge them into `history`)

This is cleaner becuase now `context` doesn't need to keep an
`altGraph` state used only for Conflict Resolution.

The conflict resolution code calls the `iD.Connection` methods directly,
and other places in the code call `loadEntity` and `loadTiles` wrappers
that merge the entities into the main history.
2015-01-08 14:44:58 -05:00
Bryan Housel
d9f204cf45 Remove Graph#freeze 2015-01-07 11:52:17 -05:00
Bryan Housel
90147b23db Make copy handle circular and other degenerate Relations 2015-01-04 23:15:47 -05:00
Bryan Housel
f6d144c151 Improvements, and simplify code
* don't worry about deep copying, because immutability
* don't need `attrs` parameter which is usually empty
* don't worry about resetting `v` entity version
2015-01-01 22:49:44 -05:00
Bryan Housel
dae0d2d55e Add entity copy methods 2014-12-28 22:00:55 -05:00
Bryan Housel
d85da08cfe fix "inherits entities from base prototypally" test 2014-12-10 00:11:09 -05:00
Bryan Housel
1c3d198b96 add force option for rebase to overwrite existing entities
related: openstreetmap/iD#2467
2014-12-04 19:50:32 -05:00
Bryan Housel
1f544e883b bump chai to 1.9.2 and fix tests affected by change in equality testing
re #2388
2014-10-28 21:37:04 -04:00
John Firebaugh
e0020c37e2 Add test for #2421 2014-10-24 10:34:39 -07:00
John Firebaugh
a7fb35663c Optimize Way#area 2014-10-13 16:46:32 -07:00
Bryan Housel
0c5f563a26 add test for iD.Entity.layer(), fix spelling of man_made. 2014-06-09 23:39:16 -04:00
John Firebaugh
0c09871c4a Don’t show turn restriction editor for non-highways (fixes #2240) 2014-05-27 14:35:57 -07:00
Bryan Housel
b8501bcf89 iD.Way.isOneWay should return false if oneway=no #2220
i.e. overrides implied oneway tag like `highway=motorway` or `junction=roundabout`
2014-05-20 00:14:23 -04:00
Bryan Housel
d245121b19 Fix isConvex() to correctly test the angle that closes the way. 2014-04-23 14:12:20 -04:00
Bryan Housel
a2331f8c93 Add tests for iD.geo.cross and iD.way.isConvex 2014-04-15 00:26:53 -04:00
John Firebaugh
2ab9239a9f More accurate modification tests 2014-02-25 10:12:34 -08:00
tyr
efd3223e0c extend history loading fix to deletions
Deleted objects need to be kept in the base of the history stack, too.

This also improves the respective unit tests.
2014-02-22 14:09:17 +01:00
tyr
86c4bc9105 add tests for "restoring from v3 JSON" (core/history.js) 2014-02-21 10:19:36 +01:00
tyr
fc0a15e6c4 fix duplicate objects after restoring data from localStorage
This makes sure that the originals of changed entities get merged
into the base of the stack after restoring the data from JSON.
This is necessary, because the stack will only have elements for
the current viewport after a restart and previously *modified*
objects will now be falsely detected as *created* ones.

Also removed some ineffective code.
2014-02-21 10:01:26 +01:00
tyr
b71c98cfca protect against relation loops, part 2. fixes #2096 2014-01-10 11:12:10 +01:00
John Firebaugh
1561c366be Update OSM.org links 2014-01-08 16:29:00 -08:00
John Firebaugh
ab8a4ffd7b Update GitHub links 2014-01-08 16:14:28 -08:00
John Firebaugh
4bf21cbc8a Restore deleted nodes that are discovered to have extant parents
This bug has existed since 1.0!

Fixes #2085
2014-01-06 16:23:15 -08:00
John Firebaugh
7bbca76a20 Protect against relation loops (fixes #2072) 2014-01-02 17:42:57 -08:00
Adam Solove
2213b072dd Clean up and test relation sorting code. 2013-12-10 22:39:37 -05:00
John Firebaugh
15590525d3 Fix build 2013-11-21 14:51:52 -08:00
tyr
2cf4c20a47 don't load parent multiple times into tree when multiple childs are changed
when an action (e.g. moving a way) caused multiple child elements
of the same parent to be changed, their parent was also loaded into
the tree multiple times during `tree.intersects()`.

this fixes #1978
2013-11-19 11:27:29 +01:00
John Firebaugh
b383bfec1f Fix unclosed area rendering (fixes #1958) 2013-11-13 17:41:57 -08:00
John Firebaugh
492fc88aa4 Make the Graph#rebase argument an array 2013-10-31 16:24:31 -07:00
John Firebaugh
14bfc52e33 Remove repetition of entity IDs in tests
There were several places where the key and entity id
didn't match up.
2013-10-31 15:57:47 -07:00
John Firebaugh
ffdeef398d Rewrite tree logic
The main problem with the existing logic was that it
did not update the extents of relations when previously incomplete members were loaded.

It was also overly stateful; the various queues and flags
are no longer required.

Fixes #1928.
Fixes #1540.
2013-10-28 16:57:18 -07:00
John Firebaugh
95e667d6b7 More tests 2013-10-28 16:34:08 -07:00
John Firebaugh
e0e08115e5 Pass entity array to Tree#rebase 2013-10-28 16:34:08 -07:00
John Firebaugh
e6d3cb242c Clean up tests 2013-10-28 14:07:28 -07:00
John Firebaugh
fbf2118c76 Fix change summary calculation after restoring
We can't rely on identity equality here due to how
restoring works, and don't want to anyway -- the summary
should ignore net-no-op tag changes.

Fixes #1915.
2013-10-23 17:35:35 -07:00
John Firebaugh
2de500a90a Add a few more vertex cases to summary 2013-10-23 13:36:58 -07:00
John Firebaugh
697faf0265 Use summary to calculate # in Save button 2013-10-23 13:36:58 -07:00
John Firebaugh
b8e88a7aaf Convert relevantChanges to a method on Difference 2013-10-23 13:36:58 -07:00