(closes#6028) (I hope?)
Because this click may trigger a blur event,
and the blur event may trigger a tag change,
and we really want that tag change to go to the already selected entity
and not the one that we are about to select with the click #6028, #5878
(Be very careful entering modeSelect anywhere that might also blur a field!)
(closes#6235)
Previously only trailing keyparts would reverse:
`cycleway:left` ⟺ `cycleway:right`
Now it can do internal keyparts too:
`cycleway:left:surface` ⟺ `cycleway:right:surface`
- can't reliably use sinon.spy to tell whether a thing has been called,
so we listen for events instead and check server.requests()
- make sure to request the next page before dispatching `loadedImages` so
we can `server.respond()` to the request in the event handler if we want to
- also moves `localeDateString` in the openstreetcam service from parsing
code to display code, because it's very slow (we can just do this for the
images we look at, instead of all images we fetch)
- Many text expects are now wrapped in setTimeout, as the fetch
promises settle async now.
- This makes the tests somewhat brittle, and we should maybe consider
reworking some of them. For example it is very hard to perform
a test like `expect(spy).to.have.not.been.called` in an async way.
(We could instead inspect the fakeServer requests() to know this.)
- Also includes some trickery for osm.js, which uses d3-xml (fetch)
now for unauthenticated calls and osmauth (xhr) for authenticated calls
This mimics `respondWith` and `respond` to keep the tests mostly
similar between `FakeFetch` and `sinon.fakeServer`
Major difference is that all the fakeServer tests which were sync
are now async and this is probably unavoidable.
(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`
This matters as we start to match more rules for hybrid features like rail
platforms, which now match both path and rail. We want to show them unless the
user has hidden all the rules that they match.
Also this changes the test code slightly to actually test rule matching.
Before it was really just testing hiding.
(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.
- 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
- This is to make difference comparisons easier
- The only nodes that didn't have a `loc` were fake nodes we made for testing
- So this commit also fixes the `osmIntersection` code and tests.