Skip to content

Commit

Permalink
[JENKINS-34200] Following the @jglick's suggestion described JENKINS-…
Browse files Browse the repository at this point in the history
…31601
  • Loading branch information
recena committed Apr 19, 2016
1 parent de3411c commit b895f08
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Expand Up @@ -81,6 +81,7 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.model.ModelObjectWithChildren;
Expand Down Expand Up @@ -707,13 +708,14 @@ public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws IOExc
}

/**
* Where user will be redirected after creating a {@code AbstractFolder}.
* Where user will be redirected after creating or reconfiguring a {@code AbstractFolder}.
*
* @return A string that represents the redirect location URL.
*
* @see javax.servlet.http.HttpServletResponse#sendRedirect(String)
*/
protected String getSuccessfulDestination() {
@Restricted(NoExternalUse.class)
protected @Nonnull String getSuccessfulDestination() {
return ".";
}

Expand Down
Expand Up @@ -74,6 +74,7 @@
import org.apache.commons.io.FileUtils;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.DoNotUse;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpResponses;
import org.kohsuke.stapler.QueryParameter;
Expand Down Expand Up @@ -234,6 +235,15 @@ protected void submit(StaplerRequest req, StaplerResponse rsp) throws IOExceptio
}
}

@Override
protected @Nonnull String getSuccessfulDestination() {
FolderComputation<I> computation = getComputation();
if (computation != null) {
return computation.getSearchUrl() + "console";
}
return super.getSuccessfulDestination();
}

public Map<TriggerDescriptor,Trigger<?>> getTriggers() {
return triggers.toMap();
}
Expand Down

0 comments on commit b895f08

Please sign in to comment.