1
0
Fork 0
Commit Graph

732 Commits (abf76beac6ac88dacbd6e24315e3711ba82366c2)

Author SHA1 Message Date
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 c92cab4044 package.json (dependencies)[amqplib]: Add
This should have been in the previous commit.
2019-03-21 14:56:26 -04:00
Mike Gerwitz 13a7f97f8f Proof-of-concept RatingServicePublish to queue post-rate 2019-03-21 14:08:35 -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 53078919bb [DEV-4452] Accordion margin applies to collapsable header only
See merge request floss/liza!51
2019-03-01 10:36:14 -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 37a6805110 [DEV-4338] Change behavior of default data for DAPIs
Merge branch 'jira-4338'

* jira-4338:
  [DEV-4338] Change behavior of default data
2019-02-04 09:20:54 -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 deb92bf052 Add accordion group based on stacked group
JIRA-3989
2019-01-21 10:32:10 -05:00
Mike Gerwitz 8cd93cd0f5 doc/program.texi: Document accordion group
* doc/program.texi (Group Styles): Add `accordion'.
2019-01-21 10:20:46 -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 68ecb3536d [DEV-3731] Change postProcessResults visibility
Merge branch 'jira-3731'
2018-11-29 12:59:29 -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 b96479409c Avoid initializing bucket values for generated fields 2018-11-15 13:49:15 -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 52285d0a6c [DEV-3866] checkboxes were not changing values when unchecked
If a single checkbox in a group is not checked, the value should be "0".
2018-11-07 11:04:05 -05:00
Joseph Frazer 85ac34ebbd [DEV-3866] allow checkboxes to be unchecked 2018-11-06 11:51:22 -05:00
Joseph Frazer 42a3432772 [DEV-3866] use correct default for checkboxes 2018-11-06 07:56:11 -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 7b3c56e4a3 [DEV-3866] changes related to new "checkbox" question type 2018-11-05 12:35:57 -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 2df1ecc426 ProgramQuoteCleaner: Clean non-linked groups 2018-10-23 15:48:18 -04: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 5374345f1a [DEV-3011] Add validation and style for datalists 2018-09-14 08:57:33 -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
Jeff Fisher d320ea704a Merge branch 'jira-3497' into 'master'
[DEV-3497] Updated tabbed block to use default selection

See merge request floss/liza!40
2018-08-30 15:21:26 -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 cd71432e39 Force tags for the version 2018-08-20 17:07:59 -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
Mike Gerwitz d4948e2197 [bugfix] Daemon: Do not un-initialize controller no_result_url 2018-08-15 15:49:35 -04:00