1
0
Fork 0
Commit Graph

178 Commits (5ce106710ecd8d13a27314f8b4d0871a5f53dbc2)

Author SHA1 Message Date
Mike Gerwitz 5ce106710e Add MultiDimension formatter
* src/validate/formatter/MultiDimension.js: Added
* test/validate/formatter/MultiDimensionTest.js: Added
2016-06-28 10:27:59 -04:00
Mike Gerwitz 8feb8f286a Add StandardLimitFormatter
This formats according to common insurance conventions for limits.

* src/validate/formatter/insurance/StandardLimitFormatter.js: Added.
2016-06-28 10:27:59 -04:00
Mike Gerwitz b90f6d7474 Add accept/reject styler
* src/validate/formatter/AcceptReject.js: Added.
* test/validate/formatter/AcceptRejectTest.js: Added.
2016-06-28 10:27:56 -04:00
Mike Gerwitz 31f3ab010e Add Limit formatter
* src/validate/formatter/insurance/Limit.js: Added
* test/validate/formatter/insurance/LimitTest.js: Added
2016-06-27 16:51:25 -04:00
Mike Gerwitz c0df3ef02e Add Number formatter
* src/validate/formatter/Number.js: Added
* test/validate/formatter/NumberTest.js: Added
2016-06-27 16:51:25 -04:00
Mike Gerwitz 8a26406468 Add MultiDelimited formatter trait
This will simplify, through composition, a number of other
validator-formatters.

