]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9378 Rename "sonar.lf.sonarqube.com.enabled" setting
authorJulien HENRY <henryju@yahoo.fr>
Tue, 3 Oct 2017 12:55:22 +0000 (14:55 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 4 Oct 2017 11:48:58 +0000 (13:48 +0200)
14 files changed:
server/sonar-ce/src/test/java/org/sonar/ce/container/ComputeEngineContainerImplTest.java
server/sonar-server/src/main/java/org/sonar/server/ui/ws/GlobalAction.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/GlobalActionTest.java
server/sonar-server/src/test/resources/org/sonar/server/ui/ws/GlobalActionTest/settings.json
server/sonar-web/src/main/js/app/components/App.tsx
server/sonar-web/src/main/js/app/components/DefaultHelmetContainer.js
server/sonar-web/src/main/js/app/components/GlobalFooterContainer.js
server/sonar-web/src/main/js/app/components/nav/global/GlobalNav.js
server/sonar-web/src/main/js/apps/about/components/AboutApp.js
server/sonar-web/src/main/js/apps/tutorials/onboarding/OnboardingContainer.js
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
sonar-core/src/main/java/org/sonar/core/config/WebConstants.java
sonar-core/src/main/java/org/sonar/core/config/WebProperties.java [new file with mode: 0644]
sonar-core/src/test/java/org/sonar/core/config/CorePropertyDefinitionsTest.java

index 7c71c910ed324becb90c35dcac79068951e2fd76..8a003284a5dee7a4dda22c1e470031be48849d11 100644 (file)
@@ -110,7 +110,7 @@ public class ComputeEngineContainerImplTest {
       picoContainer.getComponentAdapters().stream()
         .map(ComponentAdapter::getComponentImplementation)
         .collect(Collectors.toList())).contains((Class) StartableHazelcastMember.class,
-      (Class) CeDistributedInformationImpl.class);
+          (Class) CeDistributedInformationImpl.class);
     underTest.stop();
   }
 
@@ -139,7 +139,7 @@ public class ComputeEngineContainerImplTest {
           + 4 // content of ReportAnalysisFailureNotificationModule
           + 3 // CeCleaningModule + its content
           + 1 // CeDistributedInformation
-      );
+    );
     assertThat(picoContainer.getParent().getComponentAdapters()).hasSize(
       CONTAINER_ITSELF
         + 5 // level 3
@@ -154,15 +154,15 @@ public class ComputeEngineContainerImplTest {
         + 26 // level 1
         + 51 // content of DaoModule
         + 3 // content of EsSearchModule
-        + 65 // content of CorePropertyDefinitions
+        + 66 // content of CorePropertyDefinitions
         + 1 // StopFlagContainer
     );
     assertThat(
       picoContainer.getComponentAdapters().stream()
         .map(ComponentAdapter::getComponentImplementation)
         .collect(Collectors.toList())).doesNotContain((Class) StartableHazelcastMember.class,
-      (Class) CeDistributedInformationImpl.class).contains(
-      (Class) StandaloneCeDistributedInformation.class);
+          (Class) CeDistributedInformationImpl.class).contains(
+            (Class) StandaloneCeDistributedInformation.class);
     assertThat(picoContainer.getParent().getParent().getParent().getParent()).isNull();
     underTest.stop();
 
index 5364af20f5948c41c036645bcc23a935b91639c7..42652292532fbffd9729f793729f5940489b76ab 100644 (file)
@@ -40,7 +40,7 @@ import org.sonar.server.ui.VersionFormatter;
 import org.sonar.server.user.UserSession;
 
 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.SONARCLOUD_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;
@@ -55,7 +55,7 @@ public class GlobalAction implements NavigationWsAction {
     SONAR_LF_ENABLE_GRAVATAR,
     SONAR_LF_GRAVATAR_SERVER_URL,
     SONAR_UPDATECENTER_ACTIVATE,
-    SONARQUBE_DOT_COM_ENABLED,
+    SONARCLOUD_ENABLED,
     RATING_GRID);
 
   private final PageRepository pageRepository;
index 562417f1969754e909bb692002e024686ed1798e..bdc667d415faa2743d9f7fa6d41a0b9ab453db11 100644 (file)
@@ -95,7 +95,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.sonarcloud.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
index bf414b18b0004765c1bc0b4c85f10cc7a487aebd..885c52ba52ae475e62eb697da08ab632c6ef34c2 100644 (file)
@@ -4,7 +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.sonarcloud.enabled": "true",
     "sonar.updatecenter.activate": "false",
     "sonar.technicalDebt.ratingGrid": "0.05,0.1,0.2,0.5"
   }
