From 81bc35e301c52b05619af0cf04e6f140f2e06ff5 Mon Sep 17 00:00:00 2001 From: Roman Blanco Date: Mon, 2 Jul 2018 17:05:13 +0200 Subject: [PATCH] [WIP] Hidden Zone [skip ci] --- app/controllers/mixins/manager_controller_mixin.rb | 2 +- app/presenters/tree_builder_ops.rb | 2 +- app/presenters/tree_builder_ops_settings.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/mixins/manager_controller_mixin.rb b/app/controllers/mixins/manager_controller_mixin.rb index 39e6cca9d7a..76c99f77b52 100644 --- a/app/controllers/mixins/manager_controller_mixin.rb +++ b/app/controllers/mixins/manager_controller_mixin.rb @@ -279,7 +279,7 @@ def form_fields assert_privileges("#{privilege_prefix}_edit_provider") # set value of read only zone text box, when there is only single zone if params[:id] == "new" - return render(:json => {:zone => Zone.in_my_region.size >= 1 ? Zone.in_my_region.first.name : nil}) + return render(:json => {:zone => Zone.visible.in_my_region.size >= 1 ? Zone.visible.in_my_region.first.name : nil}) end manager = find_record(concrete_model, params[:id]) diff --git a/app/presenters/tree_builder_ops.rb b/app/presenters/tree_builder_ops.rb index 8e61efbb3a0..64f4e2d1d36 100644 --- a/app/presenters/tree_builder_ops.rb +++ b/app/presenters/tree_builder_ops.rb @@ -21,7 +21,7 @@ def x_get_tree_zone_kids(object, count_only) # Get root nodes count/array for explorer tree def x_get_tree_roots(count_only, _options) region = MiqRegion.my_region - objects = region.zones.sort_by { |z| z.name.downcase } + objects = region.zones.visible.sort_by { |z| z.name.downcase } count_only_or_objects(count_only, objects) end end diff --git a/app/presenters/tree_builder_ops_settings.rb b/app/presenters/tree_builder_ops_settings.rb index f9bf8adbc1f..803736737dd 100644 --- a/app/presenters/tree_builder_ops_settings.rb +++ b/app/presenters/tree_builder_ops_settings.rb @@ -45,7 +45,7 @@ def x_get_tree_custom_kids(object, count_only, _options) count_only_or_objects(count_only, ScanItemSet.all, "name") when "z" region = MiqRegion.my_region - count_only_or_objects(count_only, region.zones, "name") + count_only_or_objects(count_only, region.zones.visible, "name") end end end