Skip to content

Commit

Permalink
[WIP] Hidden Zone [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
romanblanco committed Jul 2, 2018
1 parent 2961d88 commit 81bc35e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/mixins/manager_controller_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/tree_builder_ops.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion app/presenters/tree_builder_ops_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 81bc35e

Please sign in to comment.