From a5b4811d0541a9eb9edd7a32df79357edb2e6035 Mon Sep 17 00:00:00 2001 From: jhadvig Date: Wed, 8 Feb 2017 13:53:52 +0100 Subject: [PATCH] Remove old routes watcher in the Services controller --- app/scripts/controllers/services.js | 19 ------------------- dist/scripts/scripts.js | 15 +++------------ 2 files changed, 3 insertions(+), 31 deletions(-) diff --git a/app/scripts/controllers/services.js b/app/scripts/controllers/services.js index 9a4166efe7..b1523eb41d 100644 --- a/app/scripts/controllers/services.js +++ b/app/scripts/controllers/services.js @@ -42,25 +42,6 @@ angular.module('openshiftConsole') Logger.log("services (subscribe)", $scope.unfilteredServices); })); - watches.push(DataService.watch("routes", context, function(routes){ - $scope.routes = routes.by("metadata.name"); - $scope.emptyMessageRoutes = "No routes to show"; - $scope.routesByService = routesByService($scope.routes); - Logger.log("routes (subscribe)", $scope.routesByService); - })); - - function routesByService(routes) { - var routeMap = {}; - angular.forEach(routes, function(route, routeName){ - var to = route.spec.to; - if (to.kind === "Service") { - routeMap[to.name] = routeMap[to.name] || {}; - routeMap[to.name][routeName] = route; - } - }); - return routeMap; - } - function updateFilterWarning() { if (!LabelFilter.getLabelSelector().isEmpty() && $.isEmptyObject($scope.services) && !$.isEmptyObject($scope.unfilteredServices)) { $scope.alerts["services"] = { diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index 851f76649b..91b7f2babd 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -6670,26 +6670,17 @@ b.alerts[a.name] = a.data; }), c.clearAlerts(); var i = []; e.get(a.project).then(_.spread(function(a, c) { -function e(a) { -var b = {}; -return angular.forEach(a, function(a, c) { -var d = a.spec.to; -"Service" === d.kind && (b[d.name] = b[d.name] || {}, b[d.name][c] = a); -}), b; -} -function f() { +function e() { g.getLabelSelector().isEmpty() || !$.isEmptyObject(b.services) || $.isEmptyObject(b.unfilteredServices) ? delete b.alerts.services :b.alerts.services = { type:"warning", details:"The active filters are hiding all services." }; } b.project = a, i.push(d.watch("services", c, function(a) { -b.unfilteredServices = a.by("metadata.name"), g.addLabelSuggestionsFromResources(b.unfilteredServices, b.labelSuggestions), g.setLabelSuggestions(b.labelSuggestions), b.services = g.getLabelSelector().select(b.unfilteredServices), b.emptyMessage = "No services to show", f(), h.log("services (subscribe)", b.unfilteredServices); -})), i.push(d.watch("routes", c, function(a) { -b.routes = a.by("metadata.name"), b.emptyMessageRoutes = "No routes to show", b.routesByService = e(b.routes), h.log("routes (subscribe)", b.routesByService); +b.unfilteredServices = a.by("metadata.name"), g.addLabelSuggestionsFromResources(b.unfilteredServices, b.labelSuggestions), g.setLabelSuggestions(b.labelSuggestions), b.services = g.getLabelSelector().select(b.unfilteredServices), b.emptyMessage = "No services to show", e(), h.log("services (subscribe)", b.unfilteredServices); })), g.onActiveFiltersChanged(function(a) { b.$apply(function() { -b.services = a.select(b.unfilteredServices), f(); +b.services = a.select(b.unfilteredServices), e(); }); }), b.$on("$destroy", function() { d.unwatchAll(i);