From a3ea4bbb71ca93c7f5866ddc1b914e5c4054dc96 Mon Sep 17 00:00:00 2001 From: Martin Povolny Date: Mon, 29 May 2017 13:44:47 +0200 Subject: [PATCH] Merge pull request #1453 from zeari/topology_fix_max_items fix topology max items feature (cherry picked from commit a26ddfcf769c9fcde2978bc2b39841ecbf8c7790) https://bugzilla.redhat.com/show_bug.cgi?id=1460382 --- .../container_topology/container_topology_controller.js | 2 +- app/controllers/configuration_controller.rb | 2 +- app/views/configuration/_ui_1.html.haml | 2 +- spec/javascripts/fixtures/json/container_topology_response.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/controllers/container_topology/container_topology_controller.js b/app/assets/javascripts/controllers/container_topology/container_topology_controller.js index 6d3eacfaa3a..7a478646f3b 100644 --- a/app/assets/javascripts/controllers/container_topology/container_topology_controller.js +++ b/app/assets/javascripts/controllers/container_topology/container_topology_controller.js @@ -288,7 +288,7 @@ function ContainerTopologyCtrl($scope, $http, $interval, topologyService, $windo $scope.relations = data.data.relations; $scope.kinds = data.data.kinds; icons = data.data.icons; - var size_limit = data.data.settings.containers_max_objects; + var size_limit = data.data.settings.containers_max_items; if (currentSelectedKinds && (Object.keys(currentSelectedKinds).length !== Object.keys($scope.kinds).length)) { $scope.kinds = currentSelectedKinds; diff --git a/app/controllers/configuration_controller.rb b/app/controllers/configuration_controller.rb index 1fbd3067861..7d26eca67c6 100644 --- a/app/controllers/configuration_controller.rb +++ b/app/controllers/configuration_controller.rb @@ -590,7 +590,7 @@ def get_form_vars @edit[:new][:perpage][:tile] = params[:perpage_tile].to_i if params[:perpage_tile] @edit[:new][:perpage][:list] = params[:perpage_list].to_i if params[:perpage_list] @edit[:new][:perpage][:reports] = params[:perpage_reports].to_i if params[:perpage_reports] - @edit[:new][:topology][:containers_max_objects] = params[:topology_containers_max_objects].to_i if params[:topology_containers_max_objects] + @edit[:new][:topology][:containers_max_items] = params[:topology_containers_max_items].to_i if params[:topology_containers_max_items] @edit[:new][:display][:theme] = params[:display_theme] unless params[:display_theme].nil? @edit[:new][:display][:bg_color] = params[:bg_color] unless params[:bg_color].nil? @edit[:new][:display][:reporttheme] = params[:display_reporttheme] unless params[:display_reporttheme].nil? diff --git a/app/views/configuration/_ui_1.html.haml b/app/views/configuration/_ui_1.html.haml index 205f5080352..4756cf21134 100644 --- a/app/views/configuration/_ui_1.html.haml +++ b/app/views/configuration/_ui_1.html.haml @@ -77,7 +77,7 @@ %fieldset %h3 = _('Topology Default Items in View') - - [[_("Containers"), "topology_containers_max_objects", :containers_max_objects]].each do |item_per_page| + - [[_("Containers"), "topology_containers_max_items", :containers_max_items]].each do |item_per_page| .form-group %label.col-md-3.control-label = _(item_per_page[0]) diff --git a/spec/javascripts/fixtures/json/container_topology_response.json b/spec/javascripts/fixtures/json/container_topology_response.json index 594e7f5dde9..b447f986646 100644 --- a/spec/javascripts/fixtures/json/container_topology_response.json +++ b/spec/javascripts/fixtures/json/container_topology_response.json @@ -350,6 +350,6 @@ "Kubernetes":{"type":"image","icon":"...kubernetes..."}, "Openshift":{"type":"image","icon":"...openshift..."} }, - "settings": { "containers_max_objects":100} + "settings": { "containers_max_items":100} } }