Comment 7 for bug 1642378

Revision history for this message
Bill Erickson (berick) wrote : Re: Web Staff Client - Wish List - Patrons With Negative Balances Loading

2 commits pushed:

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1642378-neg-balance-load-fail

1. Disable org units that cannot have users in the neg. balance UI. (The org selector does not appear to be styling the disabled values any differently, but I have confirmed they cannot be clicked on).

2. Various fixes to the org selector code. In short, this allows the neg. balance UI to automatically load the data for the selected org unit on page load, instead of dying on an undefined value error.

These commits do not add support for showing a progress dialog. I'm waiting until bug #1522638 is finalized before adding that.

======

More details from the org selector fixes. Some of these have been bugging me for a while, so I'm glad to get it sorted out:

1. Always apply default values after egStartup.go() has completed. Among other things, this prevents the occasional "cannot call ws_ou() on an undefined value" errors bubbling up from the org selector when an attempt to set default values occurred before egAuth had retrieved the user (which loads during startup).

2. For consistency, always run the $scope.onchange handler on initial page load when a selected value and change handler are defined. Similar to #1 above, the initial onchange always fires after egStartup has completed.

3. Run the change handler in a $timeout so that the $scope.selected value has a chance to propagate to the calling controller's $scope. Otherwise, the the calling controller has to manually track the selected value (which partially defeats the purpose of having this directive in the first place).

These changes could affect other interfaces using the org selector, particularly those that apply an onchange handler and allow for a default value. I did a review of these UI's and didn't see any unusual behavior, but extra eyes there is good. Mainly, we need to confirm that the page loads normally.

UI's potentially affected by the onchange differences:

admin/local/config/auto_print.tt2
admin/local/rating/badge.tt2
admin/local/rating/edit_badge.tt2
cat/catalog/t_holdings.tt2
cat/catalog/t_holds.tt2
circ/patron/t_edit.tt2
share/t_fm_record_editor.tt2