Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version bump 0.{9.1=>10.0}v0.10.0Mike Gerwitz2017-02-081-2/+2
|
* Clear class failures on field hideMike Gerwitz2017-02-088-126/+393
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Integrate field visibility event handlerMike Gerwitz2017-02-082-92/+35
| | | | | | | | | | | | | | | | | | | | | | * src/client/Client.js (_hideField): Remove method (extracted into FieldVisibilityEventHandler). (handleEvent): Remove show/hide handling. (_handleClassMatch): Adjust to new class/API. * src/client/ClientDependencyFactory.js (createClientEventHandler): Add show/hide event handlers.
| * FieldVisibilityEventHandler: Add classMike Gerwitz2017-02-082-0/+256
| | | | | | | | | | | | | | | | This extracts code from internal lovullo repo rating-fw (originally Client#_hideFields), 5d4019f1973f9271f4b1bd24ce1f55b56ccda09e. * src/event/FieldVisibilityEventHandler.js: Add class. * test/event/FieldVisibilityEventHandlerTest.js: Add test case.
| * DataValidator, ValidStateMonitor: Add #clearFailures argumentMike Gerwitz2017-02-084-34/+102
|/ | | | | | | | | | | | | | This allows clearing only the specified failures. * src/validate/ValidStateMonitor.js (clearFailures): Add `fields' argument. Make method more concise. (_fixFailure): Handle clearing `_failures' record. * src/validate/DataValidator.js (clearFailures): Add `fields' argument. * test/validate/ValidStateMonitorTest.js: Add test. * test/validate/DataValidatorTest.js: Add test.
* Liberate ClientDebug classesMike Gerwitz2017-02-087-0/+2139
| | | | | | | | | | | | | 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.
* Client: Extract from internal repoMike Gerwitz2017-02-072-0/+3470
| | | | | | | | | | | | | | | | 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.
* tools/gen-index: Generate gettersMike Gerwitz2017-02-071-2/+2
| | | | | | | | | | | | 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.
* UnknownEventError: use ease.jsMike Gerwitz2017-02-061-13/+5
| | | | | | ease.js supports Error extending now. * src/event/UnknownEventError.js: Use easejs.
* Liberate event handlersMike Gerwitz2017-02-068-0/+728
| | | | | These are extracted from rating-fw commit 5d4019f1973f9271f4b1bd24ce1f55b56ccda09e.
* configure.ac: fix harmony destructuring flagMike Gerwitz2017-02-061-1/+1
| | | | :x
* Version bump 0.9.{0=>1}v0.9.1Mike Gerwitz2017-02-021-1/+1
|
* Ability to clear all errors on ValidStateMonitorMike Gerwitz2017-02-024-1/+128
|\
| * DataValidator, ValidStateMonitor: Add #clearFailuresMike Gerwitz2017-02-024-1/+128
| | | | | | | | | | | | | | | | * src/validate/DataValidator.js (clearFailures): Add public method. * test/validate/DataValidatorTest.js: Add #clearFailures test. * src/validate/ValidStateMonitor.js (clearFailures): Add public method. * test/validate/ValidStateMonitorTest.js: Add #clearFailures test.
* | Version 0.{8=>9}.0 bumpv0.9.0Mike Gerwitz2017-01-301-1/+1
| |
* | Consider classification changes on failed fieldsMike Gerwitz2017-01-3018-323/+2103
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * system.client: working data.diffStoreMike Gerwitz2017-01-302-6/+63
| | | | | | | | | | | | | | * src/system/client.js (data.diffStore): Compose all stores. * test/system/clientTest.js: Update test case. DEV-2296
| * DataValidator: accept classification resultsMike Gerwitz2017-01-302-37/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * ValidStateMonitor: handle empty diff on past failureMike Gerwitz2017-01-302-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add DiffStoreMike Gerwitz2017-01-302-0/+528
| | | | | | | | | | | | | | * src/store/DiffStore.js: Add class. * test/store/DiffStoreTest.js: Add test case. DEV-2296
| * Update MemoryStore syntax to ES6Mike Gerwitz2017-01-301-14/+9
| | | | | | | | | | | | | | | | `#reduce` is much better. * src/store/MemoryStore.js: Update syntax. DEV-2296
| * Store#clear to return selfMike Gerwitz2017-01-303-3/+15
| | | | | | | | | | | | | | | | * src/store/MemoryStore.js (clear): Promise resolve to self. * src/store/Store.js (clear): Update docblock. * test/store/MemoryStoreTest.js: Update test case accordingly. DEV-2296
| * Add PatternProxy Store traitMike Gerwitz2017-01-303-0/+417
| | | | | | | | | | | | | | | | | | | | 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
| * ES6-ify ValidStateMonitorMike Gerwitz2017-01-291-74/+50
| | | | | | | | | | | | | | | | | | This also helps to demonstrate how the more concise syntax improves readability. * src/validate/ValidStateMonitor.js: Syntax to ES6. DEV-2296
| * Store#add to return selfMike Gerwitz2017-01-294-16/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for Promise chaining (and consequently temporary classes, great for testing). * src/store/MemoryStore.js (add): Resolve promise to self. Modify docblock. * src/store/Store.js (add): Modify docblock. * src/store/Cascading.js (add): Modify docblock. * test/store/MemoryStoreTest.js: Modify test accordingly. DEV-2296
| * Began system/ with clientMike Gerwitz2017-01-292-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Integrate Store into DataValidator, ValidStateMonitorMike Gerwitz2017-01-294-314/+578
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Add DataValidatorMike Gerwitz2017-01-272-0/+288
| | | | | | | | | | | | | | | | | | | | 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
| * Make BucketDataValidator public methods virtualMike Gerwitz2017-01-271-2/+2
| | | | | | | | | | | | | | | | | | This class is terribly factored and not tested. * src/validate/BucketDataValidator.js (validate,format): Make methods virtual. DEV-2296
| * ValidStateMonitor#update return PromiseMike Gerwitz2017-01-272-82/+147
| | | | | | | | | | | | | | | | | | | | 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
| * Use node --harmony-destructuring when availableMike Gerwitz2017-01-272-1/+16
|/ | | | | | | | | | 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
* Add test/ to distributionv0.8.0Mike Gerwitz2017-01-061-1/+1
| | | | Makefile.am (EXTRA_DIST): Add test/
* Remove Makefile from distMike Gerwitz2017-01-061-1/+1
| | | | | | This does not belong here. * Makefile.am (EXTRA_DIST): Remove Makefile
* Version bump 0.{7.2=>8.0}Mike Gerwitz2017-01-061-1/+1
|
* Add storeMike Gerwitz2017-01-069-4/+1075
|\
| * Test to ensure Cascading does not clear selfMike Gerwitz2017-01-041-0/+14
| | | | | | | | | | * test/store/CascadingTest.js: Test that Cascading store does not clear itself.
| * Add StoreMissErrorMike Gerwitz2017-01-043-4/+39
| | | | | | | | | | | | | | | | 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.
| * Add MissLookup traitMike Gerwitz2017-01-042-0/+326
| | | | | | | | | | * src/store/MissLookup.js: Add trait. * test/store/MissLookupTest.js: Add test case.
| * Make {,Memory}Store asynchronousMike Gerwitz2017-01-044-86/+195
| | | | | | | | | | This isn't terribly useful as a general-purpose cache if it can't handle async requests.
| * Add chai-as-promisedMike Gerwitz2017-01-031-4/+5
| | | | | | | | * src/package.json.in (devDependencies): Add chai-as-promised.
| * Add store.CascadingMike Gerwitz2017-01-032-0/+176
| | | | | | | | | | * src/store/Cascading.js: Add trait. * test/store/CascadingTest.js: Add test case.
| * Add {,Memory}StoreMike Gerwitz2017-01-033-0/+410
|/ | | | | | * src/store/Store.js: Add interface. * src/store/MemoryStore.js: Add class. * test/store/MemoryStoreTest.js: Add test case.
* Add missing license to package.jsonMike Gerwitz2016-12-211-0/+1
| | | | * package.json.in (license): Add key.
* Add Currency and StringFormat formattersMike Gerwitz2016-12-065-4/+520
|\
| * Add Currency formatterMike Gerwitz2016-12-011-0/+36
| | | | | | | | * src/validate/formatter/Currency.js: Add class.
| * Replace Currency formatter with StringFormatMike Gerwitz2016-12-014-135/+293
| | | | | | | | | | | | | | | | | | | | 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.
| * Validate correct Number formatMike Gerwitz2016-12-012-2/+18
| | | | | | | | | | | | | | * src/validate/formatter/Number.js (parse): Validate number format. * test/validate/formatter/NumberTest.js: Modify accordingly.
| * Add scale to Number formatterMike Gerwitz2016-12-012-3/+174
| | | | | | | | | | | | | | | | | | | | * src/validate/formatter/Number.js (__mixin): Add mixin ctor. (parse): Handle scale. (styleNumber): Handle scale. (scale, split): Add methods. * test/validate/formatter/NumberTest.js: Modified accordingly.
| * Add Currency formatterMike Gerwitz2016-11-282-0/+135
| | | | | | | | | | * src/validate/formatter/Currency.js: Add trait. * test/validate/formatter/CurrencyTest.js: Add test case.
| * Correct Number formatter docblockMike Gerwitz2016-11-281-1/+1
|/ | | | * src/validate/formatter/Number.js: Correct trait docblock.