Skip to content

Commit

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

This reverts commit 4623738.
  • Loading branch information
janfaracik authored May 18, 2024
1 parent 5089ad5 commit 03e85b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
9 changes: 0 additions & 9 deletions core/src/main/resources/lib/hudson/project/makeDisabled.jelly
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,5 @@ 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: 6 additions & 8 deletions test/src/test/java/hudson/model/ProjectTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,13 @@ public void testDoDisable() throws Exception {

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

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());
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());
}

@Test
Expand Down

0 comments on commit 03e85b5

Please sign in to comment.