From 03e85b59783c76c7435a7a8edf218ff01863d4c5 Mon Sep 17 00:00:00 2001 From: Jan Faracik <43062514+janfaracik@users.noreply.github.com> Date: Sat, 18 May 2024 09:52:13 +0100 Subject: [PATCH] Revert "Revert "Remove 'Disable project' button from project view" (#9272)" This reverts commit 46237384bd58757a985e0949d5a8c7a998b9e256. --- .../lib/hudson/project/makeDisabled.jelly | 9 --------- test/src/test/java/hudson/model/ProjectTest.java | 14 ++++++-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/core/src/main/resources/lib/hudson/project/makeDisabled.jelly b/core/src/main/resources/lib/hudson/project/makeDisabled.jelly index 9eb7f4f6571c..e53f9ab12ad9 100644 --- a/core/src/main/resources/lib/hudson/project/makeDisabled.jelly +++ b/core/src/main/resources/lib/hudson/project/makeDisabled.jelly @@ -41,14 +41,5 @@ THE SOFTWARE. - -
-
- - - -
-
-
diff --git a/test/src/test/java/hudson/model/ProjectTest.java b/test/src/test/java/hudson/model/ProjectTest.java index 82d9266e0e62..e3f2d84493e3 100644 --- a/test/src/test/java/hudson/model/ProjectTest.java +++ b/test/src/test/java/hudson/model/ProjectTest.java @@ -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 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