Skip to content

Commit

Permalink
fix(accounts): properly compute $$treeLevel
Browse files Browse the repository at this point in the history
This commit ensures the $$treeLevel is properly computed by checking if
the account depth is undefined and assigning it -1 if so.  When the tree
level is not properly defined, the grouping in the accounts management
module breaks.

Closes Third-Culture-Software#2433.
  • Loading branch information
jniles committed Jan 9, 2018
1 parent 483b3f3 commit 41ef757
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
1 change: 0 additions & 1 deletion client/src/modules/accounts/AccountGrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ function AccountGridService(AccountStore, Accounts, Store, Languages, $httpParam
this._store = result;

// order and expose data made available through the store
// this.data = Accounts.order(this._store.data);
this.formatStore();

// update exposed store driven data
Expand Down
1 change: 0 additions & 1 deletion client/src/modules/accounts/accounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ function AccountsController($rootScope, $timeout, AccountGrid, Notify, Constants

function bindGridData() {
vm.gridOptions.data = vm.Accounts.data;
console.log('vm.Accounts.data', vm.gridOptions.data);
}

function toggleLoadingIndicator() {
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/accounts/accounts.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function AccountService(Api, bhConstants) {
*/
function flatten(_tree, _depth) {
var tree = _tree || [];
var depth = Number.isNaN(_depth) ? -1 : _depth;
var depth = (!angular.isDefined(_depth) || Number.isNaN(_depth)) ? -1 : _depth;
depth += 1;

function handleTreeLevel(array, node) {
Expand Down

0 comments on commit 41ef757

Please sign in to comment.