diff --git a/app/scripts/controllers/storage.js b/app/scripts/controllers/storage.js index 1414827ea9..68e86099e7 100644 --- a/app/scripts/controllers/storage.js +++ b/app/scripts/controllers/storage.js @@ -15,6 +15,9 @@ angular.module('openshiftConsole') $scope.labelSuggestions = {}; $scope.alerts = $scope.alerts || {}; $scope.outOfClaims = false; + $scope.clearFilter = function() { + LabelFilter.clear(); + }; var setOutOfClaimsWarning = function() { var isHidden = AlertMessageService.isAlertPermanentlyHidden("storage-quota-limit-reached", $scope.projectName); @@ -64,22 +67,12 @@ angular.module('openshiftConsole') })); function updateFilterWarning() { - if (!LabelFilter.getLabelSelector().isEmpty() && $.isEmptyObject($scope.pvcs) && !$.isEmptyObject($scope.unfilteredPVCs)) { - $scope.alerts["storage"] = { - type: "warning", - details: "The active filters are hiding all persistent volume claims." - }; - $scope.filterWithZeroResults = true; - } - else { - delete $scope.alerts["storage"]; - $scope.filterWithZeroResults = false; - } + $scope.filterWithZeroResults = !LabelFilter.getLabelSelector().isEmpty() && $.isEmptyObject($scope.pvcs) && !$.isEmptyObject($scope.unfilteredPVCs); } LabelFilter.onActiveFiltersChanged(function(labelSelector) { // trigger a digest loop - $scope.$apply(function() { + $scope.$evalAsync(function() { $scope.pvcs = labelSelector.select($scope.unfilteredPVCs); updateFilterWarning(); }); diff --git a/app/views/storage.html b/app/views/storage.html index 1050c50cab..de3b445176 100644 --- a/app/views/storage.html +++ b/app/views/storage.html @@ -32,14 +32,19 @@