From 46237384bd58757a985e0949d5a8c7a998b9e256 Mon Sep 17 00:00:00 2001 From: Basil Crow Date: Mon, 13 May 2024 18:08:37 -0700 Subject: [PATCH] Revert "Remove 'Disable project' button from project view" (#9272) This reverts commit 57d64642be1f6810f964e77f11b7382885d05d0e. --- .../lib/hudson/project/makeDisabled.jelly | 9 +++++++++ test/src/test/java/hudson/model/ProjectTest.java | 14 ++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/core/src/main/resources/lib/hudson/project/makeDisabled.jelly b/core/src/main/resources/lib/hudson/project/makeDisabled.jelly index e53f9ab12ad9..9eb7f4f6571c 100644 --- a/core/src/main/resources/lib/hudson/project/makeDisabled.jelly +++ b/core/src/main/resources/lib/hudson/project/makeDisabled.jelly @@ -41,5 +41,14 @@ THE SOFTWARE. + +
+
+ + + +
+
+
diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index e3f2d84493e3..82d9266e0e62 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -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 forms = p.getForms(); + for (HtmlForm form : forms) { + if ("disable".equals(form.getAttribute("action"))) { + j.submit(form); + } + } + assertTrue("Project should be disabled.", project.isDisabled()); } @Test