Commit Graph

55 Commits

Author SHA1 Message Date
Martin Raifer
6c2f9a8f7d fix rendering of html of improveOSM issues 2022-02-02 18:55:33 +01:00
Quincy Morgan
2dd0b8449f Rewrite some confusing nested ternaries (close #8117) 2020-12-03 12:18:39 -05:00
Peter Newman
4205ca1d07 Fix the seemingly safe spellings found by codespell
Untested, only checked by inspection.

(cherry picked from commit 2c47a11008)
2020-08-10 17:32:37 +01: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
SilentSpike
d200d0fce2 Use Promise for improveOSM comments 2020-02-14 17:31:10 +00:00
SilentSpike
3ee32776a7 Fix QA error icons
Pass service itself in to QAItem constructor for purpose of fetching
data. Store string as `title` property on the service.
2020-02-12 21:27:38 +00:00
Bryan Housel
a9a1f945f8 Move the qa_data external
- this means that QAItem now asks the service for the icon rather than knowing it directly
2020-02-07 10:06:47 -05:00
SilentSpike
f86837d637 Fix use of double quotes 2020-02-06 23:12:18 +00:00
SilentSpike
51efd5b714 Update and standardise QA implementations
- ES6ify (now using class syntax to define QAItem objects)
- Fix bug with KeepRight marker rendering not updating properly
- Use `qa-` prefix for the UI element classes to differentiate from iD
validation error related UI element classes
- Move away from "error" where possible in source
- Move away from snake_case naming where possible

Note that some function/method names have been untouched to make life
easier for v3 development. Have added note comments where appropriate.
2020-02-06 23:07:50 +00:00
SilentSpike
d2f9278fe2 Port changeset tag improvement to ImproveOSM QA
Also marked the `closed:` tags as readonly since these are filled in
automatically.

- Gives a count of each error type closed instead of making a list of
joined coordinates which quickly fills the maximum value length.
- This is more useful since a changeset already gives the area worked
on while these counts give insight into the type of changes made.
- Similar to iD own validation tags
2020-02-03 23:20:43 +00:00
SilentSpike
820e86ad6c Fix ImproveOSM request payload
- Seems that the expected payload has changed so now all error types use
key "targetIds"
- Also includes minor fix so that comments display in the UI immediately
2020-01-03 19:52:13 +00:00
Quincy Morgan
e99f6f12de Update ImproveOSM overlay endpoints for transition to Grab (close #7110) 2019-12-12 10:10:44 -05:00
Quincy Morgan
271a4cbac7 Update rbush to 3.0.1 (close #6359) 2019-11-08 18:17:17 +01:00
Bryan Housel
fceb1a86f7 Merge pull request #6245 from openstreetmap/d3-v5
d3 v5
2019-04-29 15:46:08 -04:00
Bryan Housel
b99be67169 When calling an errback from a Promise.catch, pass err.message 2019-04-25 21:58:36 -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
e6bc9d9e8f Swap out d3-request, swap in d3-fetch 2019-04-24 16:25:25 -04:00
Bryan Housel
ba6283af98 Fix point averaging code in improveOSM service
re: 4a8c20c56e (r32961438)
2019-03-29 09:06:27 -04:00
Bryan Housel
4a8c20c56e Remove lodash forEach
(re: 6087)
2019-03-28 19:50:20 -04:00
Bryan Housel
7a6c63fcc5 Remove lodash extend (re: #6087) 2019-03-23 00:38:39 -04:00
Bryan Housel
ff4f8f005f Remove lodash find and findIndex
(re: #6087)
2019-03-22 17:31:41 -04:00
SilentSpike
5bd13dc590 Use https for ImproveOSM requests 2019-02-20 23:11:09 +00:00
SilentSpike
24022416cb Fix negative number of trips in ImproveOSM issues
See https://github.com/openstreetmap/iD/pull/5739#issuecomment-460786055
2019-02-09 16:31:37 +00:00
Bryan Housel
bb0a47b255 Remove kr and keepRight for styles used generically
(it was weird to see these classes in improveOSM components)
2019-02-07 10:35:50 -05:00
SilentSpike
0346d8060f Retrieve ImproveOSM comments only once
This additionally fixes the comment box not clearing on submission as I
wasn't updating the error in the cache (to remove the newComment
property).
2019-02-05 21:46:17 +00:00
SilentSpike
fa87ed75ae Display ImproveOSM comments oldest to newest 2019-02-05 19:57:22 +00:00
SilentSpike
2c7b689b47 Add comments display to ImproveOSM issues 2019-02-05 19:52:44 +00:00
SilentSpike
28bb12b7ae Add function to retrieve ImproveOSM comments
Just need to have the UI make this call and use the data next.
2019-02-05 19:31:30 +00:00
SilentSpike
448119324f Add ability to comment on ImproveOSM issues 2019-02-05 17:11:37 +00:00
SilentSpike
20ed8b50c9 Add generic QA error
I've converted the improveOSM errors to use this new generic QA error
structure which should allow for more general code to be used in
behaviour and UI.

Sidebar preview is currently broken, but will be fixed shortly.
2019-02-04 16:53:59 +00:00
SilentSpike
9403f71140 Track closed ImproveOSM errors via coordinates 2019-02-01 23:31:08 +00:00
SilentSpike
c9e249ee6c Send only relevant query parameters 2019-02-01 23:14:54 +00:00
SilentSpike
e9397aa14f Fix incorrect usage of osm.userDetails callback
Javascript is not my usual domain so still getting used to how scope
works and working with callbacks. Believe this code is now written as
intended.

As a bonus a response status to the error update request which isn't the
expected 200 now returns before visibly removing the error and adding it
to the closed cache.
2019-02-01 22:51:05 +00:00
SilentSpike
21824e6377 Fix coincident errors
Potential for multiple missing turn restrictions on one node and I've
also seen a case of missing one-way along the same stretch of road in
opposite directions!

Missing geometry is tile based so can't really be coincident, but
doesn't hurt to check in case they happen to land on a one-way or turn
restriction.
2019-02-01 22:51:04 +00:00
SilentSpike
183dda5999 Pacify eslint 2019-02-01 22:51:04 +00:00
SilentSpike
d82757c392 Include node in turn restriction description
Clarifies some cases where geometry could be unclear with previous
message.
2019-02-01 22:51:04 +00:00
SilentSpike
60128b0402 Fix one-way error positioning and description
The direction of travel in the description was misleading as the way
segment wasn't necessary linear and so the direction could change as you
travel along the way. This is more explicit as it specifies the detected
start/end nodes (also useful to show that it's not the whole way that
might be one-way).

The position is now taken as the central node in the `feature.points`
list (or the average of the central two when there are an even number of
points).
2019-02-01 22:51:03 +00:00
SilentSpike
45ce4e4c57 Move turn restriction error position slightly 2019-02-01 22:51:02 +00:00
SilentSpike
ee5f9f3bf2 Use consistent short service name 2019-02-01 22:51:02 +00:00
SilentSpike
5d907c1e16 Render errors like points with icons
This allows more diverse representation of the error subject at a glance
than relying on colour alone.

However, it would be good to have a generic error icon that can contain
icons which is differentiated from the point icon for clarity.

Sidebar header currently still uses the bolt icon until I figure out
how to deal with that. Also the font awesome icons don't seem to work,
perhaps there's additional code needed for those that I've missed.
2019-02-01 22:51:01 +00:00
SilentSpike
4a166d7a5b Use more descriptive key names 2019-02-01 22:51:01 +00:00
SilentSpike
88a59cb15f Stop hijacking the inflight cache
This could result in error updates getting aborted when new errors are
loaded as their individual ids are never going to match tile IDs (see
`abortUnwantedRequests` function).
2019-02-01 22:51:01 +00:00
SilentSpike
3334abf776 Remove some unnecessary code 2019-02-01 22:51:00 +00:00
SilentSpike
31091f1159 Add direction of travel to oneway errors 2019-02-01 22:50:59 +00:00
SilentSpike
6bdd0cfa89 Fix missing semicolons 2019-02-01 22:50:58 +00:00
SilentSpike
3174db76b7 Fix north direction in some error descriptions 2019-02-01 22:50:58 +00:00
SilentSpike
9d2792836f Add ImproveOSM error resolution 2019-02-01 22:50:58 +00:00
SilentSpike
214cf41019 Use more generic classes for errors 2019-02-01 22:50:57 +00:00
SilentSpike
39880e559b Add direction of travel to turn restriction errors 2019-02-01 22:50:56 +00:00
SilentSpike
9600d67fc6 Differentiate missing geometry errors by colour 2019-02-01 22:50:56 +00:00