This is a much more general solution.
* src/validate/formatter/Currency.js: Remove trait.
* test/validate/formatter/CurrencyTest.js: Remove test case.
* src/validate/formatter/StringFormat.js: Add trait.
* test/validate/formatter/StringFormatTest.js: Add test case.
* src/ui/step/GeneralStepUi.js (scrollTo):
Will now abort after each error rather than falling through.
Visibility error message will now show field index.
* test/ui/step/GeneralStepUiTest.js: Added respective test cases
This defaults to the global jQuery just so we don't break
everything (BC); that'll be removed in the future.
* src/ui/step/GeneralStepUi.js (__construct): Accept jQuery.
(setContent): Use jQuery instance passed via ctor
This can now be handled with the existing formatters, specifically the
MultiDimension trait. Specifically, multitext simply handled the
styling of vectors.
* src/ui/ElementStyler.js (_answerStylers): Remove multilimit
This will simplify, through composition, a number of other
validator-formatters.
* src/validate/formatter/MultiDelimited.js: Added
* test/validate/formatter/MultiDelimitedTest.js: Added
This adds a great deal of flexibility through composition via trait
stacking.
* src/validate/formatter/UnorderedList.js: Renamed from
UnorderedListFormatter; now a trait.
* test/validate/formatter/UnorderedListTest.js: Renamed from
UnorderedListFormatterTest and adjusted to instantiate trait.
These have been refacored from the original: rather than abusing what is now
the PatternFormatter, it is now its own class.
* src/validate/formatter/UnorderedListFormatter.js: Added.
* test/validate/formatter/UnorderedListFormatterTest.js: Added.
Oops. Kind of hard to re-run `make' without the Makefile (you could have
run ./configure to create it, though).
* Makefile.am: Add 'Makefile' to EXTRA_DIST.
The VFormat system fulfills the same purpose. This is a small step toward
removing that system; it will first attempt formatting, and fall back to any
available answer stylers.
The validator/formatters will be extracted into liza.
This allows overriding for testing (and is a proper abstraction); eventually
this will be moved out of this class entirely.
* src/ui/step/GeneralStepUi.js (getAnswerContext): Added
Number of methods updated to use.
This is just to enable some sort of testing without instantiating the entire
class and navigating a maze of methods.
* ui/step/GeneralStepUi.js (answerDataUpdate): Added
(_processAnswerFields): Extracted function into answerDataUpate
* src/validate/ValidStateMonitor.js (mergeFailures):
Another error on a field that previously failed will no longer overwrite the
previous failure, which caused issue when the causes changed (leaving fields
potentially unfixed).
* test/validate/ValidStateMonitorTest.js: Respective tests added.
* src/validate/Failure.js (__construct): Takes an array of causes.
(getCauses): Now returns an array of causes.
* src/validate/ValidStateMonitor.js: Recognize fixes on array of causes.
* test/validate/FailureTest.js: Updated
* test/validate/ValidStateMonitorTest.js: Updated
This maintains BC with the old string-based system.
* src/validate/ValidStateMonitor.js (_getCause): Added.
(detectFixes): Consider failure cause if available when checking for fixes.