1
0
Fork 0
Commit Graph

451 Commits (master)

Author SHA1 Message Date
Mike Gerwitz e058c8b509 Copyright range update
All files now have the same range, beginning from the conception of this
project.
2019-08-30 09:41:35 -04:00
Mike Gerwitz 2c49156ba3 controller: Add missing returns
This was broken when the controller was made async; the returns were
converted into resolves.
2019-08-28 15:17:04 -04:00
Schaffer, Austin 858efdce84 [DEV-5752] Allow override for dynamic submit messages 2019-08-01 15:53:13 -04:00
Mark Goldsmith 6e99e65167 [DEV-5618] Expose meta bucket to init route 2019-08-01 12:20:22 -04:00
Sarah Chintomby c55235d7d4 [DEV-5546] Move edge case code for month 2019-06-18 12:14:36 -04:00
Sarah Chintomby 716f2b1a32 [DEV-5546] Update to use setUTCDate 2019-06-18 12:14:36 -04:00
Sarah Chintomby 3372e433d7 [DEV-5546] Update getdate to universal time 2019-06-18 12:14:36 -04:00
Sarah Chintomby 8f0b12bd3a [DEV-5546] Change getdate to getUTCDate 2019-06-18 12:14:36 -04:00
Sarah Chintomby 53f3e2317e [DEV-5546] Fix calc relativedate for day and also month concerning edge cases 2019-06-18 12:14:36 -04:00
Austin Schaffer 9637fc22e1 [DEV-5333] Pass last rated date from the server quote back to the client quote
Correct and add more elaborate tests for RateEventHandler
2019-06-17 08:28:19 -04:00
Austin Schaffer 23889cbfca [DEV-5333] Use the correct function for day calculations 2019-06-14 10:40:49 -04:00
Austin Schaffer 723a7f7ff7 [DEV-5333] Expose initialRatedDate to the client from the bucket
[DEV-5333] WIP

Add RateEventHandlerTest and fix RatingServiceSubmitNotifyTest

WIP: Add RateEventHandlerTest

Add stubs for RateEventHandlerTest

Finish RateEventHandlerTest

Move done to fix test bug
2019-06-14 10:40:46 -04:00
Joseph Frazer 2f0fea8f49 Revert "[DEV-5492] Do not unserialize PHP objects in _sf2_attributes"
This reverts commit 981ba45d7c, reversing
changes made to e5917418fa.
2019-06-11 10:36:07 -04:00
Joseph Frazer 5b08c981c3 [DEV-5492] Do not unserialize PHP objects in _sf2_attributes
The PHP objects in the session from PHP7 cannot be unserialized. Since
they are not needed, we can safely ignore them.

Co-Authored-By: Jim Grundner <james.grundner@rtspecialty.com>
2019-06-10 11:19:04 -04:00
Mark Goldsmith 6e65b1f1e6 [DEV-5255] Fix setStartDate to use startData 2019-06-06 15:29:01 -04:00
Andrew Fanton 0be64040f8 [DEV-3514] Fix bug with expiration date calculation
The nature of this bug was two-fold:
1.) A new Date was being instantiated with seconds,
but the constructor expects milliseconds.
2.) The expiration period was not cast to a number,
causing an expression to concatenate strings instead of
adding numeric values; this greatly increased the actual
expiration date.
2019-05-30 14:29:55 -04:00
Austin Schaffer c1082d2a9d [DEV-5254] Expose lastPremDate for the data warehouse 2019-05-30 10:15:25 -04:00
Andrew Fanton f569a7e94d [DEV-3514] Display message explaining why quote is locked
Prior to this change, a single generic message was always shown simply
stating that the quote had been locked. These changes now allow for
different messages to be displayed in different circumstances.
2019-05-28 16:33:08 -04:00
Andrew Fanton 5a5c2ca629 [DEV-3514] Lock quotes that exceed expiration date 2019-05-28 16:33:05 -04:00
Herbert Burzlaff 7ac88d6e55
DEVOPS-151: code changes to support mongodb HA (Replication) 2019-05-08 17:05:30 -04:00
Mike Gerwitz c0feed41e9 src/calc/Calc.js (relativeDate): Default format to empty string
We shouldn't throw errors given an empty array for this value.

* src/calc/Calc.js (relativeDate): Default `format' in `_each' call.
2019-04-26 11:02:49 -04:00
Mike Gerwitz 90802edc03 RatingServicePublish: Publish to {queue=>exchange}
This now publishes to a fanout exchange instead of a queue, which allows
consumers to handle their own queue configuration.

This also adds some basic logging that was missing from the first version.

Note that I still don't consider this to be production-quality code; it's
missing tests, and there's still notes that need to be addressed.
2019-04-03 10:43:58 -04:00
Mark Goldsmith aedf8ceed8 RatingServicePublish:_sendMessage passes program_id 2019-03-27 15:01:24 -04:00
Mike Gerwitz 77ddbbef3b Exclusively use RatingServicePublish over submit URL 2019-03-26 11:01:16 -04:00
Mike Gerwitz 98d81c2f2f RatingServicePublish: Close connections after a timeout
Until we have a better option.

I really hate that all of this is rushed.
2019-03-21 16:34:41 -04:00
Mike Gerwitz c4591f681d Daemon: Return promise for post_rate reduction
This was causing a race condition in some environments.
2019-03-21 14:56:42 -04:00
Mike Gerwitz b8801c039f RatingServicePublish: New trait (mostly proof-of-concept)
This is unfortunately not production-ready code, but we need to get
something out there in the meantime.  The RatingServicePublish's docblock
mentions some of the shortcomings, which will be addressed in the near
future.

There is also more documentation to come once we settle on an implementation.

DEV-4400
2019-03-21 14:08:00 -04:00
Mike Gerwitz 814b0ff3a0 Client: Fix forward-validation failure messages
Forward validation failures were never updated to use the new Failure
object, so they ended up showing the default message.  The problem was that
`ui.invalidateForm' was replacing the Failure object with a new one with an
empty message.

This change just does the same thing as the change and save events.

* src/client/Client.js (_forwardValidate): Invoke `#_genValidationMessages'
    and `_dataValidator.updateFailures'.  Stop calling `ui.invalidateForm'.
2019-03-07 16:13:36 -05:00
Mark Goldsmith 04565a6559 [DEV-4452] Accordion margin applies to collapsable header only 2019-03-01 10:02:39 -05:00
Mike Gerwitz 20234bd906 db: Restore previous save-all-meta behavior
It looks like the metabucket is never initialized, so saving the quote is
right now the only thing that sets default values.  That should be fixed in
the future.

