148 Commits

Author SHA1 Message Date
Martin Raifer
ac59197632 simplify raw tag editor ui and logic (#10889)
* always show empty line at bottom of the tag list to allow adding more tags (replaces `+` button and tab logic)
* disable delete and info buttons on empty tag
* replace deferring of tag change events and re-rendering with a simpler logic (to fix issues like #10871):
  only set input field values if the rendering event was triggered by an external event, or by a change of the respective field in the raw tag editor itself
* skip delete and tag info buttons while navigating using tab: makes it more quick to get to where one typically needs to, deleting a key using the keyboard only is possible by emptying the tag's key, and advanced users are not typically using the `i` button anyway
2025-05-12 18:21:55 +02:00
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
Kyle Hensel
7afecd39ec minor tweaks to make some tests pass 2024-09-03 19:23:21 +10:00
Martin Raifer
25d98b14e0 Merge pull request #10198 from openstreetmap/dependabot/npm_and_yarn/eslint-9.0.0
Bump eslint from 8.57.0 to 9.0.0
2024-04-12 18:47:04 +02:00
Martin Raifer
85a388f345 fix small typo 2024-04-12 18:45:16 +02:00
Martin Raifer
211b6dde5f upgrade to eslintv9 (config format, lint to updated rules) 2024-04-12 18:44:04 +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
Martin Raifer
9cc04d3f0b fix spelling mistakes 2023-11-14 11:26:36 +01:00
Martin Raifer
fdcf6369f2 add test to check that user name is properly escaped 2023-11-08 11:42:29 +01:00
Martin Raifer
77f31cad07 fix tests 2023-08-09 18:39:24 +02:00
Martin Raifer
f6e4596b59 remove now unneeded refrences to and workarounds for phantomJS 2022-02-03 13:12:00 +01: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
474b345988 Send keydown events when testing uiCombobox 2020-10-13 16:03:00 -04:00
Quincy Morgan
21a49bbec8 Initial support for D3 v6.2.0 2020-10-06 15:08:39 -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
Quincy Morgan
a1a398650f Instantiate uiFlash only once as a property of the UI and remove global selection (re: #7445) 2020-03-29 10:22:58 -07:00
Quincy Morgan
36082a8119 Use ideditor as the container class instead of id-container
Scope all CSS to iD's container (close #7437)
Don't style html or body elements unless running standalone iD
2020-03-22 16:54:12 -07:00
Quincy Morgan
f2a687f68b Convert container from id to class 2020-03-20 15:08:56 -07:00
Quincy Morgan
f625406ccc Convert some element ids to classes to avoid collisions when embedding iD
Clarify some footer class names
2020-03-20 13:43:07 -07:00
Quincy Morgan
152d89fa22 Convert some element ids to classes to avoid collisions when embedding iD 2020-03-20 13:10:39 -07:00
Quincy Morgan
bd7c1c757c Fix code test failure 2020-03-12 16:49:57 -07:00
Quincy Morgan
2e238b8218 Fix JS error on clicking review request
Give different instances of the raw tag editor distinct classes and disclosure states
Correctly expand raw tags section by default when selecting a feature with a fallback preset
Fix raw tag editor tests
2020-02-26 14:51:32 -08:00
Bryan Housel
4d0ef1bafc Export only the d3 functions we use in tests
(re: #4379)

This trims a bit more off the iD bundle size
2020-02-22 15:07:09 -05:00
Quincy Morgan
6782947f5b Make inspector sections inherit from uiSection (re: #7368) 2020-02-21 15:22:54 -08: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
73e64b2d7e Update code test 2020-01-18 12:27:50 -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
ff1eea43a8 Remove Google Analytics, also actually export iD.utilDetect 2019-05-02 19:12:39 -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
26368522c9 Batch changes from raw tag editor so blur/remove tag don't conflict
(closes #5878)
2019-02-10 22:08:13 -05: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
b9444ab991 Restore hand cursor on dropdown carat
(closes #5769)

This change allows pointer events to flow to the caret, and forwards
them back to the combo input.  Also renames several event handlers
for clarity, and increases the double-click detection threshold.
2019-01-26 13:22:31 -05:00
Bryan Housel
55715a4827 Try to dispatch an accept event on blur
(re: #5752 - but does not close it)
2019-01-25 14:47:17 -05:00
Bryan Housel
0c7b9a631e Improve combobox event handling and avoid overwriting typed data
(closes #5722, re: #5637, re: #5618)

dispatched with a value() string instead of a datum, which
causes issues for code expecting a datum always.
(such as localized.js brand picker or "Add Field" combo)

Fix for this coming in next commit.
2019-01-22 22:26:27 -05:00
Bryan Housel
19a8f5c47c Remove test that only works if we can reliably simulate clicks
Previously the combo showed immediately on mousedown, now it
shows on mouseup after some slight delay.
2019-01-18 23:34:59 -05:00
Bryan Housel
1ec5b708fc Restore default click behaviors on mousedown of a combobox
(closes #5732)
2019-01-18 23:23:35 -05:00