Skip to content

Commit

Permalink
Revert "Remove 'Disable project' button from project view" (jenkinsci…
Browse files Browse the repository at this point in the history
…#9272)

This reverts commit 57d6464.
  • Loading branch information
basil authored May 14, 2024
1 parent a751e55 commit 4623738
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
9 changes: 9 additions & 0 deletions core/src/main/resources/lib/hudson/project/makeDisabled.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,14 @@ THE SOFTWARE.
</form>
</div>
</j:when>
<j:otherwise>
<div align="right">
<form method="post" id="disable-project" action="disable">
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Disable Project}" primary="false" />
</l:hasPermission>
</form>
</div>
</j:otherwise>
</j:choose>
</j:jelly>
14 changes: 8 additions & 6 deletions test/src/test/java/hudson/model/ProjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,15 @@ public void testDoDisable() throws Exception {

JenkinsRule.WebClient wc = j.createWebClient();
wc.withBasicCredentials(user.getId(), "password");
HtmlPage p = wc.goTo(project.getUrl());

HtmlPage p = wc.getPage(project, "configure");
HtmlForm form = p.getFormByName("config");
form.getInputByName("enable").click();
j.submit(form);

assertTrue("Project should be disabled.", project.isDisabled());
List<HtmlForm> forms = p.getForms();
for (HtmlForm form : forms) {
if ("disable".equals(form.getAttribute("action"))) {
j.submit(form);
}
}
assertTrue("Project should be disabled.", project.isDisabled());
}

@Test
Expand Down

0 comments on commit 4623738

Please sign in to comment.