This also begins adding tests for the terrible MongoServerDao, that could
use some refactoring.

* src/server/db/MongoServerDao.js: Make `meta' mutable.  I had forgotten to
    remove the code that mutates it (since our version of v8 right now does
    not blow up for const assignments), so this is all that's needed.
* test/server/db/MongoServerDaoTest.js: New file to test this situation.
2019-02-12 09:18:48 -05:00
Mike Gerwitz 13716d240b server: Correct liza_timestamp_initial_rated to be a vector
The metabucket expects vectors, not scalars.  This causes the value
to be inaccessible when loaded by the ProcessManager for rating,
because it uses the Bucket implementation expecting vectors.

This wasn't noticed at first because it works through TAME's map.

* doc/bucket.texi (Metabucket): Clarify expected data format.
* src/server/db/MongoServerDao.js (saveQuote): Store
    `meta.liza_timestamp_initial_rated' as a vector.
2019-02-07 09:57:45 -05:00
Mike Gerwitz 833017c359 server: Auto-populate liza_timestamp_initial_rated in metabucket
This value already existed on the document, but was inaccessible to external
systems.  This is now accessible to e.g. raters.

* doc/bucket.texi (Metabucket): New section.
* src/server/db/MongoServerDao.js (saveQuote): Set initial quoted date as
    liza_timestamp_initial_rated.  Update metabucket keys individually so as
    not to inadvertently overwrite the entire metabucket.

DEV-3715
2019-02-05 16:01:59 -05:00
Joseph Frazer a2d1ea706a [DEV-4338] Change behavior of default data
Default data was converted to an empty array if the data evaluated to
false. We only want to convert it if it is undefined so values that are
false remain false.
2019-02-04 08:09:19 -05:00
Mike Gerwitz e4047b52cc src/css/base.css: Style Accordion group
Note that this permits animation if you just add:

  transition: transform 0.25s;

for example to `dt.stack-header::before'.  I didn't add that because nothing
else is animated atm, and so it seems out-of-place.

* src/css/base.css: Add styling for Accordion group.

DEV-3989
2019-01-17 12:10:10 -05:00
Mike Gerwitz 2ecaeb568b Add basic Accordion group extending Stacked group
* src/client/ClientDependencyFactory.js: Remove old AccordionGroupUi
    require, add new one.
* src/ui/group/AccordionGroupUi.js: New class.
* src/ui/group/GroupUi.js (postAddRow): Make virtual.
2019-01-17 12:10:09 -05:00
Mike Gerwitz 6b3ab89e77 dapi: Fix *_label setting
The `*_label' fields were not being properly set because they were being
considered just as every other expanded field, which is subject to other
considerations to ensure that we do not overwrite user data.  Label fields,
on the other hand, _must_ always be set whenever the value changes, and are
_not_ modifiable by the user.

This codifies that `_label' assumption that I would like removed in the
future, but time does not permit that sort of refactoring right
now.  Ideally, labels would be treated generically like any other expanded
field and have an attribute set of them that would change their expansion
behavior.

* src/client/dapi/DataApiMediator.js (_updateFieldData): Pass label field id
    to `_populateWithMap'.
  (_populateWithMap): Use it to always populate the label field when the key
    matches, ignoring the other expansion criteria that would inhibit it.
* test/client/dapi/DataApiMediatorTest.js: Update test accordingly.
* src/dapi/DataApiManager.js (triggerFieldUpdate): Provide id to
    `_genUiFieldData'.
  (_genUiFieldData)[label_id]: New field.  Return it as part of the return
    object's `label_id' field.

DEV-4077
2018-12-17 13:32:00 -05:00
Joseph Frazer b037339bce [DEV-3731] Change visibility of postProcessResults method
The postProcessResults method occasionally failed to be overridden in
local environments due to issues with how npm handled its dependencies.
For some reason, changing this to a public method corrected the issue. I
am changing this to, hopefully, prevent future frustrations.
2018-11-29 11:33:42 -05:00
Mike Gerwitz f9f7cebce7 Accommodate ancient qtype data on init and clean
* src/program/ProgramInit.js (_isKnownType): Account for ancient qtype
    representation (as a string).
* src/server/quote/ProgramQuoteCleaner.js (_isKnownType): Likewise.
* test/program/ProgramInitTest.js: New test case for this situation.
* test/server/quote/ProgramQuoteCleanerTest.js: Modify existing test case
    for this situation.
2018-11-19 11:10:16 -05:00
Mike Gerwitz e3b73f3b36 TabbedBlockGroupUi: Ignore default index selection if missing
If only one supplier returns this datum and that supplier is ineligible,
then the value may not exist if this is not defined as an external
value.  (Really, that's the bigger problem, but let's be resilient.)

* src/ui/group/TabbedBlockGroupUi.js (visit): Ignore missing index value.
2018-11-14 11:53:02 -05:00
Mike Gerwitz ecdfea5cdb ProgramInit: Do not initialize bucket values for undefined question types
These denote fields that are generated but do not actually have any data
associated with them.  For example, select options with predicates have a
field generated so that they contribute to the group field count (so that
the group will automatically show/hide appropriately), but those should
never have values associated with them in the bucket.

This was manifesting as a nasty bug:  The bucket contained a key for
generated options.  When the quote is loaded, the client "empties" the
bucket.  In doing so, it set the option value to the empty string, which had
the effect of rendering the dropdown useless---every value was the empty
string!

* src/program/ProgramInit.js (_isKnownType): New method.
  (init): Use it and ignore fields with unknown types.
* src/server/Server.js: Add note that we shouldn't have this logic
  duplicated between ProgramInit and ProgramQuoteCleaner.
* src/server/quote/ProgramQuoteCleaner.js (_fixGroup): Ignore fields with
    unknown types.
  (_isKnownType): New method.
