From 22f98ee94b189c2b4faff2839f4f4064801c674f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Z=C3=A1zrivec?= Date: Fri, 13 Oct 2017 11:10:26 +0200 Subject: [PATCH] Merge pull request #2368 from martinpovolny/requests_highlight Request menu item highlight fixes (cherry picked from commit 85e34ba517bdcc864103454737cc74b8174a2ae9) https://bugzilla.redhat.com/show_bug.cgi?id=1498518 --- .../miq_request_methods.rb | 1 - app/controllers/miq_request_controller.rb | 28 +++++++++---------- .../application_helper/page_layouts.rb | 1 - 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/app/controllers/application_controller/miq_request_methods.rb b/app/controllers/application_controller/miq_request_methods.rb index 1348a905357..ff25e6d49a5 100644 --- a/app/controllers/application_controller/miq_request_methods.rb +++ b/app/controllers/application_controller/miq_request_methods.rb @@ -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 diff --git a/app/controllers/miq_request_controller.rb b/app/controllers/miq_request_controller.rb index a5e892fbf48..f19012070ae 100644 --- a/app/controllers/miq_request_controller.rb +++ b/app/controllers/miq_request_controller.rb @@ -404,6 +404,19 @@ 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 @@ -411,7 +424,7 @@ def get_request_tab_type 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 @@ -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 diff --git a/app/helpers/application_helper/page_layouts.rb b/app/helpers/application_helper/page_layouts.rb index 8211b485769..9fb4a8dde90 100644 --- a/app/helpers/application_helper/page_layouts.rb +++ b/app/helpers/application_helper/page_layouts.rb @@ -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