33 Commits

Author SHA1 Message Date
Martin Raifer
9f3f8e1366 rename method 2021-11-29 19:26:18 +01:00
Martin Raifer
d78c357588 replace raw html injection of localized texts
by using d3 to insert the localized text spans directly into the DOM
2021-11-26 18:51:45 +01:00
Martin Raifer
040257fd44 replace unnecessary setting of raw "html" with "text" 2021-11-18 18:53:33 +01:00
Quincy Morgan
481b80e5cb Fetch the parent relations when downloading a single entity, e.g. when launching iD with a feature selected (close #6731) 2020-11-10 10:00:44 -05:00
Quincy Morgan
21a49bbec8 Initial support for D3 v6.2.0 2020-10-06 15:08:39 -04:00
Quincy Morgan
118a91ea33 Make Q/A issue links focusable (re: #8004) 2020-10-01 11:36:46 -04:00
Quincy Morgan
5435082d9c Revert t function to returning the plain string by default
Add `t.html` function for getting the string with the `lang` attribute
2020-09-22 12:03:29 -04:00
Quincy Morgan
32f8274929 Make t function return a span element with a lang attribute unless html: false is specified in the options (re: #7963)
Update `text` functions to `html` to support inserting the `span` elements
Specify `html: false` for various instances where a `span` is not desired, e.g. `placeholder` and `title` attributes
2020-09-15 21:56:22 -04: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
ca3a0f9dbc Fix lint warnings 2020-04-02 11:12:10 -07:00
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
ecba6ce48d Remove d3_selectAll from osmose_details.js 2020-03-22 15:14:37 -07:00
SilentSpike
753ae3bdd2 Use marked for Osmose strings markdown
- More reliable method of handling markdown
- Change external links in the strings within the details code
2020-02-16 22:38:34 +00:00
SilentSpike
18287284c6 Remove translations link from Osmose UI
- Not useful to majority of users and clutters the UI
- Anyone interested in translation will already be looking at the iD
project and we can direct them from there
2020-02-16 12:47:38 +00:00
Quincy Morgan
614ee3f68e Use standard hover-highlighting mechanism for feature links in Q/A inspectors 2020-02-13 10:07:18 -08:00
SilentSpike
7d76e0ac5c Fix Osmose request resolving after UI moves on
- Previously caused minor unexpected renderer behaviour by forcing elements
visible when the user had moved on (potentially interfering with
whatever they're currently doing)
2020-02-07 10:43:44 +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
03a097c847 Move Osmose translation link below details box 2020-02-04 21:44:20 +00:00
SilentSpike
3745c06d62 Hide Osmose issue description if no string 2020-02-04 21:22:44 +00:00
SilentSpike
087867d5c8 Use Promises for Osmose issue detail requests
Also ES6ify the details script
2020-02-04 21:08:02 +00:00
SilentSpike
377e99240f Add Osmose translations link to details footer
Improves structure of the details UI and introduces the use of flexboxes
for this. Does not break UI for other error services with shared classes.
2020-02-03 23:20:45 +00:00
SilentSpike
1dd65cb93e Correct Osmose UI element spacing 2020-02-03 23:20:45 +00:00
SilentSpike
06ac02f89f Use Osmose dynamic subtitile string
Providing a `langs` param that's currently not implemented so these will
all be English until that is done.
2020-02-03 23:20:45 +00:00
SilentSpike
e3c6f58624 Format markdown in Osmose strings appropriately 2020-02-03 23:20:44 +00:00
SilentSpike
010ca30999 Show more Osmose strings in the UI
Also only add sections where appropriate
2020-02-03 23:20:44 +00:00
SilentSpike
7a00c0a974 Use Osmose locale filter and detail strings 2020-02-03 23:20:44 +00:00
SilentSpike
5d93d3cace Prepare to use Osmose issue detail strings
- Remove translation description strings, will be using supplied
translations once the API is updated
- Change the way elements and details are presented since they can't be
easily integrated into the 3rd party description strings
2020-02-03 23:20:44 +00:00
SilentSpike
b24b041335 Add Osmose issue detail fetching for UI
Must fetch details per-issue to get the associated OSM elements for
highlighting and use in the error description.

Also fixes URL for error closure.
2020-02-03 23:01:03 +00:00
SilentSpike
ebd206595a Use Osmose tiles API endpoint instead of issues
- Simplifies our code a little bit
- Quick to provide and gives us the `item` + `class` without requesting
all other information (the two things needed to know the error type)
- Removed handling of associated elements for now, need to implement
fetching for that data on a per-issue basis when the UI loads
- Set things up for the possibility of using the provided translation
strings (need to determine if desirable)

See: https://github.com/osm-fr/osmose-frontend/issues/193
2020-02-03 23:01:03 +00:00
SilentSpike
680fdb6b54 Allow Osmose errors to use category for UI strings
Some error types don't require unique strings and can share common
strings among the category. This makes that possible as well as adding
support for some other types of error for demonstrative purposes.
2020-02-03 23:01:02 +00:00
SilentSpike
d9ba63aa3f Fix leftover errors and unused definitions 2020-02-03 23:01:02 +00:00
SilentSpike
09e7b23665 Add Osmose issues UI and filtering
Filters out errors not present in the data .json file to enable
selective support since Osmose has a wide variety of errors which may be
too advanced for iD.

Also added processing for the elements associated with an error for
forced visibility and highlighting.
2020-02-03 23:01:01 +00:00