Skip to content

Commit

Permalink
Minor style fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpovolny committed Apr 25, 2018
1 parent 71ff7bd commit 0c3eca4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions app/controllers/ems_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def edit
def timeline_pressed
@record = find_record_with_rbac(model, params[:id])
session[:tl_record_id] = @record.id
javascript_redirect polymorphic_path(@record, :display => 'timeline')
javascript_redirect(polymorphic_path(@record, :display => 'timeline'))
end

def performance_pressed
Expand All @@ -177,14 +177,14 @@ def performance_pressed
drop_breadcrumb(:name => _("%{name} Capacity & Utilization") % {:name => @record.name},
:url => show_link(@record, :refresh => "n", :display => "performance"))
perf_gen_init_options # Intialize options, charts are generated async
javascript_redirect polymorphic_path(@record, :display => "performance")
javascript_redirect(polymorphic_path(@record, :display => "performance"))
end

def ad_hoc_metrics_pressed
@showtype = "ad_hoc_metrics"
@record = find_record_with_rbac(model, params[:id])
drop_breadcrumb(:name => @record.name + _(" (Ad hoc Metrics)"), :url => show_link(@record))
javascript_redirect polymorphic_path(@record, :display => "ad_hoc_metrics")
javascript_redirect(polymorphic_path(@record, :display => "ad_hoc_metrics"))
end

# handle buttons pressed on the button bar
Expand Down
13 changes: 8 additions & 5 deletions app/controllers/mixins/ems_common_angular.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ def update_ems_button_cancel
flash_to_session(_("Edit of %{model} \"%{name}\" was cancelled by the user") %
{:model => ui_lookup(:model => model.to_s), :name => update_ems.name}
)
url_args = {:action => @lastaction == 'show_dashboard' ? 'show' : @lastaction,
:id => update_ems.id,
:display => session[:ems_display],
:record => update_ems}
url_args = {
:action => @lastaction == 'show_dashboard' ? 'show' : @lastaction,
:id => update_ems.id,
:display => session[:ems_display],
:record => update_ems
}

begin # if the target URL does not exist, redirect to 'show'
begin
javascript_redirect(javascript_process_redirect_args(url_args))
rescue ActionController::UrlGenerationError
# if the target URL does not exist, redirect to 'show'
url_args[:action] = 'show'
javascript_redirect(javascript_process_redirect_args(url_args))
end
Expand Down

0 comments on commit 0c3eca4

Please sign in to comment.