Skip to content

Commit

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

This reverts commit 4623738.
  • Loading branch information
janfaracik committed May 27, 2024
1 parent 2c02654 commit 69b320f
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 69b320f

Please sign in to comment.