* test/program/ProgramInitTest.js: Update existing tests.  Add new.
* test/server/quote/ProgramQuoteCleanerTest.js: Test this case.
2018-11-14 11:52:52 -05:00
Joseph Frazer 85ac34ebbd [DEV-3866] allow checkboxes to be unchecked 2018-11-06 11:51:22 -05:00
Joseph Frazer a3b5dd286f [DEV-3866] handle checkbox default values properly
The "checkbox" questions belong to the group of questions that change
the "checked" attribute rather than the "value" attribute.
2018-11-05 16:26:11 -05:00
Joseph Frazer a8d0b8c817 [DEV-3866] changes for new checkbox question type
The new checkbox question type is setup with an empty validator. When
checked, it was not unchecking because it was trying to behave like the
"noyes" questions. I updated the logic to not behave like that if there
is only one checkbox in a group.
2018-11-05 11:34:33 -05:00
Mike Gerwitz 2bc1b96a15 ProgramQuoteCleaner: Clean all groups (not just linked)
* src/server/quote/ProgramQuoteCleaner.js (clean): Add docblock.
    Replace previous linked group cleaning with call to `_fixGroup'.
  (_fixGroup): New method.  Similar logic to previous linked group cleaning,
    except that fields are never truncated.
  (_fixLinkedGroups, _getLinkedIndexLength): Remove methods.
  (_getGroupLength): New method determining group size from leader length,
    which also accounts for linked groups.
* test/server/quote/ProgramQuoteCleanerTest.js: New test case.
2018-10-21 23:41:58 -04:00
Mike Gerwitz 27cc3d2c63 Program#cmatchCheck: Add more informative third argument
* src/program/Program.js (cmatchCheck)[cdata]: New argument to try to disambiguate
    empty indexes while maintaining BC with existing quirky behavior.
2018-10-16 10:28:19 -04:00
Joseph Frazer 0a01456a46 [DEV-3284] Remove references to "LoVullo" 2018-09-27 10:07:08 -04:00
Joseph Frazer aed5ddd1b7 Revert "[DEV-3011] Add validation and style for datalists"
This reverts commit 394dde7de7.
2018-09-24 11:03:30 -04:00
Joseph Frazer e17ace40ed Revert "[DEV-3011] Do not use "Number" validator for datalists."
This reverts commit e064378c99.
2018-09-24 11:03:27 -04:00
Joseph Frazer e064378c99 [DEV-3011] Do not use "Number" validator for datalists. 2018-09-12 13:50:52 -04:00
Joseph Frazer 394dde7de7 [DEV-3011] Add validation and style for datalists 2018-09-12 12:29:40 -04:00
Jeffrey Fisher 0f9ae0d08e [DEV-3497] Updated selection if selection is disabled 2018-08-30 13:55:57 -04:00
Jeffrey Fisher ee5306a279 [DEV-3497] Updated variable name 2018-08-30 10:24:21 -04:00
Jeffrey Fisher 43596eeed7 [DEV-3497] Updated tabbed block to use default selection 2018-08-29 13:33:41 -04:00
Joseph Frazer dc39c636a4 [DEV-3393] Merge branch 'jira-3393' of gitlab.lovullo.com:floss/liza into jira-3393 2018-08-16 10:01:20 -04:00
Joseph Frazer b4ecb5a14c [DEV-3393] Made sure the entity id is a number 2018-08-16 07:35:52 -04:00
Joseph Frazer 11a565422a [DEV-3393] Use the correct variable name 2018-08-15 16:13:35 -04:00
Joseph Frazer c61c1196c4 [DEV-3393] Chnage property type to correct type 2018-08-15 15:14:10 -04:00
Joseph Frazer 52491c1ce0 [DEV-3393] The entity id should not be sent unless the request is
internal.
2018-08-15 15:10:13 -04:00
Joseph Frazer 4b1fda57b8 [DEV-3393] minor changes to improve code quality 2018-08-15 15:05:21 -04:00
Joseph Frazer eb980f4fb7 [DEV-3393] Replace UNIX with Unix 2018-08-15 14:48:48 -04:00
Mike Gerwitz 2b93a0bbe4 [bugfix] Daemon: Do not un-initialize controller no_result_url
* src/server/daemon/Daemon.js (getProgramController): Do not initialize
  `no_results_url' to an empty string if not provided; instead, keep any
  existing value.  Otherwise, later calls with no arguments will clear
  previously-set values.

DEV-3254
2018-08-15 14:22:01 -04:00
Joseph Frazer 2c0bf764d1 [DEV-3393] Add more metadata to the init endpoint 2018-08-15 14:06:07 -04:00
Mike Gerwitz cd56bae358 DataApiMediator: Do not check bucket value until after stack clears
This further highlights that we probably should not be handling this
here.  We want to ensure that we check the state of the bucket right before
we're about to do option setting, otherwise we could be in an inconsistent
state (looking at old data).

* src/client/dapi/DataApiMediator.js (_updateFieldData): Check bucket after
  stack clears (along with all other operations).
2018-08-13 12:29:35 -04:00
Mike Gerwitz e24038503b [bugfix] DapiMediator: Wait for stack to clear before updating options
This allows the UI to update before we add elements.  This really isn't the
best place to do this, but it will do for now.

DEV-3257
2018-08-10 15:25:29 -04:00
Mike Gerwitz b47deedf9c [DEV-3257] DataApiMediator: Set bucket data after stack clear
Allowing the stack to clear ensures that (in practice) DelayedStagingBucket
is given a chance to do necessary processing before data are requested from
it by bucket hooks as a result of _this_ invocation, which in turn
results (in some cases) in infinite recursion.

* src/client/dapi/DataApiMediator.js (_updateFieldData): Allow stack to
    clear before invoking `quote.setData'.
* test/client/dapi/DataApiMediatorTest.js: Test respectively.

DEV-3257
2018-08-10 13:33:54 -04:00
Mike Gerwitz 9243eeb8bc [DEV-3257] DelayedStagingBucket: Preempt infinite recursion on #processValues
* src/bucket/DelayedRecursionError.js: New class.
* src/bucket/DelayedStagingBucket.js: Update copyright and docblock.
  (_processing): New field.
  (getDataByName): Check against undefined before invoking
    `#processValues'.
  (processValues): Increment lock (_withProcessLock).
  (_withProcessLock): Error on recursion >= 5.

DEV-3257
2018-08-10 11:17:13 -04:00
Mike Gerwitz 9f944bb7ec DelayedStagingBucket: Remove this.__super workaround
This was fixed in GNU ease.js 0.2.0 (which was released years ago).
2018-08-02 14:47:26 -04:00
Mike Gerwitz 7fd07f00e9 Client: Default dapimap to empty object
Without this, we have a BC break.

* src/client/Client.js (_init): Default program.dapimap to DataApiMediator
  instance to an empty object to maintain BC.
2018-07-18 16:52:04 -04:00
Mike Gerwitz abc2564d9c DataApiMediator: Do not auto-expand into populated fields
* src/client/dapi/DataApiMediator.js (_populateWithMap): Update
    docblock.  Ignore field during expansion if it would overwrite an
    existing value.
