Skip to content

Commit

Permalink
Add missing toolbar options for cloud tenants and host aggregates
Browse files Browse the repository at this point in the history
  • Loading branch information
tzumainn committed Nov 7, 2016
1 parent b31e7f7 commit bb60652
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
12 changes: 11 additions & 1 deletion app/controllers/cloud_tenant_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def button
javascript_redirect :action => "new"
return
elsif params[:pressed] == "cloud_tenant_edit"
javascript_redirect :action => "edit", :id => params[:id]
javascript_redirect :action => "edit", :id => get_checked_cloud_tenant_id(params)
return
elsif params[:pressed] == 'cloud_tenant_delete'
delete_cloud_tenants
Expand All @@ -61,6 +61,16 @@ def show_list
process_show_list
end

def get_checked_cloud_tenant_id(params)
if params[:id]
checked_cloud_tenant_id = params[:id]
else
checked_cloud_tenants = find_checked_items
checked_cloud_tenant_id = checked_cloud_tenants[0] if checked_cloud_tenants.length == 1
end
checked_cloud_tenant_id
end

def new
assert_privileges("cloud_tenant_new")
@tenant = CloudTenant.new
Expand Down
19 changes: 18 additions & 1 deletion app/helpers/application_helper/toolbar/cloud_tenants_center.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ class ApplicationHelper::Toolbar::CloudTenantsCenter < ApplicationHelper::Toolba
:cloud_tenant_new,
'pficon pficon-edit fa-lg',
t = N_('Create Cloud Tenant'),
t)
t),
button(
:cloud_tenant_edit,
'pficon pficon-edit fa-lg',
N_('Select a single Cloud Tenant to edit'),
N_('Edit Selected Cloud Tenant'),
:url_parms => "main_div",
:enabled => false,
:onwhen => "1"),
button(
:cloud_tenant_delete,
'pficon pficon-delete fa-lg',
N_('Delete selected Cloud Tenants'),
N_('Delete Cloud Tenants'),
:url_parms => "main_div",
:confirm => N_("Warning: The selected Cloud Tenants will be permanently deleted!"),
:enabled => false,
:onwhen => "1+"),
]
),
])
Expand Down
7 changes: 4 additions & 3 deletions app/helpers/application_helper/toolbar_chooser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,10 @@ def center_toolbar_filename_classic
# Original non vmx view code follows
# toolbar buttons on sub-screens
to_display = %w(availability_zones cloud_networks cloud_object_store_containers cloud_subnets
cloud_tenants cloud_volumes ems_clusters flavors floating_ips hosts load_balancers
network_ports network_routers orchestration_stacks resource_pools security_groups storages
middleware_deployments middleware_datasources middleware_messagings middleware_servers)
cloud_tenants cloud_volumes ems_clusters flavors floating_ips host_aggregates hosts
load_balancers network_ports network_routers orchestration_stacks resource_pools
security_groups storages middleware_deployments middleware_datasources
middleware_messagings middleware_servers)
to_display_center = %w(stack_orchestration_template topology)
if @lastaction == 'show' && (@view || @display != 'main') && !@layout.starts_with?("miq_request")
if @display == "vms" || @display == "all_vms"
Expand Down

0 comments on commit bb60652

Please sign in to comment.