Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Version bump v0.11.{3=>4}v0.11.4Mike Gerwitz2017-03-171-1/+1
|
* Handle fixes triggered by scalar diffsMike Gerwitz2017-03-174-6/+157
|\
| * FieldStyler: Remove classes not added by #addClassMike Gerwitz2017-03-172-4/+103
| | | | | | | | | | | | | | | | | | | | This code assumed that no classes would be removed that were _not_ added by #addClass. Well, that's false. * src/ui/styler/FieldStyler.js (removeClass): Consider both spaces and boundary preceding class name. * test/ui/styler/FieldStylerTest.js: Add test case.
| * ValidStateMonitor: Consider scalar diff to affect all indexesMike Gerwitz2017-03-172-2/+54
|/ | | | | | | | | | | Classifications often yield scalar results. Since those results are used directly in the diff, we have the situation where the expected diff format (an array) is not provided. Consistent with the rest of the system, we should consider a scalar to affect every index. * src/validate/ValidStateMonitor.js (_checkCauseFix): Consider scalar diffs to affect every index when checking for fixes. * test/validate/ValidStateMonitorTest.js: Add test.
* Version bump 0.11.{1=>2}v0.11.3Mike Gerwitz2017-02-221-1/+1
|
* Clear validation failures on dapi request completionMike Gerwitz2017-02-224-1/+93
|\
| * ValidStateMonitorTest: remove accidental `debugger'Mike Gerwitz2017-02-221-1/+0
| | | | | | | | | | | | Didn't mean for this to be committed. * test/validate/ValidStateMonitorTest.js: Remove `debugger'.
| * Client: clear validation errors on dapi fieldLoadedMike Gerwitz2017-02-221-0/+6
| | | | | | | | | | | | | | | | | | Previously, the system relied on the preStagingUpdate StagingBucket event to do this implicitly, but that is no longer kicked off when the diff doesn't produce any bucket changes. * src/client/Client.js (_createProgram) [dapi]: Clear validation failures on dapi fieldLoaded.
| * DataApiManager: emit fieldLoaded after request completesMike Gerwitz2017-02-222-0/+87
|/ | | | | | | | | | | | The intent of this is to allow for clearing errors after fields load (e.g. a "field loading" message if the user attempts to continue past the step when a field hasn't yet finished loading). * src/dapi/DataApiManager.js (getApiData): Emit fieldLoaded after request completes. * test/dapi/DataApiManagerTest.js: Add test case. DEV-2299
* Version bump 0.11.{1=>2}v0.11.2Mike Gerwitz2017-02-211-1/+1
|
* DataValidator: properly chain queueMike Gerwitz2017-02-212-20/+24
|\
| * DataValidator: properly chain queueMike Gerwitz2017-02-212-20/+24
|/ | | | | | | | | This was not properly chain the promises---it was always chaining on the original _pending (so, the first request) and never clearing _pending after that point. * src/validate/DataValidator.js (_onceReady): Properly chain. * test/validate/DataValidatorTest.js: Updated test. Don't ask.
* Version bump v0.11.{0=>1}v0.11.1Mike Gerwitz2017-02-211-1/+1
| | | | * configure.ac: Bump version.
* Validation monitoring fixesMike Gerwitz2017-02-218-77/+1609
|\ | | | | | | | | | | | | | | | | | | | | | | | | This does two things: - Ensures previous validation requests are complete before processing another, preventing internal state from being screwed up; and - Prevents empty diffs from triggering staging bucket events, which is both a performance benefit and stops ValidStateMonitor from getting confused and immediately marking failures as fixed in certain circumstances.
| * StagingBucket: Use strict mode (and fix accidental globals)Mike Gerwitz2017-02-201-28/+32
| | | | | | | | | | | | | | | | This fixes accidental global variables and enables strict mode to prevent it in the future. * src/bucket/StagingBucket.js: Enable strict mode. Use const/let where appropriate instead of var.
| * StagingBucket: Do not process non-changesMike Gerwitz2017-02-202-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since changes trigger any event observers---which can be expensive---it is ideal to ignore sets that do not result in any changes to the bucket. This also resolves issues with systems that are confused by empty diffs. * src/bucket/StagingBucket.js (_hasChanged): Add method. (setValues): Use it. * test/bucket/StagingBucketTest.js: Add test case. DEV-2299
| * Liberate numerous bucket classesMike Gerwitz2017-02-175-4/+1132
| | | | | | | | | | | | | | | | * src/bucket/DelayedStagingBucket.js: Add class. * src/bucket/QuoteDataBucket.js: Add class. * src/bucket/StagingBucket.js: Add class. * src/bucket/StagingBucketAutoDiscard.js: Add class. * src/client/ClientDependencyFactory.js: Add class.
| * DataValidator: Hold concurrent requestsMike Gerwitz2017-02-172-28/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | Since we maintain state (as a kluge for the time being to integrate with the rest of the system), we need to be careful to protect against concurrent requests that might mess with it before the original request is complete. * src/validate/DataValidator.js (validate, updateFailures): Hold concurrent requests. (_onceReady): Add method. * test/validate/DataValidatorTest.js: Add tests.
| * Revert "DataValidator: Always clear store state"Mike Gerwitz2017-02-162-39/+1
| | | | | | | | | | | | | | This breaks everything. :x This reverts commit e0c2e4dc861d523c40b2d35a242e48b8b7c99662, reversing changes made to e610372c8443ba5c5e73ed0791e642d82772d5cd.
| * DataValidatorTest: Extract boilerplate instantiation (cleanup)Mike Gerwitz2017-02-161-51/+46
| | | | | | | | | | | | | | | | Tidy up a little bit; this thing is a mess and hard to work with. * test/validate/DataValidatorTest (createStubs): Add function. Use it.
| * Add missing #updateFailures testMike Gerwitz2017-02-161-0/+52
| | | | | | | | | | | | Not sure how this was missing...! * test/validate/DataValidatorTest.js: Add test.
| * DataValidator: Queue validations when incompleteMike Gerwitz2017-02-162-2/+91
|/ | | | | | | | | * src/validate/DataValidator.js (validate): If a validation is ongoing, queue requests. * test/validate/DataValidatorTest.js: Add test. DEV-2299
* Version bump v0.{10.2=>11.0}v0.11.0Mike Gerwitz2017-02-161-1/+1
|
* Program UI testing libraryMike Gerwitz2017-02-164-0/+299
|\
| * Testing utilities for stubbing ProgramMike Gerwitz2017-02-154-0/+299
| | | | | | | | | | | | | | | | | | | | This allows for testing assertions. It's fairly primitive, but will work for the time being. * src/test/README: Add file. * src/test/program/DummyClassifier.js: Add module. * src/test/program/Program.js: Add class. * src/test/program/util.js: Add module.
* | Version bump v0.10.{1=>2}v0.10.2Mike Gerwitz2017-02-141-1/+1
| |
* | DataValidator: Always clear store stateMike Gerwitz2017-02-142-1/+41
|\ \ | |/ |/|
| * DataValidator: Always clear store stateMike Gerwitz2017-02-132-1/+41
|/ | | | | | | | | | | | | In practice, not clearing the store and allowing it to use previous state has the effect of instantly "fixing" failures if there happens to be more than one validation call. This was a log of debugging for a one-line change. * src/validate/DataValidator.js (_populateStore): Always clear store. * test/validate/DataValidatorTest.js: Add test. DEV-2299
* Version bump 0.10.{0=>1}v0.10.1Mike Gerwitz2017-02-101-1/+1
|
* FieldVisibilityEventHandler: Use new DataValidator APIMike Gerwitz2017-02-102-4/+5
|\
| * FieldVisibilityEventHandler: use new DataValidator APIMike Gerwitz2017-02-092-4/+5
|/ | | | | | | | | | | | | | I updated DataValidator but never updated the caller. Damnit. It's an unfortunate side-effect of dynamic, loosely typed languages and mitigating it requires what should be boilerplate functional tests (in this case---functional tests are useful for many other integration aspects). * src/event/FieldVisibilityEventHandler.js (handle): Use updated DataValidator#clearFailures API, which has a different descriptor format. * test/event/FieldVisibilityEventHandlerTest.js: Update test.
* 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