45 Commits

Author SHA1 Message Date
Martin Raifer
7d933f3875 add default implied access values for ways with "motorroad=yes"
see https://wiki.openstreetmap.org/wiki/OSM_tags_for_routing/Access_restrictions
addresses https://github.com/openstreetmap/id-tagging-schema/issues/609
2025-03-20 13:54:51 +01:00
Martin Raifer
771ad4dbd9 fix calculation of access field placeholder on multiselections 2025-03-20 13:54:47 +01:00
Kyℓe Hensel
6f16060a78 mass-replace done() function with async/await (#10781) 2025-02-17 13:10:04 +01:00
Kyℓe Hensel
2c0f8a4b5f handle cycleway:both=* (#9587)
this works for any `directionalCombo` field, including `sidewalk:both`
2025-02-05 10:41:48 +01:00
Nick Doiron
6dcc73cf7c Add lang atttribute on multilingual names, wikidata/wikipedia fields (#10716)
This improves rendering of CJK names that contain unified ideographs that share a unicode codepoint, such as 化.
2025-01-31 13:49:49 +01:00
Martin Raifer
85a388f345 fix small typo 2024-04-12 18:45:16 +02:00
Hirako
85278c35e4 Field: fix wikiURL by URL encoding it - and slight refactors (#10165)
* Field: fix wikiURL by URL encoding it - and slight refactors

* Field: fix wikiURL only encodeURIComponent instead of redundant full URL

* Field: refactors function to generate wikiURL, ensures anchor part is also URI encoded, ensures the anchor ref is not encoded, adds unit tests

* Field: refactors wikipedia URI encoding of the anchor logic, removes legacy anchorencode effort via try-catch that replaced percentage character with dots, adds unit further  tests, reduces exessive inlining
2024-03-21 00:42:08 -07:00
Wouter van der Plas
5305b4fb46 removed formatting 2021-10-25 00:50:53 +02:00
Wouter van der Plas
2a28f32f7a fixed more tests 2021-10-23 17:50:33 +02:00
Bryan Housel
33fab5580b Before calling init() make sure the assetPath is set
init kicks off building the ui, which can fetch spritesheets for the <defs>
The assetPath needs to be set otherwise these files will not be found
2021-08-16 22:06:42 -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
Bryan Housel
cd5c3c54a4 Fix uiFieldWikipedia tests
- should be `iD.data.wmf_sitematrix` not `iD.data.wikipedia`
2020-02-03 17:26:04 -05:00
Bryan Housel
4aa4686e7f Fix test failures in localized and suspicious_names 2020-02-03 12:38:17 -05:00
Quincy Morgan
1b331bb678 Add mechanism for fields to support editing during multiselection (re: #7276)
Add `utilCombinedTags` method and use it for the raw tag editor as well as fields
Pass `entityIDs` array into fields instead of single `entity` object
Give field revertion its own path separate from `change`
Add multiselection editing to fields in files: access, address, check, combo, cycleway, input, maxspeed, textarea, and wikidata
2020-01-30 13:53:29 -05:00
Bryan Housel
e19bcb77d5 Require init() call before coreContext starts doing things
(closes #7304)
2020-01-29 19:27:12 -05:00
Bryan Housel
c481f90e7d Stop bundling wmf-sitematrix, move it extern
This also includes a bunch of tweaks to make the tests work
in both PhantomJS and modern browsers like Chrome.

Basically - introduce some more async into the test code so that
the coreData.get promise is guaranteed to settle.  Because in
PhantomJS the promise is polyfilled, and Chrome it's native, they
work slightly differently.
2020-01-29 12:30:11 -05:00
Bryan Housel
567eeac587 Make several data external instead of bundled:
Also dist/data/* contains minified files now

These are now external and will fetch as needed:
-export { dataAddressFormats } from './address-formats.json';
-export { dataDeprecated } from './deprecated.json';
-export { dataDiscarded } from './discarded.json';
-export { dataLanguages } from './languages.json';
-export { dataPhoneFormats } from './phone-formats.json';
-export { dataShortcuts } from './shortcuts.json';
-export { dataTerritoryLanguages } from './territory-languages.json';
2020-01-28 22:21:31 -05:00
Quincy Morgan
43cd46f046 Prevent Chrome autofill of recent values in the Allowed Access inputs (close #6414) 2019-05-24 09:30:06 -04:00
Bryan Housel
69a25fd6aa Move locking code from input and localized up to uiField
Also adjust styles some more for wikidata tagged items
2019-05-20 17:50:50 -04:00
Bryan Housel
d0452e6be4 Convert fakeServer tests to use fakeFetch
- 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
2019-04-26 22:29:48 -04:00
Quincy Morgan
e3e3fd1ad3 Fix Wikipedia field test 2019-04-15 15:32:57 -07:00
Bryan Housel
09f7f9189f Fix field tests to run with minimal set of presets 2019-01-30 16:29:27 -05:00
Bryan Housel
71b2d2c6b7 Upgrade legacy symbols in tests
- iD.Context -> iD.coreContext
- iD.Graph -> iD.coreGraph
- iD.Node -> iD.osmNode
- iD.Way -> iD.osmWay
- iD.Relation -> iD.osmRelation
2019-01-30 15:43:02 -05:00
Bryan Housel
495793929f Skip wikidata field test, too time sensitive to work reliably 2018-12-27 12:06:53 -05:00
Tom Hughes
d617d9c588 Fix wikipedia UI tests to mock XHR instead of JSONP 2018-07-04 17:07:27 +01:00
Bryan Housel
b3842d97f4 Remove lodash from the test suite
(closes #4378)
2017-10-18 14:37:39 -04:00
Bryan Housel
99a3741b0c Better isolation of services, to avoid hitting network during test runs
1. All services are disabled in testing now to prevent network accesses
2. Only services are enabled when needed to test something
3. Many changes throughout code to allow iD to run with services disabled
   (e.g. check for osm service instead of assuming context.connection() will work)
4. Actually export the services so we can disable and enable them
2017-08-09 22:04:09 -04:00
Bryan Housel
e8bd6bff6c Fix wikidata clearing, failed lookup when entity no longer selected
(closes #3987)
(closes #3684)
(related #3929)
2017-06-23 16:37:13 -04:00
Bryan Housel
5f44c9a00a Add combobox menus to id-container instead of document.body
(re: https://github.com/openstreetmap/iD/issues/3925#issuecomment-290718356)
2017-03-31 13:44:55 -04:00
Bryan Housel
48d1b0b28e .wiki-link is now a button so we can't test href attribute 2017-03-22 02:50:27 -04:00
Bryan Housel
e9b8b743e7 Update sinon and sinon-chai dependencies 2017-03-21 16:25:29 -04:00
Bryan Housel
9b7d79a3fe Use live bound object for presets object, change context.presets() getter 2016-11-14 15:44:02 -05:00
Bryan Housel
f800e5afbc Remove unnecessary window parameter to Context 2016-11-10 15:19:03 -05:00
Bryan Housel
87950fd472 Fix lib export, flatten names in tests and docs 2016-10-04 21:56:09 -04:00
Bryan Housel
4522d8f89a Add some namespaces to test labels 2016-09-12 21:40:00 -04:00
Tom MacWright
2b366b5f78 Fix access field 2016-09-06 10:06:28 -04:00
Tom MacWright
92f2908ffe Fix wikipedia 2016-09-05 21:48:22 -04:00
Tom MacWright
6189af9b47 fix localized 2016-09-05 21:40:41 -04:00
Tom MacWright
6341d4e4b5 one-shot build (#3266)
* One-shot development

* Move jsonp to module
* Tooltip -> module
* Remove d3.jsonp
* Fix tooltip lint
* Load all libs but d3 itself with require
* Add top-level brfs

* Unformat intro graph
2016-08-10 15:25:19 -07: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
Bryan Housel
7ca6d06254 Replace iD global with iD.Context() module (#3254) 2016-07-19 10:15:32 -04:00
Bryan Housel
5e57ff0771 Fix eslint ; 2016-07-11 12:59:44 -04:00
Tom MacWright
d7a89a41d2 Stub jsonp 2016-07-11 12:08:43 -04:00
Tom MacWright
e30d5f3299 Fix references to iD 2016-07-05 17:58:34 -04:00
Kushan Joshi
477d446772 final touch up 2016-07-06 01:05:21 +05:30