From 21a188aad134c69739b5f9dce43f0981580721ac Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Wed, 8 Feb 2017 13:37:14 +0100 Subject: [PATCH] SONAR-8750 Return sonar.lf.sonarqube.com.enabled in api/navigation/global --- .../src/main/java/org/sonar/server/ui/ws/GlobalAction.java | 2 ++ .../src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java | 1 + .../org/sonar/server/ui/ws/GlobalActionTest/settings.json | 1 + .../java/org/sonar/core/config/CorePropertyDefinitions.java | 2 +- .../src/main/java/org/sonar/core/config/WebConstants.java | 2 ++ 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/GlobalAction.java b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/GlobalAction.java index 1f931512ae0..fd465766dc7 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/ui/ws/GlobalAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/ui/ws/GlobalAction.java @@ -35,6 +35,7 @@ import org.sonar.db.dialect.H2; import org.sonar.server.ui.PageRepository; import static org.sonar.api.CoreProperties.RATING_GRID; +import static org.sonar.core.config.WebConstants.SONARQUBE_DOT_COM_ENABLED; import static org.sonar.core.config.WebConstants.SONAR_LF_ENABLE_GRAVATAR; import static org.sonar.core.config.WebConstants.SONAR_LF_GRAVATAR_SERVER_URL; import static org.sonar.core.config.WebConstants.SONAR_LF_LOGO_URL; @@ -49,6 +50,7 @@ public class GlobalAction implements NavigationWsAction { SONAR_LF_ENABLE_GRAVATAR, SONAR_LF_GRAVATAR_SERVER_URL, SONAR_UPDATECENTER_ACTIVATE, + SONARQUBE_DOT_COM_ENABLED, RATING_GRID); private final PageRepository pageRepository; diff --git a/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java b/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java index 932da2056ac..2710029bca4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java @@ -88,6 +88,7 @@ public class GlobalActionTest { settings.setProperty("sonar.lf.logoWidthPx", 135); settings.setProperty("sonar.lf.gravatarServerUrl", "https://secure.gravatar.com/avatar/{EMAIL_MD5}.jpg?s={SIZE}&d=identicon"); settings.setProperty("sonar.lf.enableGravatar", true); + settings.setProperty("sonar.lf.sonarqube.com.enabled", true); settings.setProperty("sonar.updatecenter.activate", false); settings.setProperty("sonar.technicalDebt.ratingGrid", "0.05,0.1,0.2,0.5"); // This setting should be ignored as it's not needed diff --git a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/GlobalActionTest/settings.json b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/GlobalActionTest/settings.json index 3fc38cdd2a0..bf414b18b00 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/GlobalActionTest/settings.json +++ b/server/sonar-server/src/test/resources/org/sonar/server/ui/ws/GlobalActionTest/settings.json @@ -4,6 +4,7 @@ "sonar.lf.logoWidthPx": "135", "sonar.lf.gravatarServerUrl": "https://secure.gravatar.com/avatar/{EMAIL_MD5}.jpg?s={SIZE}&d=identicon", "sonar.lf.enableGravatar": "true", + "sonar.lf.sonarqube.com.enabled": "true", "sonar.updatecenter.activate": "false", "sonar.technicalDebt.ratingGrid": "0.05,0.1,0.2,0.5" } diff --git a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java index ffac9913d82..7553822770a 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java +++ b/sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java @@ -192,7 +192,7 @@ public class CorePropertyDefinitions { .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) .build(), - PropertyDefinition.builder("sonar.lf.aboutText") + PropertyDefinition.builder(WebConstants.SONAR_LF_ABOUT_TEXT) .name("About page text") .description("Optional text that is displayed on the About page. Supports html.") .category(CoreProperties.CATEGORY_GENERAL) diff --git a/sonar-core/src/main/java/org/sonar/core/config/WebConstants.java b/sonar-core/src/main/java/org/sonar/core/config/WebConstants.java index 2c89edfbb93..25e265e7754 100644 --- a/sonar-core/src/main/java/org/sonar/core/config/WebConstants.java +++ b/sonar-core/src/main/java/org/sonar/core/config/WebConstants.java @@ -29,7 +29,9 @@ public final class WebConstants { public static final String SONAR_LF_GRAVATAR_SERVER_URL = "sonar.lf.gravatarServerUrl"; public static final String SONAR_LF_LOGO_URL = "sonar.lf.logoUrl"; public static final String SONAR_LF_LOGO_WIDTH_PX = "sonar.lf.logoWidthPx"; + public static final String SONAR_LF_ABOUT_TEXT = "sonar.lf.aboutText"; public static final String SONAR_UPDATECENTER_ACTIVATE = "sonar.updatecenter.activate"; + public static final String SONARQUBE_DOT_COM_ENABLED = "sonar.lf.sonarqube.com.enabled"; private WebConstants() { } -- 2.39.5