Skip to content

Commit

Permalink
Remove 'Disable project' button from project view (#9202)
Browse files Browse the repository at this point in the history
* Update makeDisabled.jelly

* Update ProjectTest.java

* Update ProjectTest.java
  • Loading branch information
janfaracik committed May 10, 2024
1 parent 2610e43 commit 57d6464
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
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
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 57d6464

Please sign in to comment.