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 @@

Loading...

-

No persistent volume claims.

-

- No persistent volume claims have been added to project {{projectName}}. -

-

- Create Storage - Create Storage -

+
+

No persistent volume claims.

+

+ No persistent volume claims have been added to project {{projectName}}. +

+

+ Create Storage + Create Storage +

+
+
+

The filter is hiding all persistent volume claims. Clear Filter

+
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 0bf7724c6c..97f7f39848 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -6604,7 +6604,9 @@ r.unwatchAll(c); }); })); } ]), angular.module("openshiftConsole").controller("StorageController", [ "$routeParams", "$scope", "AlertMessageService", "DataService", "ProjectsService", "QuotaService", "$filter", "LabelFilter", "Logger", function(e, t, n, a, r, o, i, s, c) { -t.projectName = e.project, t.pvcs = {}, t.unfilteredPVCs = {}, t.labelSuggestions = {}, t.alerts = t.alerts || {}, t.outOfClaims = !1; +t.projectName = e.project, t.pvcs = {}, t.unfilteredPVCs = {}, t.labelSuggestions = {}, t.alerts = t.alerts || {}, t.outOfClaims = !1, t.clearFilter = function() { +s.clear(); +}; var l = function() { var e = n.isAlertPermanentlyHidden("storage-quota-limit-reached", t.projectName); if (t.outOfClaims = o.isAnyStorageQuotaExceeded(t.quotas, t.clusterQuotas), !e && t.outOfClaims) { @@ -6627,15 +6629,12 @@ return n.permanentlyHideAlert("storage-quota-limit-reached", t.projectName), !0; }, u = []; r.get(e.project).then(_.spread(function(e, n) { function r() { -s.getLabelSelector().isEmpty() || !$.isEmptyObject(t.pvcs) || $.isEmptyObject(t.unfilteredPVCs) ? (delete t.alerts.storage, t.filterWithZeroResults = !1) : (t.alerts.storage = { -type: "warning", -details: "The active filters are hiding all persistent volume claims." -}, t.filterWithZeroResults = !0); +t.filterWithZeroResults = !s.getLabelSelector().isEmpty() && $.isEmptyObject(t.pvcs) && !$.isEmptyObject(t.unfilteredPVCs); } t.project = e, u.push(a.watch("persistentvolumeclaims", n, function(e) { t.pvcsLoaded = !0, t.unfilteredPVCs = e.by("metadata.name"), s.addLabelSuggestionsFromResources(t.unfilteredPVCs, t.labelSuggestions), s.setLabelSuggestions(t.labelSuggestions), t.pvcs = s.getLabelSelector().select(t.unfilteredPVCs), r(), c.log("pvcs (subscribe)", t.unfilteredPVCs); })), s.onActiveFiltersChanged(function(e) { -t.$apply(function() { +t.$evalAsync(function() { t.pvcs = e.select(t.unfilteredPVCs), r(); }); }), t.$on("$destroy", function() { diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 99699f88fe..2b040b3cad 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -13589,8 +13589,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "Loading...\n" + "

\n" + "
\n" + + "
\n" + "

No persistent volume claims.

\n" + - "

\n" + + "

\n" + "No persistent volume claims have been added to project {{projectName}}.\n" + "

\n" + "

\n" + @@ -13598,6 +13599,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "Create Storage\n" + "

\n" + "
\n" + + "
\n" + + "

The filter is hiding all persistent volume claims. Clear Filter

\n" + + "
\n" + + "
\n" + "\n" + "
0\" class=\"table table-bordered table-mobile table-layout-fixed\">\n" + "\n" +