* test/client/dapi/DataApiMediatorTest.js: Update tests data to include
    values for all bucket fields, not just `name'.  Add test for new
    condition.

DEV-3257
2018-07-17 15:44:37 -04:00
Mike Gerwitz 839952a56d [DEV-3257] DataApiMediator: Auto-expand into fields on reply [*]
[*] You should not use this commit directly since this may wipe out data in
fields the user has changed.  See future commit where this situation is
properly handled.

* src/client/Client (_init): Provide dapimap to DataApiMediator instance.
* src/client/dapi/DataApiMediator.js
  (_dapi_map): New field.
  (constructor): Accept dapimap.  BC break (which is okay, since this is
    still part of a topic branch).  Assing to _dapi_map.  Update docblock.
  (monitor): Bind `dapi_manager' to first argument of handlers.
  (_updateFieldData): Accept `dapi_manager' as first argument.  Use
    `_populateWithMap' to generate additional update data.
  (_populateWithMap): New method.
  (_clearFieldFailures): Accept `dapi_manager' as first argument.
* src/dapi/DataApiManager.js: Update copyright year.
  (getDataExpansion): Return empty object (consistent with interface) rather
    than `undefined' when field value is undefined.  Use
    {Error=>MissingDataError} when field data are missing.  Throw instead of
    emit.  Fix missing comma in var declarations.
* src/dapi/MissingDataError.js: New class.
* test/client/dapi/DataApiMediatorTest.js: Update test data to test field
    expansion.  New test against ignoring field expansion when data are not
    available.  Update Sut constructors of other tests for new dapimap
    parameter.

DEV-3257
2018-07-17 15:44:37 -04:00
Mike Gerwitz 160ab01f9a DataApiMediator: setData{ByName=>} to prepare for multi-field set
See following commit.

* src/client/dapi/DataApiMediator.js (_updateFieldData):
  `setData{ByName=>}'.
* test/client/dapi/DataApiMediatorTest.js: Update respective tests.

DEV-3257
2018-07-17 15:44:37 -04:00
Mike Gerwitz e25bec5ac0 DataApiMediator: New class
This extracts existing code from Client and adds tests.  The glue code is
far from ideal and highlights the amount of work needed to decouple Client
from so many parts of the system.

* src/client/Client.js (_dapiManager): New field.
  (_init): Use DataApiMediator.
  (_createProgram): Assign `_dapiManager' (this is not at all
  ideal).  Remove hooks from it: fieldLoading, updateFieldData,
  clearFieldData.
* src/client/ClientDependencyFactory.js (createDataApiMediator): New alias
  to DataApiMediator constructor.
* src/client/dapi/DataApiMediator.js: New class.
* test/client/dapi/DataApiMediatorTest.js: New test case.

DEV-3257
2018-07-17 15:44:33 -04:00
Mike Gerwitz 3261fbd7ec controller: Fix progdata route error reporting
* src/server/daemon/controller.js (doRoute): response.{error=>internalError}.
2018-06-20 10:48:23 -04:00
Jeffrey Fisher 8600c3beb7 [DEV-3192] Renamed variables and added test case 2018-06-19 10:28:48 -04:00
Jeffrey Fisher e079a5eb0a [DEV-3192] Simplified logic and corrected issue with bucket data 2018-06-19 10:28:48 -04:00
Jeffrey Fisher b72fb4b2c7 [DEV-3192] Added check for no doc_data 2018-06-19 10:28:48 -04:00
Jeffrey Fisher 94f76c5a77 [DEV-3192] fixed test cases 2018-06-19 10:28:48 -04:00
Jeffrey Fisher 3e32442a43 [DEV-3192] fixed default value initialization 2018-06-19 10:28:48 -04:00
Jeffrey Fisher 345e570e67 [DEV-3192] Fix hiding the header when all contents are hidden 2018-06-19 10:28:48 -04:00
Jeffrey Fisher 8ac2a367db [DEV-3192] Fix populating default bucket data to meet min required bucket values 2018-06-19 10:28:48 -04:00
Mark Goldsmith bb9bb68a0f [DEV-2871] DocumentProgramFormatter: changed field match from any to all 2018-06-15 09:02:16 -04:00
Mark Goldsmith 7935c699de [DEV-2871] DocumentProgramFormatter: Match on fields from FieldClassMatcher instead of __classes and program.whens 2018-06-13 15:42:45 -04:00
Mike Gerwitz de931cf91b FieldClassMatcher: Minor refactoring/cleanup
This does not go all the way, but helps improve the readability of the
algorithm a little bit and modernizes the code.

* src/field/FieldClassMatcher.js (constructor): Renamed from
    `__constructor'.
  (__constructor): Remove method.
  (match): Extract most code into `#_reduceFieldMatches'.
  (_reduceFieldMatches): New method, simplifying the algorithm slightly.
  (_reduceMatch): Simplify.
* test/field/FieldClassMatcherTest.js: Update accordingly.
2018-06-12 16:52:14 -04:00
Mike Gerwitz 5164c9dcbb FieldClassMatcher: Always yield integer indexes
* src/field/FieldClassMatcher.js (match): Cast `vis' to number.
* test/field/FieldClassMatcherTest.js: Remove FIXME and change assertion.
2018-06-12 15:11:24 -04:00
Andrew Elbaneh 28fef16971 [DEV-2871] cleaned up some of the code based on the merge request 2018-06-12 09:02:54 -04:00
Mark Goldsmith 14a8af2282 [DEV-2871] Added link and id to group in DocumentProgramFormatter 2018-06-12 09:02:54 -04:00
Mark Goldsmith e2461a023c [DEV-2871] Added field type to DocumentProgramFormatter 2018-06-12 09:02:54 -04:00
Mark Goldsmith 856c9a1a83 [DEV-2871] Passed __classes directly into private functions, updated documentation 2018-06-12 09:02:54 -04:00
Mark Goldsmith 9907c698d1 [DEV-2871] Added DocumentProgramFormatter to format program data by step, group and field metadata 2018-06-12 09:02:54 -04:00
Chase Gregory a94dab9cc0 [DEV-3040] Fixed year Calculations 2018-06-08 15:23:37 -04:00
Chase Gregory ac32f5d8ad [DEV-3040] Fixed code styling 2018-06-08 14:29:02 -04:00
Chase Gregory 4593fd8002 [DEV-3040] Fixed relativeDate function with update date methods 2018-06-07 11:38:00 -04:00
Mike Gerwitz 4ce7ba7545 Server: Add program_id to /init
We need to add API versioning.  But until then...

* src/server/Server.js (_processInit): Return program_id.
2018-05-03 16:11:32 -04:00
Mike Gerwitz ad52dbec9a controller: Only init submit notification if requested
* src/server/daemon/controller.js (exports.init): Do not initialize submit
    notifier if no URL was provided.
2018-05-03 14:39:04 -04:00
Mike Gerwitz b32d4e3d1b MongoServerDao#getDocumentField retrieval fix
* src/server/db/MongoServerDao.js (getDocumentField): Check key on first
  record.
2018-05-02 15:27:35 -04:00
Mike Gerwitz 99e33a5089 RatingServiceSubmitNotify: Do not flag as notified on error
If the submission failed, we probably want to try again next time around.

* src/server/service/RatingServiceSubmitNotify.js
  (_maybeNotify): Extract logic from `#postProcessRaterData'.  Only set
    notification flag in absence of dapi error.
  (postProcessRaterData): Use it.
