Skip to content

Commit

Permalink
Make redirects after actions the way user would expect
Browse files Browse the repository at this point in the history
When user deleted an object/container, she was always redirected
to the list of all containers, but this brings bad UX. Fixed by
redirecting user to the parent page of the element that she just
deleted - just like she would have expected.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1444078

Signed-off-by: Miha Pleško <miha.plesko@xlab.si>
  • Loading branch information
miha-plesko committed Apr 24, 2017
1 parent 03689c2 commit 0e6c19b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions app/controllers/cloud_object_store_container_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ def button

process_cloud_object_storage_buttons(params[:pressed])

if !@flash_array.nil? && params[:pressed].ends_with?("delete")
javascript_redirect :action => 'show_list',
:flash_msg => @flash_array[0][:message],
:flash_error => @flash_array[0][:level] == :error
if !@flash_array.nil? && params[:pressed].ends_with?("delete") && @display != "cloud_object_store_objects"
session[:flash_msgs] = @flash_array.dup
javascript_redirect previous_breadcrumb_url
elsif !@flash_array.nil?
render_flash unless performed?
end
Expand Down
5 changes: 2 additions & 3 deletions app/controllers/cloud_object_store_object_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ def button
process_cloud_object_storage_buttons(params[:pressed])

if !@flash_array.nil? && params[:pressed].ends_with?("delete")
javascript_redirect :action => 'show_list',
:flash_msg => @flash_array[0][:message],
:flash_error => @flash_array[0][:level] == :error
session[:flash_msgs] = @flash_array.dup
javascript_redirect previous_breadcrumb_url
elsif !@flash_array.nil?
render_flash unless performed?
end
Expand Down

0 comments on commit 0e6c19b

Please sign in to comment.