Skip to content

Commit

Permalink
Merge pull request #2368 from martinpovolny/requests_highlight
Browse files Browse the repository at this point in the history
Request menu item highlight fixes
  • Loading branch information
mzazrivec committed Oct 13, 2017
2 parents 30e331f + 538cdae commit 85e34ba
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
Expand Up @@ -520,7 +520,6 @@ def layout_from_tab_name(tab_name)
case tab_name
when "ae" then "miq_request_ae"
when "host" then "miq_request_host"
when "service" then "miq_request_service"
else "miq_request_vm" # Includes "vm"
end
end
Expand Down
28 changes: 14 additions & 14 deletions app/controllers/miq_request_controller.rb
Expand Up @@ -412,14 +412,27 @@ def post_install_callback
head :ok
end

# Caution: The params[:typ] argument needs to match value from ?typ=VALUE
# from app/presenters/menu/default_menu.rb
# Example: '/miq_request?typ=service' --> "'service'".
# The returned value needs to be equal to the first argument to Menu::Section.new(...)
# Example: Menu::Section.new(:clo, N_("Clouds"), 'fa fa-plus', [ ... --> ":clo"
def menu_section_id(parms)
case parms[:typ]
when 'ae' then :automate
when 'service' then :svc
when 'host' then :inf
end
end

private ############################

def get_request_tab_type
case @layout
when "miq_request_ae" then "AutomateRequest"
when "miq_request_configured_system" then "MiqProvisionConfiguredSystemRequest"
when "miq_request_host" then "MiqHostProvisionRequest"
when "miq_request_vm", "miq_request_service" then "MiqProvisionRequest"
when "miq_request_vm" then "MiqProvisionRequest"
end
end

Expand Down Expand Up @@ -616,17 +629,4 @@ def set_session_data
session[:request_tab] = @request_tab unless @request_tab.nil?
session[:prov_options] = @options if @options
end

# Caution: The params[:typ] argument needs to match value from ?typ=VALUE
# from app/presenters/menu/default_menu.rb
# Example: '/miq_request?typ=service' --> "'service'".
# The returned value needs to be equal to the first argument to Menu::Section.new(...)
# Example: Menu::Section.new(:clo, N_("Clouds"), 'fa fa-plus', [ ... --> ":clo"
def menu_section(parms)
case parms[:typ]
when 'ae' then :automate
when 'service' then :svc
when 'host' then :inf
end
end
end
1 change: 0 additions & 1 deletion app/helpers/application_helper/page_layouts.rb
Expand Up @@ -60,7 +60,6 @@ def layout_uses_paging?
all_tasks
miq_request_ae
miq_request_host
miq_request_service
miq_request_vm
my_tasks
).include?(@layout) && params[:action] != 'show'
Expand Down

0 comments on commit 85e34ba

Please sign in to comment.