* test/server/service/RatingServiceSubmitNotifyTest.js: Update tests
    accordingly.
2018-05-02 14:23:39 -04:00
Mike Gerwitz 458064339d Server: Output assertion failure messages
Previously, it was just trying to serialize an object, which was useless.

* src/server/Server.js (_formatValidationFailures): New method.
  (_doQuoteSave): Use it.
2018-05-01 15:09:22 -04:00
Mike Gerwitz fac64b6ae1 Server: Set program internal flag before assertions
Requests that came in between (for example) a post request and the actual
validation of the posted data would potentially reset the flag, causing
internal assertions to fail.

* src/server/Server.js
  (sendStep): Provide session to #_forwardValidate.
  (_forwardValidate): Set `program.isInternal' immediately before invoking
    event.  Provide session to #quoteFill.
    [session]: New argument.
  (quoteFill): Add `session' argument.  Provide session to hooks.
  (loadProgram): Receive session via #quoteFill hook.  Set
    `program.isInternal' before submit hook.
* src/server/daemon/controller.js (doRoute): Remove `program.isInternal'
    set.
2018-05-01 15:03:55 -04:00
Mike Gerwitz ea30e94527 Integrate noResultsUrl configuration
This is not the ideal implementation.  Instantiation of RatingService and
such should be moved out of the controller entirely, but we don't have the
time for that right now.
2018-05-01 09:44:55 -04:00
Mike Gerwitz 25cb1f62c1 controller: Integrate RatingServiceSubmitNotify
This is not an ideal location.
2018-05-01 09:44:55 -04:00
Mike Gerwitz 3bed93e750 SpoofedNodeHttpImpl: Fix docblocks (User{Session=>Request})
Wrong object!
2018-05-01 09:44:55 -04:00
Mike Gerwitz ae0d9b3862 RatingServiceSubmitNotify: Create dapi dynamically with session
Session information needs to be available for request session spoofing.
2018-05-01 09:44:55 -04:00
Mike Gerwitz d9c442b8e2 QuoteDataApi: Correct constructor argument error 2018-05-01 09:44:55 -04:00
Mike Gerwitz 2d1582059f RatingServiceSubmitNotify: Notify only once
* src/server/db/MongoServerDao.js
  (getDocumentField,setDocumentField): New methods.
* src/server/service/RatingServiceSubmitNotify.js
  (postProcessRaterData): Only notify when notification flag is not set.
  (_getNotifyState, _setNotified): New methods.
* test/server/service/RatingServiceSubmitNotifyTest.js: Modify accordingly.
2018-05-01 09:44:55 -04:00
Mike Gerwitz d8338b50e0 RatingServiceSubmitNotify: Add trait
* src/server/service/RatingServiceSubmitNotify.js: New trait.
* test/server/service/RatingServiceSubmitNotifyTest.js: Respective test.
2018-05-01 09:44:55 -04:00
Jeffrey Fisher 7d0dc97162 Add HttpDataApiUrlData 2018-05-01 09:44:53 -04:00
Jeffrey Fisher 5b410005cd RatingService: ensure #postProcessRaterData is called before save 2018-05-01 09:44:51 -04:00
Mike Gerwitz 9ad8cb96b8 Cmatch: Do not fail given __classes question
* src/client/Cmatch.js (handleClassMatch): Rename from
  _handleClassMatch.  Make protected.  Check for truthy `vis'.
* test/client/CmatchTest.js: Update accordingly.
2018-04-16 15:30:19 -04:00
Mike Gerwitz f5f753d3bb Client: updateFieldData setOptions cur fix
* src/client/Client.js (_createProgram): Properly capture current value in
  closure for `setOptions'.
2018-04-03 16:04:30 -04:00
Mike Gerwitz 6733556582 Remove hard-coded skey
This wasn't intended to make its way into a public repo. :)

The existing key was a long-forgotten kluge that was supposed to be
temporary, allowing internal services to create quotes without
authentication.  The chances of this being practically exploited are minimal
in our environment, and it's auditable using webserver logs.

This moves the skey into a configuration file, which allows it to vary by
server and be rotated until a better solution is made available.  skey is
disabled by default (empty string), and when used by us internally, the keys
are now generated using a CSPRNG rather than a brute-forcable 5-byte key
that was hard-coded.

The fact that this appears in webserver logs is a big issue as well.  I
added a task to address that.

* conf/vanilla-server.json (skey): New key.  Default empty.
* src/server/daemon/Daemon.js (start): Provide skey to `#getRouters'.
  (getRouters): Provide skey to `#getProgramController'.
  (getProgramController): Set skey on `controller'.
* src/server/daemon/controller.js (skey): New mutable export (unideal; quick
    change).
  (has_skey): Use it.
2018-04-03 15:29:47 -04:00
Mike Gerwitz 460a533777 MongoServerDao: Always clear quicksave data
quicksave data wouldn't always be cleared on save, meaning it might not be
cleared until the next _empty_ quicksave from the client.

* src/server/db/MongoServerDao.js (saveQuote): Always clear quicksave.
2018-03-14 11:47:50 -04:00
Mike Gerwitz c33adee21d client: Truncate diff posted to server after first null
Before this change, since `undefined' is encoded as `null' when serialized,
there was no way for the server to disambiguate between unmodified values
and a truncation point.  For example:

  [ undefined, undefined, null, null, null ]

The above array represents two unmodified and three removed indexes.  But
this is serialzed into JSON as:

  [ null, null, null, null, null ]

It isn't possible for the server to determine what the truncation point is
from that diff.  The solution is to therefore truncate the array _before_
sending it to the server, providing a trailing null to indicate that a
truncation has occurred:

  [ null, null, null ]

The above means that the first two indexes are unmodified, and that index 2
and later should all be truncated.

* doc/client.texi (Saving to Server): New section.
* src/client/transport/XhttpQuoteTransport.js (_truncateDiff): New method to
  perform truncation.
  (getBucketDataJson): Use it.
* test/client/transport/XhttpQuoteTransportTest.js: New file with respective
  test case.
