Commit Graph

22 Commits

Author SHA1 Message Date
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
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
Quincy Morgan
7c5cbb121f Fix "Add field" label 2020-01-24 10:59:10 -05:00
Quincy Morgan
667406c6e0 Remove "all" from the inspector section names 2020-01-20 11:51:00 -05:00
Quincy Morgan
6bd075d04f Account for keys and fields with null key in "add field" search terms (re: #5763) 2019-08-23 10:05:59 -05:00
Quincy Morgan
67afa20dc0 Let comboboxes filter against terms, not just values
Add terms property to fields
Make terms translatable for searchable fields
Account for fields' terms and keys when filtering with the Add field menu (close #5763)
2019-08-09 11:12:40 -05: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
ae06e28f9b Try to avoid style recalculation when typing on the comment box
I think this doesn't completely work.. It reduces the amount
of unnecessary DOM changes, but there are still some more.
2019-04-19 10:02:25 -04:00
Bryan Housel
4583e2d4d7 Make sure all combo event listeners can handle accept/cancel w/o datum
(re: #5637, re: #5618)

This can happen if the user enters a value that is not matched to
one of the combo suggestions.

Also make sure to set `this` to the input field.  It might not be
already if the event was triggered from a keypress instead of a click.
2019-01-22 23:14:34 -05:00
Bryan Housel
09e574983f Don't call formFields.tagsChanged() when presetEditor.tags change
(closes #5690)

This change also makes sure to use the latest copy of the entity in
field.isAllowed() to ensure the prerequisite field check works
and fieldsArr is filtered properly for #5583
2019-01-11 17:42:34 -05:00
Bryan Housel
b575ee8500 Move formFields klass from an argument to a state variable
(maybe needed in case render can get called different ways)
2019-01-11 13:56:16 -05:00
Quincy Morgan
a4b2924e4e Merge branch 'master' into field-prerequisite-tags 2018-12-13 17:23:54 -08:00
Bryan Housel
39b3f1df68 Avoid creating comboboxes
(closes #5568)

Several strategies in here:
- Move uiCombobox() from inside the render function to class variable
- Don't render stuff like the raw tag editor when it's collapsed
- Don't show as many fields/combos on hover
- Don't instantiate fields (like universal/more) until they're actually shown
- Bind the combo on enter selection not on update selection
2018-12-11 16:07:00 -05:00
Bryan Housel
15a54cab17 Use context.container instead of passing it in 2018-12-10 14:14:27 -05:00
Bryan Housel
e5dedeff8b Move lib/d3.combobox.js -> ui/combobox.js
As with other things from this lib/ folder, little original code remains
and turning these things into reusable d3 plugins is not a priority.
2018-12-10 12:38:21 -05:00
Quincy Morgan
5471b909e2 Added mechanism for displaying fields conditionally based on tags 2018-12-09 20:11:31 -08:00
Bryan Housel
ef0636ad01 For fields that use entityID, recreate field if entityID changes
(closes #5229, closes #4898)
2018-08-16 11:07:38 -04:00
Bryan Housel
4a71aa6146 Use safer field ids in classes, element ids, css selectors
Fixes issue with nested/namespaced fields, such as `maxspeed/advisory`,
in situations where would try to use a css selector or element id.
Can't use characters like '/' in a css selector.
2018-03-15 00:57:41 -04:00
Bryan Housel
3d13620705 Convert lodah-es and d3 to named imports for ui 2017-09-26 11:22:43 -04:00
Bryan Housel
59f1df902d When showing a field, set its default value if it has one
This allows universal fields or other standalone fields to have a default value.
This didn't work before becuase default values were only handled by
preset.applyTags() / preset.removeTags().
2017-09-11 15:16:02 -04:00
Bryan Housel
e9909717c7 Change source field to semiCombo, let users pick common source types 2017-08-15 15:15:39 -04:00
Bryan Housel
7563f3ac16 Refactor duplicate form-field code to uiFormFields 2017-08-15 09:35:57 -04:00