Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-73930] Put back the disabled warning #433

Merged
merged 5 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading