Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove disable button to match other job type since 2.460 #419

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
<properties>
<changelist>999999-SNAPSHOT</changelist>
<gitHubRepo>jenkinsci/${project.artifactId}-plugin</gitHubRepo>
<jenkins.version>2.454</jenkins.version>
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
<jenkins.baseline>2.462</jenkins.baseline>
<jenkins.version>${jenkins.baseline}.1</jenkins.version>
<no-test-jar>false</no-test-jar>
<hpi.compatibleSinceVersion>5.2</hpi.compatibleSinceVersion>
<useBeta>true</useBeta> <!-- needed for Jenkins.MANAGE support -->
Expand Down Expand Up @@ -58,8 +60,8 @@
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.440.x</artifactId>
<version>2982.vdce2153031a_0</version>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>3276.vcd71db_867fb_2</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,6 @@ THE SOFTWARE.
<j:when test="${!it.supportsMakeDisabled()}">
<!-- for now, quietly omit the option -->
</j:when>
<j:when test="${it.disabled}">
<div class="warning">
<form method="post" id='enable-project' action="${rootURL}/${it.url}enable">
${%disabled(it.pronoun)}<st:nbsp/>
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%Enable}"/>
</l:hasPermission>
</form>
</div>
</j:when>
<j:otherwise>
<div align="right">
<form method="post" id="disable-project" action="${rootURL}/${it.url}disable">
<l:hasPermission permission="${it.CONFIGURE}">
<f:submit value="${%disable(it.pronoun)}"/>
</l:hasPermission>
</form>
</div>
</j:otherwise>
</j:choose>
<!-- give actions a chance to contribute summary item -->
<j:forEach var="a" items="${it.allActions}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,45 +609,6 @@ public void renameWhileComputing() throws Exception {
waitUntilNoActivityIgnoringThreadDeathUpTo(10000);
d.checkRename("d2");
}

@Issue("JENKINS-60900")
@Test
public void enabledAndDisableFromUi() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SampleComputedFolder folder = r.jenkins.createProject(SampleComputedFolder.class, "d");
assertFalse("by default, a folder is disabled", folder.isDisabled());
HtmlForm cfg = (HtmlForm)r.createWebClient().getPage(folder).getElementById("disable-project");
assertNotNull(cfg);
// Disable the folder
r.submit(cfg);
assertTrue(folder.isDisabled());
cfg = (HtmlForm)r.createWebClient().getPage(folder).getElementById("enable-project");
assertNotNull(cfg);
// Re enable the folder
r.submit(cfg);
assertFalse(folder.isDisabled());
}

@Issue("JENKINS-66168")
@Test
public void enabledAndDisableFromUiViews() throws Exception {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LockedDownSampleComputedFolder folder = r.jenkins.createProject(LockedDownSampleComputedFolder.class, "d");
assertFalse("by default, a folder is disabled", folder.isDisabled());
folder.getViews().forEach(view -> {
try {
String viewUrl =view.getViewUrl();
HtmlForm cfg = (HtmlForm) r.createWebClient().goTo(viewUrl).getElementById("disable-project");
assertNotNull(cfg);
r.submit(cfg);
assertTrue("Can disable from view " + view.getViewName(), folder.isDisabled());
cfg = (HtmlForm) r.createWebClient().goTo(viewUrl).getElementById("enable-project");
assertNotNull(cfg);
r.submit(cfg);
assertFalse("Can enable from view " + view.getViewName(), folder.isDisabled());
} catch (Exception e) {
Assert.fail();
}
});
}

@Test
public void failAllDeletedOnes() throws Exception {
Expand Down