index 8ab6f6b8f404325c74d8ab32bfca3b44cf7252ec..e69c1116cda22eb354a1965b568dbcd03125fbae 100644 (file)
@@ -74,7 +74,7 @@ class App extends React.PureComponent<Props, State> {
       if (this.mounted) {
         const onSonarCloud =
           appState.settings != undefined &&
-          appState.settings['sonar.lf.sonarqube.com.enabled'] === 'true';
+          appState.settings['sonar.sonarcloud.enabled'] === 'true';
         this.setState({
           branchesEnabled: appState.branchesEnabled,
           canAdmin: appState.canAdmin,
index 36d16d56568016390cebaa0afe5b1aa8978c5e44..8a3be89e41fa9c2f123135dae5a540b3f27c93d4 100644 (file)
@@ -36,7 +36,7 @@ function DefaultHelmetContainer({ children, sonarqubeDotCom }) {
 }
 
 const mapStateToProps = state => ({
-  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.lf.sonarqube.com.enabled')
+  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled')
 });
 
 export default connect(mapStateToProps)(DefaultHelmetContainer);
index 02d44ad5ba4118025792a15ac5782fd22f188d69..4a2a7725cefedaae796c0b8167d820f62050aae6 100644 (file)
@@ -25,7 +25,7 @@ import GlobalFooter from './GlobalFooter';
 const mapStateToProps = state => ({
   sonarqubeVersion: getAppState(state).version,
   productionDatabase: getAppState(state).productionDatabase,
-  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.lf.sonarqube.com.enabled')
+  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled')
 });
 
 export default connect(mapStateToProps)(GlobalFooter);
index fe155adbbe6c22db952995171f24890cfe7d02fc..4611d30d5c80dac6450bd6698c0ceaeb9a7ec7ac 100644 (file)
@@ -144,7 +144,7 @@ class GlobalNav extends React.PureComponent {
 }
 
 const mapStateToProps = state => {
-  const sonarCloudSetting = getGlobalSettingValue(state, 'sonar.lf.sonarqube.com.enabled');
+  const sonarCloudSetting = getGlobalSettingValue(state, 'sonar.sonarcloud.enabled');
 
   return {
     currentUser: getCurrentUser(state),
index d736f7543106471a2b34b28de1246f9fd3f92aa1..c748fa6044465af41f9d4c7c8ee9ac15613589fd 100644 (file)
@@ -203,7 +203,7 @@ const mapStateToProps = state => ({
   appState: getAppState(state),
   currentUser: getCurrentUser(state),
   customText: getGlobalSettingValue(state, 'sonar.lf.aboutText'),
-  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.lf.sonarqube.com.enabled')
+  sonarqubeDotCom: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled')
 });
 
 const mapDispatchToProps = { fetchAboutPageSettings };
index 246062de81888cba32ed8444a8d925a6150e9ca3..c1b395878e4b52fa930e1bdb41a97a835f11502f 100644 (file)
@@ -27,7 +27,7 @@ import {
 } from '../../../store/rootReducer';
 
 const mapStateToProps = state => {
-  const sonarCloudSetting = getGlobalSettingValue(state, 'sonar.lf.sonarqube.com.enabled');
+  const sonarCloudSetting = getGlobalSettingValue(state, 'sonar.sonarcloud.enabled');
 
   return {
     currentUser: getCurrentUser(state),
index 562a5e7cf7aa8ac90a1bc832287200f70ddfe1dc..1836e69ab52d77103a80b17c2b33f1e38293c969 100644 (file)
@@ -63,6 +63,7 @@ public class CorePropertyDefinitions {
     defs.addAll(WebhookProperties.all());
     defs.addAll(TelemetryProperties.all());
     defs.addAll(ScannerProperties.all());
+    defs.addAll(WebProperties.all());
 
     defs.addAll(asList(
       PropertyDefinition.builder(PROP_PASSWORD)
index 7e53e1832c745772b73037b2111aaa9e13736e08..398eee95a0e947a32e31ff72ccc8c680148caef6 100644 (file)
@@ -30,7 +30,7 @@ public final class WebConstants {
   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";
+  public static final String SONARCLOUD_ENABLED = "sonar.sonarcloud.enabled";
 
   private WebConstants() {
   }
diff --git a/sonar-core/src/main/java/org/sonar/core/config/WebProperties.java b/sonar-core/src/main/java/org/sonar/core/config/WebProperties.java
new file mode 100644 (file)
index 0000000..724dbc9
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+package org.sonar.core.config;
+
+import java.util.List;
+import org.sonar.api.PropertyType;
+import org.sonar.api.config.PropertyDefinition;
+
+import static java.util.Arrays.asList;
+
+public final class WebProperties {
+
+  private WebProperties() {
+  }
+
+  public static List<PropertyDefinition> all() {
+    return asList(
+      PropertyDefinition.builder(WebConstants.SONARCLOUD_ENABLED)
+        .deprecatedKey("sonar.lf.sonarqube.com.enabled")
+        .defaultValue("false")
+        .name("Enable SonarCloud look&feel")
+        .type(PropertyType.BOOLEAN)
+        .hidden()
+        .build());
+  }
+}
index c26a8cda61b0d39e579b4d01c29334996bfd8d34..aa7bcd07d0df906e8e6dd2eb2290fa6f138e0862 100644 (file)
@@ -33,7 +33,7 @@ public class CorePropertyDefinitionsTest {
   @Test
   public void all() {
     List<PropertyDefinition> defs = CorePropertyDefinitions.all();
-    assertThat(defs).hasSize(65);
+    assertThat(defs).hasSize(66);
   }
 
   @Test