Skip to content

Commit

Permalink
Do not fire cardinality queries on edit mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Blakko committed Mar 21, 2018
1 parent 0338fdd commit be0fcbe
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,12 @@ function controller($scope, $rootScope, Private, kbnIndex, config, kibiState, ge
// here grab visible buttons and request count update

const buttons = sirenAutoJoinHelper.getVisibleVirtualEntitySubButtons($scope.tree, $scope.vis.params.layout);

_addButtonQuery(buttons, currentDashboardId)
.then(results => {
updateCounts(results, $scope);
});
if (!edit) {
_addButtonQuery(buttons, currentDashboardId)
.then(results => {
updateCounts(results, $scope);
});
}
};

// As buttons are shown on UI side as a tree
Expand Down Expand Up @@ -590,7 +591,12 @@ function controller($scope, $rootScope, Private, kbnIndex, config, kibiState, ge
}

return promise
.then(tree => sirenAutoJoinHelper.updateTreeCardinalityCounts(tree))
.then(tree => {
if (edit) {
return tree;
}
return sirenAutoJoinHelper.updateTreeCardinalityCounts(tree);
})
.then(tree => {
if (!tree || !tree.nodes.length) {
return Promise.resolve({});
Expand Down

0 comments on commit be0fcbe

Please sign in to comment.