2018-03-07 13:46:05 -05:00
Mike Gerwitz 9727b9a157 Support default program id if none provided via URL
* src/client/Client.js (_defaultId): New property.
  (__construct)[default_id]: New parameter.  Set `_defaultId'.
  (_getProgramId): Use `_defaultId' if not found in URL.
* src/ui/nav/HashNav.js (_initUrl): Do not require leading program id.
  This technically worked fine before with our URL scheme, but that is not
  guaranteed to be the case generally.
2018-03-01 12:23:35 -05:00
Mike Gerwitz cfadc217cc DslRater: Correct missing raters error message 2018-03-01 12:23:35 -05:00
Mike Gerwitz 79fc82614e ElementStyler: console.warn{ing=>}
Crap.

* src/ui/ElementStyler.js (setValueByName): console.warn{ing=>}
2018-02-12 10:35:23 -05:00
Mike Gerwitz 3b303e50a9 Cmatch: Fix combined show/hide of same field, multi-index
This is something that managed to slip by (but not unnoticed) for almost
exactly one year to this day (028606242a).  It
can only be reproduced by changing classes that result in visibility changes
differing on the same field by index.  The issue hides itself on first
load (because all fields are shown by default) and on refresh.

The problem is that, when one index shows a field but another hides it, the
hide overrode the show indexes, so only the hide took place.

* src/client/Cmatch.js (markShowHide): Make virtual.  New implementation to
    support concurrent show/hide.
  (_handleClassMatch): Use it.
* test/client/CmatchTest.js: New test.
* npm-shrinkwrap.json: ease.js v0.2.{8=>9}.
2018-02-09 11:55:46 -05:00
Mike Gerwitz 0a50b22496 Cmatch: Extract show/hide marking into own method
This is to give us a fairly easy means of testing this logic for a bugfix.

This refactoring also obviates a pretty nasty bug; see docblock.

* src/client/Cmatch.js (_handleClassMatch): Extract show/hide marking.
  (markShowHide): New method.
2018-02-09 11:20:48 -05:00
Mike Gerwitz 4b114d0137 Client: Extract cmatch methods
This makes the minimal number of changes necessary to ensure that all object
references remain available.  It is a mess.

And despite moving all of this, Client is still a massive clusterfuck.

* src/client/Client.js (system): Add import.
  (_cmatch): Now references new Cmatch class instance.
  (_cmatchHidden, _classMatcher): Remove fields.
  (_forceCmatchAction): Rename to `forceCmatchAction'.
  (_hookClassifier, _postProcessCmatch, _cmatchVisFromUi, _handleClassMatch,
    _mergeCmatchHidden, _clearCmatchFields): Extract methods.  Update
    references as necessary.
  (getCmatchData): Remove unused method.
  (_handleError): Rename to `handleError' to make accessible to
    Cmatch.  Update references.
* src/client/ClientDependencyFactory.js (FieldClassMatcher): Remove import.
  (createFieldClassMatcher): Remove method.  See `system/client'.
* src/client/Cmatch.js: New class.
* src/system/client.js (Cmatch, field): Add imports.
  (cmatch): Add export.
2018-02-09 11:20:45 -05:00
Mike Gerwitz cc7370711d Client: Eliminate old event handling system
All of the old events have been removed!

* src/client/Client.js (handleEvent): Remove remainder of old system (after
  last commit, all that was left was error handling).  Correct docblock.
2018-02-08 16:18:46 -05:00
Mike Gerwitz 58533f6d72 Client: Remove unused `reset' event
This event hasn't seen use in ...possibly ever.

* src/client/Client.js (handleEvent): Remove `reset' event.
  Always return `this'.
2018-02-08 16:13:25 -05:00
Mike Gerwitz de578c6e93 ElementStyler: jQuery BC for radios (bugfix)
Of course, the radios are actually checkboxes...radioboxes.

* src/ui/ElementStyler.js (setValueByName): Recognize both jQuery and DOM
  elements.
2018-02-08 09:28:15 -05:00
Mike Gerwitz 943231ee81 ValueSetEventHandler: New handler for `set' event
The `set' event already existed---this merely extracts it into its own
handler.

* src/client/Client.js (handleEvent): Extract `set' handler.
* src/client/ClientDependencyFactory.js (createClientEventHandler): Add
  `set'.
* src/client/event/ValueSetEventHandler.js: New class.
* test/event/ValueSetEventHandlerTest.js: Associated test case.
2018-02-07 14:59:50 -05:00
Mike Gerwitz f5346bef39 ElementStyler: Ignore noyes/radio/legacyradio when DOM element unknown
* src/ui/ElementStyler.js (setValueByName): Ignore `question' if undefined.
2018-02-07 14:57:51 -05:00
Mike Gerwitz 88e32f3c0d Client: Use last available index for `set' action
This matches the behavior of assertions.

This needs to be refactored into an even handler.

* src/client/Client.js (handleEvent)[set]: Use last available index.
2018-02-07 14:21:02 -05:00
Mike Gerwitz 9d0cd5a3f3 ElementStyler: Fix rendering of noyes, radio, legacyradio
* src/ui/ElementStyler.js (setValueByName): Correctly operate on  DOM
  element rather than jQuery object.
2018-02-07 12:02:28 -05:00
Mike Gerwitz 1325dc9a86 ElementStyler: Re-add change_event check as warning
* src/ui/ElementStyler.js (setValueByName)[change_event]: Re-add
  `change_event' check, but as a warning instead of an Error.  This
  shouldn't be used anymore, but let's be certain _without_ breaking
  things.
2018-02-07 12:01:35 -05:00
Mike Gerwitz 51e8c1428f ElementStyler: Remove change_event error
The intent wasn't go have this be permanant, and apparently it _is_ being
used in generated code!

* src/ui/ElementStyler.js (setValueByName): Remove error on `change_event'.
2018-02-06 16:58:58 -05:00
Jeffrey Fisher 9ae544fcbd dapi: Updated correct field index 2018-02-06 15:20:09 -05:00
Mike Gerwitz d0bbc04218 ElementStyler: Remove jQuery for legacyradio value setting
Continued eradication of jQuery for performance reasons.

* src/ui/ElementStyler.js (setValueByName): Do not use jQuery for
  legacyradio styling.  Throw exception on `change_event' argument set (this
  should no longer be used).
2018-02-02 16:55:50 -05:00
Mike Gerwitz fa9ee5d340 ElementStyler: Remove unused `autochange'
This used to be a thing back when we used Dojo, but it doesn't appear to be
used anymore.

