Skip to content

Commit

Permalink
Fix Reset button for tag page in Services
Browse files Browse the repository at this point in the history
fixing https://bugzilla.redhat.com/show_bug.cgi?id=1445313

Fix Reset button for tag page opened from Service item detail page
in Services -> My Services.
  • Loading branch information
Hilda Stastna committed Jan 2, 2018
1 parent 629f2d6 commit b10e10d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller/explorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def x_history
def x_button
model, action = pressed2model_action(params[:pressed])

allowed_models = %w(common image instance vm miq_template provider storage configscript infra_networking automation_manager_provider configuration_manager_provider)
allowed_models = %w(common image instance vm miq_template provider storage configscript infra_networking automation_manager_provider configuration_manager_provider service)
raise ActionController::RoutingError.new('invalid button action') unless
allowed_models.include?(model)

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/application_controller/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def tagging_edit(db = nil, assert = true)
end
end

def service_tag
def service_tag(db = nil)
tagging_edit('Service')
end

Expand Down
5 changes: 1 addition & 4 deletions app/controllers/service_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ def button
tag(GenericObject) if @display == 'generic_objects' && params[:pressed] == 'generic_object_tag'
end

def x_button
generic_x_button(SERVICE_X_BUTTON_ALLOWED_ACTIONS)
end

def title
_("My Services")
end
Expand Down Expand Up @@ -387,6 +383,7 @@ def replace_right_cell(options = {})
return
end
action, replace_trees = options.values_at(:action, :replace_trees)
action = @sb[:action] if action.nil?
@explorer = true
partial, action_url, @right_cell_text = set_right_cell_vars(action) if action # Set partial name, action and cell header
get_node_info(x_node) if !action && !@in_a_form && !params[:display]
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ def adv_search_show_alias_checkbox?
end

def pressed2model_action(pressed)
pressed =~ /^(ems_cluster|miq_template|infra_networking|automation_manager_provider|configuration_manager_provider)_(.*)$/ ? [$1, $2] : pressed.split('_', 2)
pressed =~ /^(ems_cluster|miq_template|infra_networking|automation_manager_provider|configuration_manager_provider|service)_(.*)$/ ? [$1, $2] : pressed.split('_', 2)
end

def model_for_ems(record)
Expand Down

0 comments on commit b10e10d

Please sign in to comment.