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
(cherry picked from commit 85e34ba)

https://bugzilla.redhat.com/show_bug.cgi?id=1498518
  • Loading branch information
mzazrivec authored and simaishi committed Nov 14, 2017
1 parent c51c4ee commit 22f98ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
Expand Up @@ -521,7 +521,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 @@ -404,14 +404,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 @@ -615,17 +628,4 @@ def set_session_data
session[:request_current_page] = @current_page
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 @@ -63,7 +63,6 @@ def layout_uses_paging?
all_ui_tasks
miq_request_ae
miq_request_host
miq_request_service
miq_request_vm
my_tasks
my_ui_tasks
Expand Down

0 comments on commit 22f98ee

Please sign in to comment.