Previous work was done to have field errors clear when any
classification in the assertion stack changes. The last remaining
piece was to have field errors clear when the field itself is no
longer applicable.†
- Handling in `Client` was replaced with
`FieldVisibilityEventHandler`. The event system already existed.
- `DataValidator` and `ValidStateMonitor` just needed the ability to
clear specific fields (`#clearFields`).
† Technically the "hide" in liza means "not applicable"; I've been
using that new terminology, but this event can't be renamed right now
because it's so heavily used.
This is a separate program of sorts that sits alongside and hooks the
Client.
* src/client/debug/AssertionClientDebugTab.js: Add class.
* src/client/debug/BucketClientDebugTab.js: Add class.
* src/client/debug/CalcClientDebugTab.js: Add class.
* src/client/debug/ClassifyClientDebugTab.js: Add class.
* src/client/debug/ClientDebug.js: Add class.
* src/client/debug/ClientDebugDialog.js: Add class.
* src/client/debug/ClientDebugTab.js: Add interface.
This thing is an ugly monstrosity that has witheld some pretty rough
development times. As code is touched, it is being removed.
This depends on many things not yet in the liza repo; they'll be added
in time.
These classes were changed slightly to work within liza (e.g. paths).
* src/client/Client.js: Extract from rating-fw
as of 5d4019f1973f9271f4b1bd24ce1f55b56ccda09e.
* src/client/ClientDependencyFactory.js: Extract from rating-fw
as of 5d4019f1973f9271f4b1bd24ce1f55b56ccda09e.
LoVullo dropped support for IE<9, so getters can now be used to
lazy-load modules.
This also means that, during the transition from LoVullo's internal
rating-fw repo to liza, and broken require paths (program/, mainly)
will not cause problems unless the module containing those requires is
explicitly requested.
* tools/gen-index.js: Generate getters.
The individual commits contain more useful detail, but since there's a
lot of _new_ code, you might be okay with looking at the full diff.
This adds support to Liza for considering classification changes when
detecting field fixes. It can be boiled down to: abstract the bucket
diff array into a `Store`, which can also handle classification diffs,
and have `ValidStateMonitor` check that instead of the original
array. The diff data format is unchanged.
- The diff portion of it comes together in `system/client.js` where it
constructs the Store.
- `ValidStateMonitor` is what performs the validations, and existed
previously; it was modified to support Promises and be
async. `DataValidator` extracts some logic (much less than I had
hoped to) from `Client` in the `rating-fw` repository and glues it
together. If it doesn't look coherent, that's because the process
is a bit of a mess; the overall architecture _did not_ change with
this.
A lot of the project design changed or was abandoned upfront before
code was written: I committed my design notes in the new `liza-notes`
repo. It notes a lot of my thoughts and design decisions, and shows a
lot of what was abandoned or simplified.
* src/validate/DataValidator.js
(validate): New `classes' parameter. API BC break from previous
commits.
(populateStore, updateFailures): Generalize methods.
* test/validate/DataValidatorTest.js:
Add associated test.
Refactor existing tests to adhere to new API/expectations.
DEV-2206
See the description in the test case. This is a bug fix.
* src/validate/ValidStateMonitor.js
(_checkCauseFix): Do not consider an empty diff on a past failure to
be a fix.
* test/validate/ValidStateMonitorTest.js: Add test.
DEV-2296
Life is so much less miserable now that the project is supporting ES6.
* src/store/PatternProxy.js: Add trait.
* src/store/StorePatternError.js: Add Error.
* test/store/PatternProxyTest.js: Add test case.
DEV-2296
This will contain various factories (compounded in some cases) to
instantiate various parts of a coherent system. It aims to replace
(as one of many pieces) the ClientDependencyFactory that's referenced
in the code, which is still part of rating-fw (internal LoVullo repo
from which liza is being liberated).
* src/system/client.js: Add module.
* test/system/clientTest.js: Add functional test case.
DEV-2296
ValidStateMonitor now uses a Store in place of the original primitive
object-based diff format. The original format is translated by
DataValidator. The code is in a transitional state, and considering
the amount of time we spend on various areas of this project, will
likely stay this way for a while.
* src/validate/DataValidator.js
(__construct): Accept Store factory parameter.
(_store_factory): Add field.
(_createStores): Add method.
(_validate): Handle Store.
(updateFailures): Add method.
(_populateStore): Add method.
* test/validate/DataValidatorTest.js: Add tests.
* src/validate/ValidStateMonitor.js
(update): Enforce Store diff.
Wait to process failures until fixes are calculated.
(_checkFailureFix): Handle asynchronous, Promise-based diff.
(_checkCauseFix): Extract logic from _checkCauseFix.
* test/validate/ValidStateMonitorTest.js:
Modify test cases to be Promise-based and handle async calls where
appropriate. That was a friggin' expensive mess.
DEV-2296
This extracts some gross code from Client in the rating-fw repo, which
is responsible for gluing change validations together.
* src/validate/DataValidator.js: Add class.
* test/validate/DataValidatorTest.js: Add test case.
DEV-2296
Stepping stone to async. fix checks.
* src/validate/ValidStateMonitor.js
(update, detectFixes, _checkFailureFix): Return Promise.
* test/validate/ValidStateMonitorTest.js: Update to use promises.
DEV-2296
In newer versions of node, this flag goes away and it is enabled by
default.
* Makefile.am (test): Add NODE_DESTRUCTURE to mocha invocation.
* configure.ac (NODE, NODE_DESTRUCTURE): Add variables.
DEV-2296
Nice and trivial with the new easejs transparent error subtyping!
* src/store/StoreMissError.js: Add error class.
* src/store/MemoryStore.js (get): Use it.
* test/store/MemoryStoreTest.js (#get): Modify test to expect type.
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.