]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-20440 Update new code definition documentation links
authorMathieu Suen <mathieu.suen@sonarsource.com>
Mon, 29 Apr 2024 09:20:23 +0000 (11:20 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 2 May 2024 20:02:38 +0000 (20:02 +0000)
14 files changed:
server/sonar-web/src/main/js/apps/create/project/components/NewCodeDefinitionSelection.tsx
server/sonar-web/src/main/js/apps/projectNewCode/components/AppHeader.tsx
server/sonar-web/src/main/js/apps/settings/components/NewCodeDefinition.tsx
server/sonar-web/src/main/js/components/embed-docs-modal/EmbedDocsSuggestions.json
server/sonar-web/src/main/js/components/new-code-definition/NewCodeDefinitionAnalysisWarning.tsx
server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ListActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/SetActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/ShowActionIT.java
server/sonar-webserver-webapi/src/it/java/org/sonar/server/newcodeperiod/ws/UnsetActionIT.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/ListAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/NewCodePeriodsWs.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/SetAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/ShowAction.java
server/sonar-webserver-webapi/src/main/java/org/sonar/server/newcodeperiod/ws/UnsetAction.java

index 30acdce33c60a99c0c170fc925690a1ebe969aed..12389b26b7cc3f2e4be9daaf3046a14dce9a4394 100644 (file)
@@ -215,7 +215,11 @@ export default function NewCodeDefinitionSelection(props: Props) {
           id="onboarding.create_project.new_code_definition.description"
           values={{
             link: (
-              <Link to={getDocUrl('/project-administration/defining-new-code/')}>
+              <Link
+                to={getDocUrl(
+                  '/project-administration/clean-as-you-code-settings/defining-new-code/',
+                )}
+              >
                 {translate('onboarding.create_project.new_code_definition.description.link')}
               </Link>
             ),
index 3155d4dc4968d58781042fb08a11019fce9d0906..c8be13dc9730079903b5ae18fda5fbe1b6d418fb 100644 (file)
@@ -29,7 +29,7 @@ export interface AppHeaderProps {
 
 export default function AppHeader(props: AppHeaderProps) {
   const { canAdmin } = props;
-  const toUrl = useDocUrl('/project-administration/defining-new-code/');
+  const toUrl = useDocUrl('/project-administration/clean-as-you-code-settings/defining-new-code/');
 
   return (
     <header className="sw-mt-8 sw-mb-4">
index 6ee818fdb16a1ec3389159ac97aaa21af4a7c0b0..77f8b8ef96e369f3cee83adcf6bb65e850d658af 100644 (file)
@@ -102,7 +102,7 @@ export default function NewCodeDefinition() {
                         id="settings.new_code_period.description3"
                         values={{
                           link: (
-                            <DocumentationLink to="/project-administration/defining-new-code/">
+                            <DocumentationLink to="/project-administration/clean-as-you-code-settings/defining-new-code/">
                               {translate('settings.new_code_period.description3.link')}
                             </DocumentationLink>
                           ),
index 08d459b14ae6aa0e1827dde23e3c5dccc7f57b6d..8901c50403c1a862c0fc28ef262cffad50c4105d 100644 (file)
@@ -55,7 +55,7 @@
   "project_activity": [],
   "project_baseline": [
     {
-      "link": "/project-administration/defining-new-code/",
+      "link": "/project-administration/clean-as-you-code-settings/defining-new-code/",
       "text": "Defining New Code"
     }
   ],
index 71d95cda23d5d910356f4fd1a957d40933ef585f..95fe198617cd50701fb148b04eed8ca6eac5714c 100644 (file)
@@ -23,7 +23,9 @@ import { useDocUrl } from '../../helpers/docs';
 import { translate } from '../../helpers/l10n';
 
 export default function NewCodeDefinitionAnalysisWarning() {
-  const toStatic = useDocUrl('/project-administration/defining-new-code/');
+  const toStatic = useDocUrl(
+    '/project-administration/clean-as-you-code-settings/defining-new-code/',
+  );
   return (
     <FlagMessage variant="warning" className="sw-mb-4 sw-max-w-[800px]">
       <div>
index 4c31cfccde48c5451feaaf6325ec1a2349c0bd6d..8e0dd56f64f2e760ccac6bb6d02785c313ced077 100644 (file)
@@ -74,7 +74,7 @@ public class ListActionIT {
 
   @Before
   public void setup() {
-    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/someddoc");
     ws = new WsActionTester(new ListAction(dbClient, userSession, componentFinder, dao, documentationLinkGenerator));
   }
 
@@ -83,7 +83,7 @@ public class ListActionIT {
 
     WebService.Action definition = ws.getDef();
 
-    assertThat(definition.description()).contains("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    assertThat(definition.description()).contains("https://docs.sonarsource.com/someddoc");
 
     assertThat(definition.key()).isEqualTo("list");
     assertThat(definition.isInternal()).isFalse();
index 26638d9e9664a6074dd511057b62f6449c8aa73a..e65d4c4286033065aef1e2f1988234dd02882964 100644 (file)
@@ -79,7 +79,7 @@ public class SetActionIT {
 
   @Before
   public void setup() {
-    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/someddoc");
     ws = new WsActionTester(new SetAction(dbClient, userSession, componentFinder, editionProvider, dao, documentationLinkGenerator));
   }
 
@@ -87,7 +87,7 @@ public class SetActionIT {
   public void test_definition() {
     WebService.Action definition = ws.getDef();
 
-    assertThat(definition.description()).contains("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    assertThat(definition.description()).contains("https://docs.sonarsource.com/someddoc");
 
     assertThat(definition.key()).isEqualTo("set");
     assertThat(definition.isInternal()).isFalse();
index 34372cf07d4eecfb7ed5351b2ca02c2e2cf451a8..6d82f5fa4724a14bff8679c7090af24832ab8c2a 100644 (file)
@@ -65,7 +65,7 @@ public class ShowActionIT {
 
   @Before
   public void setup() {
-    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/sonarqube/latest/project-administration/defining-new-code/");
+    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/someddoc");
     ws = new WsActionTester(new ShowAction(dbClient, userSession, componentFinder, dao, documentationLinkGenerator));
   }
 
@@ -73,7 +73,7 @@ public class ShowActionIT {
   public void test_definition() {
     WebService.Action definition = ws.getDef();
 
-    assertThat(definition.description()).contains("https://docs.sonarsource.com/sonarqube/latest/project-administration/defining-new-code/");
+    assertThat(definition.description()).contains("https://docs.sonarsource.com/someddoc");
 
     assertThat(definition.key()).isEqualTo("show");
     assertThat(definition.isInternal()).isFalse();
index 60e87abf95b6e920075b763c3923cc092f5e164c..bb7a5a7558105a76a9799faf74046c1e16d2ea8c 100644 (file)
@@ -69,7 +69,7 @@ public class UnsetActionIT {
 
   @Before
   public void setup(){
-    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    when(documentationLinkGenerator.getDocumentationLink(any())).thenReturn("https://docs.sonarsource.com/someddoc");
     ws = new WsActionTester(new UnsetAction(dbClient, userSession, componentFinder, editionProvider, dao, documentationLinkGenerator));
   }
 
@@ -77,7 +77,7 @@ public class UnsetActionIT {
   public void test_definition() {
     WebService.Action definition = ws.getDef();
 
-    assertThat(definition.description()).contains("https://docs.sonarsource.com/sonarqube/9.9/project-administration/defining-new-code/");
+    assertThat(definition.description()).contains("https://docs.sonarsource.com/someddoc");
 
     assertThat(definition.key()).isEqualTo("unset");
     assertThat(definition.isInternal()).isFalse();
index f6331320b5e00dfde520b2e7ab51e623a5d0b0f3..f67401985b15bc0996110ecbf6fb88d4fe89a550 100644 (file)
@@ -66,7 +66,7 @@ public class ListAction implements NewCodePeriodsWsAction {
     this.userSession = userSession;
     this.componentFinder = componentFinder;
     this.newCodePeriodDao = newCodePeriodDao;
-    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/defining-new-code/");
+    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/clean-as-you-code-settings/defining-new-code/");
   }
 
   @Override
index 4661ad02ca5cd2d6303fc3c2e2eb2773952f48a5..7177add07394c3b8d4b929b8c33676b0ab3e65db 100644 (file)
@@ -37,7 +37,7 @@ public class NewCodePeriodsWs implements WebService {
   @Override
   public void define(Context context) {
     NewController controller = context.createController("api/new_code_periods")
-      .setDescription("Manage "+ createHtmlExternalLink(documentationLinkGenerator.getDocumentationLink("/project-administration/defining-new-code/"), "new code definition") +".")
+      .setDescription("Manage "+ createHtmlExternalLink(documentationLinkGenerator.getDocumentationLink("/project-administration/clean-as-you-code-settings/defining-new-code/"), "new code definition") +".")
       .setSince("8.0");
     for (NewCodePeriodsWsAction action : actions) {
       action.define(controller);
index dc5a067e5baa3860d3e779814b2ad022de634e8d..8049446577b83b102d9486a33da795e81630ba9c 100644 (file)
@@ -82,7 +82,7 @@ public class SetAction implements NewCodePeriodsWsAction {
     this.componentFinder = componentFinder;
     this.editionProvider = editionProvider;
     this.newCodePeriodDao = newCodePeriodDao;
-    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/defining-new-code/");
+    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/clean-as-you-code-settings/defining-new-code/");
   }
 
   @Override
index db6d3ee447f5c5cda6b5afa3c33f0f0513b7ea02..f21c938194e193d51e7b99a353acb93df44321cd 100644 (file)
@@ -61,7 +61,7 @@ public class ShowAction implements NewCodePeriodsWsAction {
     this.userSession = userSession;
     this.componentFinder = componentFinder;
     this.newCodePeriodDao = newCodePeriodDao;
-    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/defining-new-code/");
+    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/clean-as-you-code-settings/defining-new-code/");
   }
 
   @Override
index b656e4c2e23af01956ed431a5be0a674bd52c850..73f1e82396d1c509c040bdb1db773892f778976c 100644 (file)
@@ -61,7 +61,7 @@ public class UnsetAction implements NewCodePeriodsWsAction {
     this.componentFinder = componentFinder;
     this.editionProvider = editionProvider;
     this.newCodePeriodDao = newCodePeriodDao;
-    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/defining-new-code/");
+    this.newCodeDefinitionDocumentationUrl = documentationLinkGenerator.getDocumentationLink("/project-administration/clean-as-you-code-settings/defining-new-code/");
   }
 
   @Override