* src/ui/ElementStyler.js (setValueByName): Remove `autochange' check.

 Lines starting
2018-02-02 16:43:34 -05:00
Mike Gerwitz 1f6ea234ff StackedGroupUi: New group
* doc/program.texi (Group Styles): Add `stacked' to table.
* src/client/ClientDependencyFactory.js (createGroupUi): Recognize
  `stacked'.
* src/css/base.css (.stack-header): Style stack header.
* src/ui/group/StackedGroupUi.js: New group class.
2018-02-02 14:48:37 -05:00
Mike Gerwitz 799a74d7a1 NaFieldStylerAnimation: Remove trait
These animations are ugly and slow when there are many questions on a
step.  I've wanted them gone for quite some time, and now we don't have a
disagreement among developers.

* src/client/ClientDependencyFactory.js (createNaFieldStyler): Remove
  NaFieldStylerAnimation mixin.
* src/ui/styler/NaFieldStylerAnimation.js: Remove trait.
2018-02-01 14:23:33 -05:00
Mike Gerwitz af7774a272 dapi: Do not perform static additions in invalid response data
* src/dapi/StaticAdditionDataApi.js (request): Do not unshift data if
    `response' is not an array.
2018-01-15 11:03:46 -05:00
Mike Gerwitz 5f3ad6dbf1 client/debug: Append null to bucket editor field change diff
This is necessary to truncate on index removal; otherwise, it's not possible
to remove indexes through the editor.

* src/client/debug/BucketClientDebugTab.js (_getStagingButtons): Append null
    on value change.
2018-01-15 10:53:25 -05:00
Mike Gerwitz 87c4cf50d2 Use {ch=>em} units for CSS (because of IE)
See comments in base.css.

* src/css/base.css: {ch=>em} for all styles.  Matched sizes approximately;
  it doesn't need to be exact.
2017-11-10 10:20:10 -05:00
Mike Gerwitz f7a320b58c Remove paragraph from dev dialog
It lies now.

* src/client/debug/ClientDebugDialog.js (_createDialog): Remove paragraph.  Adjust case
    on keybinding text.
2017-11-08 14:09:06 -05:00
Mike Gerwitz e1db46ad9e Extract dialog styling into new base.css
* src/client/Client.js (createSideBar): Remove width/height, add
    `dialogClass'.
* src/client/debug/BucketClientDebugTab.js
  (showBucketEditor, _genBucketEditorFields): Remove width/height and other
    CSS, add `dialogClass'.
* src/client/debug/ClientDebugDialog.js (_createDialog): Remove
    width/height, add `dialogClass'.
* src/css/base.css: New file.
* src/ui/dialog/DirtyDialog.js (init): Remove size, set type id.
* src/ui/dialog/EmailDialog.js (init): Remove size, set type id.
* src/ui/dialog/ErrorDialog.js (init): Remove size, set type id.
* src/ui/dialog/NotificationDialog.js (init): Remove size, set type id.
* src/ui/dialog/QuoteNavDialog.js (init): Remove size, set type id.
* src/ui/dialog/UiDialog.js
  (showErrorDialog): Remove size.  Remove width param.
  (showNavErrorDialog): Remove size.
  (showQuoteNumberPrompt): Remove size, set type.
2017-11-08 14:09:03 -05:00
Mike Gerwitz 72783a5f35 Add Dialog type id support for CSS styling
* src/ui/dialog/Dialog.js (setTypeId): Add method.
* src/ui/dialog/DialogDecorator.js (setTypeId): Add method.
* src/ui/dialog/JqueryDialog.js (setTypeId): Add method.
2017-11-08 11:19:02 -05:00
Mike Gerwitz c41d0aa924 GeneralStepUi: Do not try to sort one group
An error was being thrown because there are no siblings to reference when
there is only a single group.  Obviously sorting is not even needed in such
a situation.

src/ui/step/GeneralStepUi.js (_sortGroups): Abort if <= 1 groups.
2017-10-23 14:56:51 -04:00
Mike Gerwitz 2baabf5e7e Output correct HTTP server port on start
Was outputting NaN, because the property that was being used no longer
existed after previous changes.

* src/server/daemon/Daemon.js (_initHttpServer): Use HTTP port number
  in output.
2017-09-08 14:19:58 -04:00
Mike Gerwitz 73354e39d0 Fix restoring of document metadata after clearing
Previous to this change, we'd write the clear to the database, but
then immediately after, the quote save would restore it.  Oops.

* src/server/Server.js (_monitorMetadataPromise): Clear data in
    metabucket rather than directly invoking a DB call.  This will be
    applied when the quote is saved.
2017-09-07 15:31:43 -04:00
Mike Gerwitz 68649dfd9b [DEV-2692] [BC-BREAK] Bucket stability and consistency fixes and non-term nulls
This mixes in support for non-terminating nulls.  It would have been
nice to handle that in a separate commit for clarity, but the
refactoring came as a consequence of trying to provide a working
implementation.

Various inconsistencies and subtle bugs in unlikely situations have
been fixed by this, including modifying objects passed as arguments to
various methods, and inconsistent handling of diff data.

Changes are more consistently recognized.  Perhaps the most noticeable
consequence is that moving between steps no longer prompts to discard
changes---previously calculated values would trigger the dirty flag on
steps even if the user didn't actually change anything.  I (and
others) have wanted this fixed for many years.

This is a very dense commit that touches a core part of the
system.  Hopefully the Changelog below helps.

* src/bucket/Bucket.js
  (setValues): [BC-BREAK] Remove parameters `merge_index' and
    `merge_null' parameters.
* src/bucket/DelayedStagingBucket.js
  (setValues): [BC-BREAK] Remove `merge_index' and `merge_null
    parameters.  Remove distinction between `merge_index' and non-.
* src/bucket/QuoteDataBucket.js
  (setValues): [BC-BREAK] Remove `merge_index' and `merge_null
    parameters.  Remove respective arguments from `_mergeData' call.
  (_mergeData): Remove same parameters.  Remove handling of
    `merge_index' and `merge_null'.
  (overwriteValues): Append `null' to each vector.
* src/bucket/StagingBucket.js
  (_initState): Use `Object.create' instead of explicit prototype
    instantiation (functionally equivalent).
  (merge): Minor comment correction.
  (_hasChanged): Rename to `_parseChanges'.
  (_parseChanges): Rename from `_hasChanged'.  Remove `merge_index'
    parameter.  Generate new object rather than mutation original
    data (prevent dangerous and subtle bugs from side-effects).  Clone
    each vector rather than modifying/referencing directly (this was
    previously done during merge).  Remove `merge_index'
    distinction.  Handle non-terminating `null' values.
  (setValues): [BC-BREAK] Remove `merge_index' and `merge_null'
    parameters.  Use new object generated by `_parseChanges'.  Remove
    cloning of each vector (`_parseChanges' now does that).  Remove
    `merge_index' distinction.
  (overwriteValues): Remove argument to `setValues' call.
  (getFilledDiff): [BC-BREAK] Use `_staged' rather than `_curdata'.
  (commit): Remove second and third arguments of call to `setValues'
    of underlying bucket.
* src/client/Client.js
  (_initStepUi): Remove second argument of calls to quote `setData'.
