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

Fix computer links in some cases #7608

Merged
merged 3 commits into from Feb 9, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions core/src/main/java/hudson/model/Computer.java
Expand Up @@ -775,10 +775,6 @@ public String getCaption() {
}

public String getUrl() {
if (Jenkins.get().hasAnyPermission(Jenkins.MANAGE, Jenkins.SYSTEM_READ)) {
return "manage/computer/" + Util.fullEncode(getName()) + "/";
}

return "computer/" + Util.fullEncode(getName()) + "/";
}

Expand Down
4 changes: 0 additions & 4 deletions core/src/main/java/jenkins/model/Jenkins.java
Expand Up @@ -5250,10 +5250,6 @@ public String getCaption() {

@Override
public String getUrl() {
if (Jenkins.get().hasAnyPermission(Jenkins.MANAGE, Jenkins.SYSTEM_READ)) {
return "manage/computer/(built-in)/";
}

return "computer/(built-in)/";
}

Expand Down
4 changes: 2 additions & 2 deletions core/src/main/resources/hudson/model/ComputerSet/index.jelly
Expand Up @@ -76,7 +76,7 @@ THE SOFTWARE.
</td>

<td>
<a href="${rootURL}/${c.url}" class="jenkins-table__link model-link inside">${c.displayName}</a>
<a href="../${c.url}" class="jenkins-table__link model-link inside">${c.displayName}</a>
</td>

<j:forEach var="m" items="${monitors}">
Expand All @@ -89,7 +89,7 @@ THE SOFTWARE.
<td class="jenkins-table__cell--tight">
<j:if test="${c.hasPermission(c.EXTENDED_READ)}">
<div class="jenkins-table__cell__button-wrapper">
<a href="${rootURL}/${c.url}configure" class="jenkins-table__button">
<a href="../${c.url}configure" class="jenkins-table__button">
<l:icon src="symbol-settings" />
</a>
</div>
Expand Down
6 changes: 3 additions & 3 deletions test/src/test/java/hudson/model/RSSTest.java
Expand Up @@ -183,7 +183,7 @@ public void latestBuilds_AllView() throws Exception {
public void checkWithSingleBuild_Rss_All_Computer() throws Exception {
runSuccessfulBuild();

String pathPrefix = "manage/computer/(built-in)/";
String pathPrefix = "computer/(built-in)/";
String displayName = Messages.Hudson_Computer_DisplayName();
String buildType = ALL_BUILD_TYPE;
String buildTitle = STABLE_BUILD_TITLE;
Expand All @@ -195,7 +195,7 @@ public void checkWithSingleBuild_Rss_All_Computer() throws Exception {
public void checkWithSingleBuild_Rss_Failed_Computer() throws Exception {
runFailingBuild();

String pathPrefix = "manage/computer/(built-in)/";
String pathPrefix = "computer/(built-in)/";
String displayName = Messages.Hudson_Computer_DisplayName();
String buildType = FAILED_BUILD_TYPE;
String buildTitle = FAILED_BUILD_TITLE;
Expand All @@ -205,7 +205,7 @@ public void checkWithSingleBuild_Rss_Failed_Computer() throws Exception {

@Test
public void latestBuilds_Computer() throws Exception {
String pathPrefix = "manage/computer/(built-in)/";
String pathPrefix = "computer/(built-in)/";
String displayName = Messages.Hudson_Computer_DisplayName();
String buildType = LATEST_BUILD_TYPE;
int expectedLinks = 3;
Expand Down