Skip to content

Commit

Permalink
Merge pull request #515 from jglick/JENKINS-14325
Browse files Browse the repository at this point in the history
JENKINS-14325: CCE & missing GUI when using jobs inside folders
  • Loading branch information
jglick committed Jul 10, 2012
2 parents 051b001 + ae3dac8 commit 788028f
Show file tree
Hide file tree
Showing 67 changed files with 186 additions and 179 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
Enable/disable GUI for jobs either did not appear, or threw exceptions, for jobs inside folders
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14325">issue 14325</a>)
<li class=bug>
<code>NullPointerException</code> from <code>UnlabeldLoadStatistics</code> <i>[sic]</i>
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-14330">issue 14330</a>)
Expand Down
11 changes: 11 additions & 0 deletions core/src/main/java/hudson/model/AbstractProject.java
Expand Up @@ -620,6 +620,17 @@ public void makeDisabled(boolean b) throws IOException {
save();
}

/**
* Specifies whether this project may be disabled by the user.
* By default, it can be only if this is a {@link TopLevelItem};
* would be false for matrix configurations, etc.
* @return true if the GUI should allow {@link #doDisable} and the like
* @since 1.475
*/
public boolean supportsMakeDisabled() {
return this instanceof TopLevelItem;
}

public void disable() throws IOException {
makeDisabled(true);
}
Expand Down
22 changes: 1 addition & 21 deletions core/src/main/resources/hudson/matrix/MatrixProject/index.jelly
Expand Up @@ -33,27 +33,7 @@ THE SOFTWARE.
</j:if>
<t:editableDescription permission="${it.CONFIGURE}"/>

<j:choose>
<j:when test="${it.disabled}">
<div class="warning">
<form method="post" action="enable">
${%This project is currently disabled}
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Enable}" />
</l:hasPermission>
</form>
</div>
</j:when>
<j:otherwise>
<div align="right">
<form method="post" action="disable">
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Disable Project}" />
</l:hasPermission>
</form>
</div>
</j:otherwise>
</j:choose>
<st:include page="makeDisabled.jelly" />

<st:include page="ajaxMatrix.jelly" />

Expand Down
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Vypnout projekt
Project=Projekt
Expand Up @@ -20,6 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

This\ project\ is\ currently\ disabled=Dette projekt er for nuv\u00e6rende sl\u00e5et fra
Enable=Sl\u00e5 til
Project=Projekt
Expand Up @@ -22,6 +22,3 @@

Latest\ Test\ Result=Aktuelle Testergebnisse
Project=Projekt
Enable=Aktivieren
This\ project\ is\ currently\ disabled=Dieses Projekt ist momentan deaktiviert.
Disable\ Project=Projekt deaktivieren
Expand Up @@ -21,8 +21,5 @@
# THE SOFTWARE.

Project=Proyecto
Disable\ Project=Desactivar el proyecto
This\ project\ is\ currently\ disabled=Este proyecto está desactivado
Enable=Activar
Latest\ Test\ Result=Último resultado de test
Latest\ Test\ Result=\u00daltimo resultado de test
Project\ name=Nombre de proyecto
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Poista k\u00E4yt\u00F6st\u00E4
Project=Projekti
Expand Up @@ -20,8 +20,5 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=D\u00E9sactiver le projet
Enable=Activer
Latest\ Test\ Result=Derniers r\u00E9sultats de test
Latest\ Test\ Result=Derniers r\u00e9sultats de test
Project=projet
This\ project\ is\ currently\ disabled=Ce projet est d\u00E9sactiv\u00E9
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Disabilita Progetto
Project=Progetto
Expand Up @@ -21,8 +21,5 @@
# THE SOFTWARE.

Project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8
This\ project\ is\ currently\ disabled=\u73fe\u5728\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u7121\u52b9\u3067\u3059\u3002
Enable=\u6709\u52b9\u5316
Disable\ Project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7121\u52b9\u5316
Project\ name=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d
Latest\ Test\ Result=\u6700\u65b0\u306e\u30c6\u30b9\u30c8\u7d50\u679c
Expand Up @@ -20,7 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Wy\u0142\u0105cz projekt
Enable=Aktywuj
Project=Projekt
This\ project\ is\ currently\ disabled=Projekt jest nieaktywny
Expand Up @@ -20,7 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=\u041E\u0442\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0435\u043A\u0442
Enable=\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C
Project=\u041f\u0440\u043e\u0435\u043a\u0442
This\ project\ is\ currently\ disabled=\u042D\u0442\u043E\u0442 \u043F\u0440\u043E\u0435\u043A\u0442 \u0441\u0435\u0439\u0447\u0430\u0441 \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D.
Expand Up @@ -20,5 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=\u7981\u7528\u9879\u76EE
Project=\u9879\u76EE
Project=\u9879\u76ee
Expand Up @@ -27,6 +27,10 @@ THE SOFTWARE.
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<p:projectActionFloatingBox />

<j:if test="${it.supportsMakeDisabled()}">
<st:include page="makeDisabled.jelly" />
</j:if>

<table style="margin-top: 1em; margin-left:1em;">

<j:forEach var="act" items="${it.prominentActions}">
Expand Down
@@ -0,0 +1,48 @@
<!--
The MIT License
Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Erik Ramfelt, Tom Huybrechts, id:cactusman
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->