* src/client/quote/ClientQuote.js
  (setData): [BC-BREAK] Remove `merge_nulls' parameter.  Remove second
    and third arguments of call to staging bucket `setValues'.  Add
    comment indicating a long-standing problem with committing the
    staging bucket contents before save has succeeded.
* src/server/request/DataProcessor.js
  (processDiff): Remove `permit_null' argument of `sanitizeDiff'
    call.
  (sanitizeDiff): Remove `permit_null' parameter.  Hard-code filter
    call's `permit_null' argument to `true'.
  (_determineDapiFields): Properly handle `null's (ignore) rather than
    inadvertently converting them into the string "null".
* test/bucket/StagingBucketTest.js: Modify test cases
    accordingly.  Add tests to verify that updates and diffs operate
    as expected, especially support for non-terminating `null's.
  (createStubBucket): Use `QuoteDataBucket'.  Ideally remove this
    coupling in the future, but this is a more realistic test case for
    the time being.
* test/server/request/DataProcessorTest.js: Update test to account for
    hard-coded `given_null' argument.
2017-09-06 09:03:45 -04:00
Mike Gerwitz 8a1ac4781c [DEV-2692] Store cleaned rate response data separately
I'm not sure if this has ever caused real problems, but this was
dangerous.

* src/server/service/RatingService.js (_performRating): Store cleaned
    rating data in separate variable to ensure cleaned data are not
    saved in place of the actual complete response.
2017-09-05 16:26:59 -04:00
Mike Gerwitz 3fa464bc3a Extract bucket init code into ProgramInit
This represents a portion of the refactoring that I had intended to do
until I realized that there was a simpler solution to the problem that
we were having (having proguic add stored calculated values to the
defaults object).

So ideally we'll continue extracting all quote init code out of
`Server' and into `ProgramInit' in the future.

* doc/server.texi (Liza Server): Mention `ProgramInit'.
* src/program/ProgramInit.js: Add class.
* src/server/DocumentServer.js: Use it.
* src/server/Server.js (_progInit): Add private field.
  (__construct): Accept ProgramInit instance and assign to field.
  (initQuote): Use promise returned by `_getDefaultBucket'.
  (_getDefaultBucket): Proxy to `ProgramInit#init', which returns a
    promise.
2017-08-30 11:20:19 -04:00
Mike Gerwitz 445783c256 [BC BREAK] DataApi config lookup
This was a bit involved because the system had to be made async all
the way up the stack.  No attempt was made to clean up the mess up the
stack---no time.

* src/dapi/DataApiFactory.js
  (fromType): [BC BREAK] Fix docblock.  Add `api_name' param.  Call
    `#descLookup' and return promise.
  (descLookup): Add method.  Return promise resolving to provided
    descriptor.  Intended to be overridden by subtype.
* src/dapi/DataApiManager.js
  (_dataApis): Update docblock to indicate that it now stores
    promises.
  (getApiData): Expect promise for `DataApiFactory#fromType' call.
* src/server/DocumentServer.js: (create): [BC BREAK] Accept
    configuration.  Look up dapi conf and pass to
    `ServerDataApiFactory' ctor.  Return promise.
* src/server/daemon/Daemon.js (_initRouters): Provide configuration.
* src/server/daemon/controller.js
  (init): Accept configuration.  Handle return of promise from
    `_createDocumentServer'.
  (_createDocumentServer): Accept configuration, providing to
    `DocumentServer#create'.  Because of aforementioned change to
    `#create', returns promise.
* src/server/request/ServerDataApiFactory.js: Add StoreMissError
    import.
  (_conf): Add property.
  (constructor): [BC BREAK] Accept configuration.
  (descLookup): Add override.  Look up configuration for provided
    dapi.
2017-08-29 15:11:28 -04:00
Mike Gerwitz 985819c31b [BC BREAK] bin/server.js and associated changes
This is based (very) loosely on an internal script to start the
daemon.  It accepts a configuration and starts the daemon.

To accommodate the configuration, a number of miscellaneous changes
have been made.

The vanilla configuration shows the concept, but it has not yet been
fully implemented; that'll likely happen at a later date.  Until then,
the existing environment-variable-based configuration will be used.

* bin/server.js: Add file.
* conf/vanilla-server.json: Example configuration added.
* src/server/daemon/Daemon.js (_httpPort): Remove field.
  (_conf): Add field.
  (__construct): [BC BREAK] Accept conf instead of port and log
    priority.  Move initialization code into `start'.
  (start): [BC BREAK] Initialization code moved here.  Now returns
    promise for entire daemon, which will error in the event of an
    error starting.  Move existing code into `_startDaemon'.
  (_startDaemon): Old `start' code.  Invoked after `start'
    initialization.
  (_createDebugLog, _createAccessLog): Use configuration.  Return
    promise.
  (_initHttpServer): Use configuration.
  (_httpError): Add function to output error and exit.  Extracted from
    `_initHttpServer'.
* src/server/daemon/scripts.js: [BC BREAK] Append "program/" to
    `LV_LEGACY_PATH' so that it can be re-used for script lookups
    rather than using the cwd.  This removes the need of the cwd being
    the legacy src path.
2017-08-29 14:56:10 -04:00
Mike Gerwitz 464a46abf0 Add ConfStore
* src/conf/ConfStore.js: Add file.
2017-08-29 14:34:41 -04:00
Mike Gerwitz 24e8b51745 Add DelimitedKey Store trait
This will make life much easier and less verbose, especially
considering the verbosity of promises.

* src/store/DelimitedKey.js: Add trait.
* test/store/DelimitedKeyTest.js: Add test case.
2017-08-29 14:34:40 -04:00
Mike Gerwitz c857dcb056 Add ConfLoader
* src/conf/ConfLoader.js: Add class.
* test/conf/ConfLoaderTest.js: Respective test case.
2017-08-28 09:07:28 -04:00
Mike Gerwitz dfcca807de Add AutoObjectStore
* src/store/AutoObjectStore.js: Add class.
* test/store/AutoObjectStoreTest.js: Add test case.
2017-08-28 09:07:26 -04:00