Project

General

Profile

Bug #2335

submitting a puppet class edit should go back to the class' page

Added by David Schmitt over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Web Interface
Target version:
Difficulty:
trivial
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

When editing a puppet class, submitting the changes goes back to the list of all classes. This looses the user's context. It would be nice to return to the class itself or the actual page the edit was coming from.


Related issues

Related to Foreman - Bug #5773: editing resources in UI returns view to wrong page and searchClosed2014-05-17

Associated revisions

Revision fb95b3c7 (diff)
Added by Joseph Magen over 6 years ago

fixes #2335 - update puppetclass redirects to referrer page

Revision e60ae306 (diff)
Added by Joseph Magen over 6 years ago

fixes #2335 - update puppetclass redirects to referrer page
(cherry picked from commit fb95b3c779953dd59278edd16770fe0384e1e6e9)

History

#1 Updated by Sam Kottler over 6 years ago

  • Assignee deleted (Ohad Levy)
  • Target version set to 1.2.0
  • Difficulty set to trivial

#2 Updated by Greg Sutcliffe over 6 years ago

I can manage a simple redirect back to /puppetclasses/:id/edit easily enough, but that still loses the context of which class/smart variable you were editing. Perhaps Amos or Jospeh can show me a better way than this:

--- a/app/controllers/puppetclasses_controller.rb
+++ b/app/controllers/puppetclasses_controller.rb
@@ -44,10 +44,12 @@ class PuppetclassesController < ApplicationController
   def update
     if @puppetclass.update_attributes(params[:puppetclass])
       notice _("Successfully updated puppetclass.")
-      redirect_to puppetclasses_url
-    else
-      render :action => 'edit'
     end
     render :action => 'edit'
   end

#3 Updated by Joseph Magen over 6 years ago

  • Assignee set to Joseph Magen

#4 Updated by Joseph Magen over 6 years ago

Since there is no show action for puppetclass, I assume you want a redirect to the referrer page.

#5 Updated by Joseph Magen over 6 years ago

  • Status changed from New to Ready For Testing

#6 Updated by Dominic Cleal over 6 years ago

We're a bit confused on the PR as to which page it should redirect back to. Would it be the page that originally led you to the class edit page, e.g. the puppet classes list with your search terms and so on, or back to the class edit page itself, as if Submit was just an "Apply" button?

#7 Updated by Joseph Magen over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#8 Updated by Dominic Cleal over 5 years ago

  • Related to Bug #5773: editing resources in UI returns view to wrong page and search added

Also available in: Atom PDF