Skip to content

Commit

Permalink
[JENKINS-32340] Enable disabled dependencies
Browse files Browse the repository at this point in the history
(cherry picked from commit 2833569)
  • Loading branch information
fbelzunc authored and olivergondza committed May 25, 2016
1 parent 68a88a1 commit 1c416b8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/hudson/PluginWrapper.java
Expand Up @@ -531,7 +531,8 @@ public boolean hasLicensesXml() {
List<String> missingDependencies = new ArrayList<String>();
// make sure dependencies exist
for (Dependency d : dependencies) {
if (parent.getPlugin(d.shortName) == null)
PluginWrapper dependency = parent.getPlugin(d.shortName);
if (dependency == null || !dependency.isActive()) {
missingDependencies.add(d.toString());
}
if (!missingDependencies.isEmpty())
Expand Down
6 changes: 6 additions & 0 deletions core/src/main/resources/hudson/PluginManager/_table.js
Expand Up @@ -173,6 +173,12 @@ Behaviour.specify("#filter-box", '_table', 0, function(e) {

function setEnableWidgetStates() {
for (var i = 0; i < pluginTRs.length; i++) {
var pluginMetadata = pluginTRs[i].jenkinsPluginMetadata;
if (pluginTRs[i].hasClassName('has-dependants-but-disabled')) {
if (pluginMetadata.enableInput.checked) {
pluginTRs[i].removeClassName('has-dependants-but-disabled');
}
}
markAllDependantsDisabled(pluginTRs[i]);
markHasDisabledDependencies(pluginTRs[i]);
}
Expand Down
Expand Up @@ -68,7 +68,7 @@ THE SOFTWARE.
<th width="1">${%Uninstall}</th>
</tr>
<j:forEach var="p" items="${app.pluginManager.plugins}">
<tr class="plugin ${p.hasDependants()?'has-dependants':''} ${p.isDeleted()?'deleted':''}" data-plugin-id="${p.shortName}" data-plugin-name="${p.displayName}">
<tr class="plugin ${p.hasDependants()?'has-dependants':''} ${(p.hasDependants() &amp;&amp; !p.enabled)?'has-dependants-but-disabled':''} ${p.isDeleted()?'deleted':''}" data-plugin-id="${p.shortName}" data-plugin-name="${p.displayName}">
<j:set var="state" value="${p.enabled?'true':null}"/>
<td class="center pane enable" data="${state}">
<input type="checkbox" checked="${state}" onclick="flip(event)"
Expand Down
6 changes: 6 additions & 0 deletions war/src/main/webapp/css/style.css
Expand Up @@ -1349,6 +1349,12 @@ TABLE.fingerprint-in-build TD {
opacity: 0.2;
}

#plugins tr.has-dependants-but-disabled .enable input {
pointer-events: auto;
opacity: 1.0;
visibility: visible;
}

#plugins tr.has-disabled-dependency .enable input {
opacity: 0.4;
}
Expand Down

0 comments on commit 1c416b8

Please sign in to comment.