* src/validate/formatter/MultiDelimited.js: Added
* test/validate/formatter/MultiDelimitedTest.js: Added
2016-06-27 16:51:17 -04:00
Mike Gerwitz 4aa88fc08c UnorderedList{Formatter=>} now a trait
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.
2016-06-24 15:57:10 -04:00
Mike Gerwitz bc45b70644 Add mixin testing to common vformat functions
* test/validate/formatter/common.js (testMixin): Added.
2016-06-23 11:38:09 -04:00
Mike Gerwitz ac52f42d1c Add EchoFormatter
* src/validate/formatter/EchoFormatter.js: Added.
* test/validate/formatter/EchoFormatterTest.js: Added.
2016-06-23 10:12:59 -04:00
Mike Gerwitz 391a819536 Liberated UnorderedListFormatter
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.
2016-06-23 09:14:05 -04:00
Mike Gerwitz ab6be11bb6 Liberate common validator-formatter test function
This has been modified from the original to use Chai instead of the `assert'
module.

* test/validate/formatter/common.js: Added.
2016-06-23 09:13:50 -04:00
Mike Gerwitz d6cecf1ff6 VFormat => PatternFormatter with added interface
* src/validate/ValidatorFormatter.js: Interface added.
* src/validate/formatter/PatternFormatter.js: Renamed from ../VFormat.js.
* test/validate/formatter/PatternFormatterTest.js: Renamed from
  ../VFormatTest.js.
2016-06-22 15:59:12 -04:00
Mike Gerwitz a509e53a3e Liberate VFormat
This will likely undergo some refactoring.

* src/validate/VFormat.js: Added.
* test/validate/VFormatTest.js: Added.
2016-06-22 15:41:03 -04:00
Mike Gerwitz 4ecaa37853 Add Makefile to distribution
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.
2016-06-22 15:12:47 -04:00
Mike Gerwitz eb307e49fe Version bump 0.6.{3=>4} 2016-06-21 16:48:34 -04:00
Mike Gerwitz 30b33e56c9 Incremental step toward removing answer stylers
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.
2016-06-21 16:46:53 -04:00
Mike Gerwitz 2a6b170ac9 Remove unneeded answer stylers
These all have VFormat alternatives.

* src/ui/ElementStyler.js (_answerStylers): Removed
2016-06-21 16:46:21 -04:00
Mike Gerwitz f5549795d5 GeneralStepUi vformat styling
* package.json (devDependencies): Add sinon

* src/ui/step/GeneralStepUi.js (answerDataUpdate): Attempt formatting with
  formatter prior to "old" answer styling.

* test/ui/step/GeneralStepUiTest.js: Added
2016-06-21 16:46:05 -04:00
Mike Gerwitz 91903951c4 Extract direct answer context references into method
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.
2016-06-20 10:29:44 -04:00
Mike Gerwitz 7a1e1a68e3 GeneralStepUi answer styling method extraction
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
2016-06-17 14:44:49 -04:00
Mike Gerwitz a6a3ffdcc4 Version bump 0.6.{2=>3} 2016-04-28 11:55:16 -04:00
Mike Gerwitz e6ede4ad3a ValidStateMonitor: merge subsequent failures before fixes
* 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.
2016-04-28 11:53:14 -04:00
Mike Gerwitz e406c198d2 Add Failure#merge
* src/validate/Failure.js (merge): Added
* test/validate/FailureTest.js: Respective tests added
2016-04-28 11:31:42 -04:00
Mike Gerwitz 895441850e Version bump 0.6.{1=>2} 2016-04-21 16:31:47 -04:00
Mike Gerwitz d8ecfbf225 Multi-cause validation support 2016-04-21 16:31:16 -04:00
Mike Gerwitz b3d3f4b7cd Remove support for string-style validation failures
* src/validate/ValidStateMonitor (_getCauses): Removed
Now requires that each failure be a Failure object.
2016-04-21 16:28:34 -04:00
Mike Gerwitz 0a8329b405 Support multiple validation failure causes
* 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
2016-04-21 16:23:41 -04:00
Mike Gerwitz 98fefd537e Version bump 0.6.{0=>1} 2016-04-20 12:15:12 -04:00
Mike Gerwitz 4079ac7a8b Cause-based field validation support 2016-04-20 12:12:37 -04:00
Mike Gerwitz f624710451 Consider field failure cause when checking fixes
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.
2016-04-20 12:11:17 -04:00
Mike Gerwitz f784db5f2b Ensure that Failure objects will work transparently in ValidStateMonitor
This is to facilitate a transition to Failure without a BC break.

* test/validate/ValidStateMonitorTest.js: Ensure that replacing messages
with Failure will continue to operate as expected.
2016-04-20 11:12:08 -04:00
Mike Gerwitz ac5d04e9a4 Add validation Failure
* src/validate/Failure.js: Added
* test/validate/FailureTtest.js: Added
2016-04-20 10:31:49 -04:00
Mike Gerwitz c83af2fb40 Version bump 0.{5.1=>6.0} 2016-04-20 08:46:48 -04:00
Mike Gerwitz ddffb4e301 No failure event if failures have not changed in ValidStateMonitor
* src/validate/ValidStateMonitor.js (mergeFailures): Return count of new
failures

* test/validate/ValidStateMonitorTest.js: Respective test added
2016-04-19 11:29:14 -04:00
Mike Gerwitz 553a020554 Flat group addition 2016-04-19 10:52:10 -04:00
Mike Gerwitz 3a2a5642b6 Add FlatGroupUi
This solves the problem of trying to show/hide indexes that do not even
exist on the DOM.

There are no tests for this due to the complexity of the parent; refactoring
is needed. :(

* src/ui/group/FlatGroupUi: Added
2016-04-19 10:51:15 -04:00
Mike Gerwitz fcce2e814a Fields with index greater than total in group are not visible
* src/ui/group/GroupUi (isFieldVisible): Indexes greater than the current
index count will no longer be considered to be visible.
2016-04-19 10:50:32 -04:00
Mike Gerwitz 7651e9499f Remove debugging console.log from XhrHttpImplTest
* test/dapi/http/XhrHttpImplTest.js: Remove accidentally-committed
console.log
2016-04-19 00:05:47 -04:00
Mike Gerwitz 5984c2619f Version bump 0.5.{0=>1} 2016-04-18 10:47:57 -04:00
Mike Gerwitz 4e57500077 Makefile dist corrections
As it turns out, the main index.js was missing, and you couldn't build from
the distribution because of a missing tools/!

* Makefile.am: index.js no longer missing from distribution.
tools/ no longer missing from distribution.
2016-04-18 10:47:11 -04:00
Mike Gerwitz ca38cb97da Version bump 1.{4.1=>5.0} 2016-04-18 10:11:41 -04:00
Mike Gerwitz 2722b0b29a Data API liberation and improvment
Not all aspects of the Data API are liberated quite yet, but this is the
bulk of it.
2016-04-18 10:10:29 -04:00
Mike Gerwitz 6d51dc55eb Add DataApiManager field stale flag
This will allow it to know when a request needs to be re-made at a later
time.

* src/dapi/DataApiManager (fieldStale, isFieldStale): Added
(fieldNotReady): Check stale status of field
2016-04-15 12:24:08 -04:00
Mike Gerwitz 3e84f18c56 Extract Data API management into DataApiManager
This is extracted from a not-yet-liberated Program class (that you really
don't want to see).

* src/dapi/DataApiManager.js: Added
2016-04-15 12:23:31 -04:00
Mike Gerwitz d37a8aab12 Liberate dapis
* src/bucket/Bucket.js: Added
* src/dapi/BucketDataApi.js: Added
* src/dapi/RestrictedDataApi.js: Added
* src/dapi/StaticAdditionDataApi.js: Added
2016-04-14 13:53:35 -04:00
Mike Gerwitz a6115018d2 Add x-www-form-urlencoded header for XhrHttpImpl
It might be the case that we may want to post raw data in the future; in
fact, I can guarantee it.  We'll cross that bridge when we come to it.

* src/dapi/http/XhrHttpImpl.js (openRequest): Set ContentType header
on POST

* test/dapi/http/XhrHttpImplTest.js: Modified accordingly
2016-04-14 12:08:00 -04:00
Mike Gerwitz 413df53f4f Version bump 0.{4.0=>4.1} 2016-04-13 08:28:09 -04:00
Mike Gerwitz bc0d230246 Remove trailing comma from ValidStateMonitor
Yes, the reason is IE.

* src/validate/ValidStateMonitor.js: Remove trailing comma after method
definition list.
2016-04-13 08:27:16 -04:00
Mike Gerwitz 7ed15eed92 Version bump 0.{3.3=>4.0} 2016-04-12 16:40:22 -04:00
Mike Gerwitz cbfd42a264 ValidStateMonitor added
This supercedes ClientFieldValidator; callers should handle validations and
notify this new class.

* src/validate/BucketDataValidator.js: Added
* src/validate/ValidStateMonitor.js: New
* test/validate/ValidStateMonitorTest.js: New
2016-04-12 16:39:53 -04:00