Skip to content

Commit

Permalink
[JENKINS-73930] Put back the disabled warning (jenkinsci#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick authored Dec 10, 2024
2 parents 6edc0fc + 5aaf0e1 commit 7d22c6e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ THE SOFTWARE.
<j:when test="${!it.supportsMakeDisabled()}">
<!-- for now, quietly omit the option -->
</j:when>
<j:when test="${it.disabled}">
<div id="disabled-message" class="warning">${%disabled(it.pronoun)}</div>
</j:when>
</j:choose>
<!-- give actions a chance to contribute summary item -->
<j:forEach var="a" items="${it.allActions}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;

import com.cloudbees.hudson.plugins.folder.AbstractFolderDescriptor;
import com.cloudbees.hudson.plugins.folder.Folder;
import com.cloudbees.hudson.plugins.folder.views.AbstractFolderViewHolder;
import org.htmlunit.html.DomElement;
import org.htmlunit.html.HtmlForm;
import org.htmlunit.html.HtmlPage;
import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down Expand Up @@ -625,6 +625,21 @@ public void failAllDeletedOnes() throws Exception {
d.assertItemNames(2, "A");
}

@Issue("JENKINS-73930")
@Test
public void disabledWarningFromUiViews() throws Exception {
LockedDownSampleComputedFolder folder = r.jenkins.createProject(LockedDownSampleComputedFolder.class, "d");
assertFalse("by default, a folder is disabled", folder.isDisabled());
for(View view : folder.getViews()){
assertNull(r.createWebClient().goTo(view.getViewUrl()).getElementById("disabled-message"));
}
folder.setDisabled(true);
folder.save();
for(View view : folder.getViews()){
assertNotNull(r.createWebClient().goTo(view.getViewUrl()).getElementById("disabled-message"));
}
}

/**
* Waits until Hudson finishes building everything, including those in the queue, or fail the test
* if the specified timeout milliseconds is
Expand Down

0 comments on commit 7d22c6e

Please sign in to comment.