From fbc1f7fea54ef2e84aa15e12e90ea27c8327a52e Mon Sep 17 00:00:00 2001 From: Harpreet Kataria Date: Fri, 5 Feb 2021 16:10:16 -0500 Subject: [PATCH] Renamed miq_event related files to miq_event_definition for consistency --- ...t_controller.rb => miq_event_definition_controller.rb} | 4 ++-- app/helpers/application_helper.rb | 2 -- app/helpers/application_helper/page_layouts.rb | 2 +- .../{miq_event => miq_event_definition}/show.html.haml | 0 .../show_list.html.haml | 0 config/routes.rb | 5 +---- product/views/{MiqEvent.yaml => MiqEventDefinition.yaml} | 0 spec/config/routes.pending.yml | 2 +- spec/helpers/application_helper_spec.rb | 8 ++++---- 9 files changed, 9 insertions(+), 14 deletions(-) rename app/controllers/{miq_event_controller.rb => miq_event_definition_controller.rb} (93%) rename app/views/{miq_event => miq_event_definition}/show.html.haml (100%) rename app/views/{miq_event => miq_event_definition}/show_list.html.haml (100%) rename product/views/{MiqEvent.yaml => MiqEventDefinition.yaml} (100%) diff --git a/app/controllers/miq_event_controller.rb b/app/controllers/miq_event_definition_controller.rb similarity index 93% rename from app/controllers/miq_event_controller.rb rename to app/controllers/miq_event_definition_controller.rb index 9eca40dd8f4..b0b310ba5ed 100644 --- a/app/controllers/miq_event_controller.rb +++ b/app/controllers/miq_event_definition_controller.rb @@ -1,4 +1,4 @@ -class MiqEventController < ApplicationController +class MiqEventDefinitionController < ApplicationController before_action :check_privileges before_action :get_session_data after_action :cleanup_action @@ -36,7 +36,7 @@ def init_show def get_session_data @title = _("Events") - @layout = "miq_event" + @layout = "miq_event_definition" @lastaction = session[:miq_event_lastaction] @display = session[:miq_event_display] @current_page = session[:miq_event_current_page] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c32a264f7bc..5d08af78a94 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -390,8 +390,6 @@ def db_to_controller(db, action = "show") when "ScanItemSet" controller = "ops" action = "ap_show" - when "MiqEventDefinition" - controller = "miq_event" when "User", "Group", "Patch", "GuestApplication" controller = "vm" action = @lastaction diff --git a/app/helpers/application_helper/page_layouts.rb b/app/helpers/application_helper/page_layouts.rb index 6e3bc319b3a..a98a962a06d 100644 --- a/app/helpers/application_helper/page_layouts.rb +++ b/app/helpers/application_helper/page_layouts.rb @@ -28,7 +28,7 @@ def layout_uses_listnav? miq_ae_export miq_ae_logs miq_ae_tools - miq_event + miq_event_definition miq_policy miq_policy_export miq_policy_logs diff --git a/app/views/miq_event/show.html.haml b/app/views/miq_event_definition/show.html.haml similarity index 100% rename from app/views/miq_event/show.html.haml rename to app/views/miq_event_definition/show.html.haml diff --git a/app/views/miq_event/show_list.html.haml b/app/views/miq_event_definition/show_list.html.haml similarity index 100% rename from app/views/miq_event/show_list.html.haml rename to app/views/miq_event_definition/show_list.html.haml diff --git a/config/routes.rb b/config/routes.rb index 68a49c975e6..23e63a91bcb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2181,14 +2181,11 @@ x_post }, - :miq_event => { + :miq_event_definition => { :get => %w( show show_list ), - :post => %w( - - ) }, :condition => { diff --git a/product/views/MiqEvent.yaml b/product/views/MiqEventDefinition.yaml similarity index 100% rename from product/views/MiqEvent.yaml rename to product/views/MiqEventDefinition.yaml diff --git a/spec/config/routes.pending.yml b/spec/config/routes.pending.yml index f593dd025a9..bf7b299038b 100644 --- a/spec/config/routes.pending.yml +++ b/spec/config/routes.pending.yml @@ -808,7 +808,7 @@ MiqAlertSetController: - x_history - x_search_by_name - x_show -MiqEventController: +MiqEventDefinitionController: - index MiqPolicyController: - adv_search_button diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index f5e2d702560..d43a8cf0948 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -388,14 +388,14 @@ it "and @explorer" do @explorer = true - expect(subject[0]).to eq("event") - expect(subject[1]).to eq("_none_") + expect(subject[0]).to eq("miq_event_definition") + expect(subject[1]).to eq("x_show") end it "and not @explorer" do @explorer = nil - expect(subject[0]).to eq("event") - expect(subject[1]).to eq("_none_") + expect(subject[0]).to eq("miq_event_definition") + expect(subject[1]).to eq("show") end end