<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<j:choose>
<j:when test="${it.disabled}">
<div class="warning">
<form method="post" action="enable">
${%This project is currently disabled}
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Enable}" />
</l:hasPermission>
</form>
</div>
</j:when>
<j:otherwise>
<div align="right">
<form method="post" action="disable">
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Disable Project}" />
</l:hasPermission>
</form>
</div>
</j:otherwise>
</j:choose>
</j:jelly>
Expand Up @@ -20,4 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Onemogo\u010Di Projekt
This\ project\ is\ currently\ disabled=Este projecto est\u00e1 desactivado actualmente
Enable=Activar
Disable\ Project=Desactivar el Proyecto
@@ -0,0 +1,25 @@
# The MIT License
#
# Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe, id:cactusman
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

This\ project\ is\ currently\ disabled=\u73fe\u5728\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u7121\u52b9\u3067\u3059\u3002
Enable=\u6709\u52b9\u5316
Disable\ Project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7121\u52b9\u5316
@@ -1,17 +1,17 @@
# The MIT License
#
# Copyright (c) 2004-2010, Sun Microsystems, Inc.
#
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, id:sorokh
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand All @@ -20,6 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=\u95DC\u9589\u5C08\u6848
Enable=\u555F\u7528
This\ project\ is\ currently\ disabled=\u672C\u5C08\u6848\u76EE\u524D\u662F\u505C\u7528\u7684\u3002
Disable\ Project=Deactiveer project
Enable=Activeren
This\ project\ is\ currently\ disabled=Dit project is gedeactiveerd
@@ -0,0 +1,25 @@
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Mike Salnikov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442
Enable=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c
This\ project\ is\ currently\ disabled=\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d
@@ -0,0 +1,24 @@
# The MIT License
#
# Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi, Oguz Dag
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

Disable\ Project=Projeyi devre d\u0131\u015f\u0131 b\u0131rak
This\ project\ is\ currently\ disabled=Bu proje \u015fimdilik devre d\u0131\u015f\u0131
24 changes: 0 additions & 24 deletions core/src/main/resources/hudson/model/Job/index.jelly
Expand Up @@ -33,30 +33,6 @@ THE SOFTWARE.
</j:if>
<t:editableDescription permission="${it.CONFIGURE}"/>

<j:if test="${it.parent == app}">
<j:choose>
<j:when test="${it.disabled}">
<div class="warning">
<form method="post" action="enable">
${%This project is currently disabled}
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Enable}" />
</l:hasPermission>
</form>
</div>
</j:when>
<j:otherwise>
<div align="right">
<form method="post" action="disable">
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Disable Project}" />
</l:hasPermission>
</form>
</div>
</j:otherwise>
</j:choose>
</j:if>

<st:include page="jobpropertysummaries.jelly" />
<!-- inject main part here -->
<st:include page="main.jelly" />
Expand Down
3 changes: 0 additions & 3 deletions core/src/main/resources/hudson/model/Job/index_es.properties
Expand Up @@ -20,7 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

This\ project\ is\ currently\ disabled=Este projecto está desactivado actualmente
Enable=Activar
Disable\ Project=Desactivar el Proyecto
Project\ name=Nombre del Proyecto
3 changes: 0 additions & 3 deletions core/src/main/resources/hudson/model/Job/index_ja.properties
Expand Up @@ -20,7 +20,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

This\ project\ is\ currently\ disabled=\u73fe\u5728\u3001\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u7121\u52b9\u3067\u3059\u3002
Enable=\u6709\u52b9\u5316
Disable\ Project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u7121\u52b9\u5316
Project\ name=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d
3 changes: 0 additions & 3 deletions core/src/main/resources/hudson/model/Job/index_nl.properties
Expand Up @@ -21,10 +21,7 @@
# THE SOFTWARE.

Permalinks=Permanente referenties
Disable\ Project=Deactiveer project
Enable=Activeren
Last\ build=Laatste bouwpoging
Last\ stable\ build=Laatste stabiele bouwpoging
Last\ successful\ build=Laatste succesvolle bouwpoging
Last\ failed\ build=Laatst gefaalde bouwpoging
This\ project\ is\ currently\ disabled=Dit project is gedeactiveerd
3 changes: 0 additions & 3 deletions core/src/main/resources/hudson/model/Job/index_ru.properties
Expand Up @@ -21,10 +21,7 @@
# THE SOFTWARE.

Permalinks=\u041f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438
Disable\ Project=\u0412\u044B\u043A\u043B\u044E\u0447\u0438\u0442\u044C \u043F\u0440\u043E\u0435\u043A\u0442
Enable=\u0412\u043A\u043B\u044E\u0447\u0438\u0442\u044C
Last\ build=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0431\u043e\u0440\u043a\u0430
Last\ stable\ build=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430
Last\ successful\ build=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u0430\u044f \u0441\u0431\u043e\u0440\u043a\u0430
Last\ failed\ build=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043f\u0440\u043e\u0432\u0430\u043b\u0438\u0432\u0448\u0430\u044f\u0441\u044f \u0441\u0431\u043e\u0440\u043a\u0430
This\ project\ is\ currently\ disabled=\u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d
2 changes: 0 additions & 2 deletions core/src/main/resources/hudson/model/Job/index_tr.properties
Expand Up @@ -21,9 +21,7 @@
# THE SOFTWARE.

Permalinks=Permalinks
Disable\ Project=Projeyi devre d\u0131\u015F\u0131 b\u0131rak
Last\ build=Son yap\u0131land\u0131rma
Last\ stable\ build=Son stabil yap\u0131land\u0131rma
Last\ successful\ build=Son ba\u015far\u0131l\u0131 yap\u0131land\u0131rma
Last\ failed\ build=Son ba\u015far\u0131s\u0131z yap\u0131land\u0131rma
This\ project\ is\ currently\ disabled=Bu proje \u015fimdilik devre d\u0131\u015f\u0131

0 comments on commit 788028f

Please sign in to comment.