Skip to content

Commit

Permalink
[FIXED JENKINS-18633] Simplified distinction between Jenkins.descript…
Browse files Browse the repository at this point in the history
…ion and View.description.

Both are shown if defined. The edit description link only applies to View.description.
Properly handle a ViewGroup other than Jenkins itself, such as a folder.
(cherry picked from commit 04c8a1e)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and olivergondza committed Nov 2, 2013
1 parent 3695e61 commit 6243958
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
14 changes: 0 additions & 14 deletions core/src/main/java/hudson/model/AllView.java
Expand Up @@ -23,7 +23,6 @@
*/
package hudson.model;

import jenkins.model.Jenkins;
import org.kohsuke.stapler.DataBoundConstructor;
import org.kohsuke.stapler.Stapler;
import org.kohsuke.stapler.StaplerRequest;
Expand Down Expand Up @@ -53,11 +52,6 @@ public AllView(String name, ViewGroup owner) {
this.owner = owner;
}

@Override
public String getDescription() {
return Jenkins.getInstance().getDescription();
}

@Override
public boolean isEditable() {
return false;
Expand All @@ -82,14 +76,6 @@ public Collection<TopLevelItem> getItems() {
return (Collection)getOwnerItemGroup().getItems();
}

@Override
public synchronized void doSubmitDescription( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
checkPermission(Jenkins.ADMINISTER);

Jenkins.getInstance().setSystemMessage(req.getParameter("description"));
rsp.sendRedirect(".");
}

@Override
public String getPostConstructLandingPage() {
return ""; // there's no configuration page
Expand Down
Expand Up @@ -27,7 +27,7 @@ THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:f="/lib/form" xmlns:l="/lib/layout">
<j:if test="${it.class.name=='hudson.model.Hudson'}">
<j:if test="${it.primaryView != null}">
<j:set var="it" value="${it.primaryView}"/>
</j:if>
<l:ajax>
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/resources/hudson/model/View/index.jelly
Expand Up @@ -31,12 +31,10 @@ THE SOFTWARE.
<st:include page="view-index-top.jelly" it="${it.owner}" optional="true">
<!-- allow the owner to take over the top section, but we also need the default to be backward compatible -->
<div id="view-message">
<j:if test="${it.class.name!='hudson.model.AllView'}">
<div id="systemmessage">
<j:out value="${app.systemMessage!=null ? app.markupFormatter.translate(app.systemMessage) : ''}" />
</div>
</j:if>
<t:editableDescription permission="${app.ADMINISTER}"/>
<t:editableDescription permission="${it.CONFIGURE}"/>
</div>
</st:include>

Expand Down

1 comment on commit 6243958

@jglick
Copy link
Member Author

@jglick jglick commented on 6243958 Nov 2, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this commit is a behavioral change as well as a security bug fix, so it needs to be reviewed.

Please sign in to comment.