]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15466 Add link for SonarLint connected mode
authorMathieu Suen <mathieu.suen@sonarsource.com>
Thu, 30 Sep 2021 15:54:40 +0000 (17:54 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 1 Oct 2021 20:03:19 +0000 (20:03 +0000)
server/sonar-docs/src/EmbedDocsSuggestions.json
server/sonar-docs/src/__tests__/BrokenLinkSafetyNet.test.js

index bdcee059a7dda815a3ee03d3195f928249f6f45d..2eb7800dd64767f8d238a5f7e26811d78d22753b 100644 (file)
       "text": "Metric Definitions"
     }
   ],
-  "extension_billing": [
-    {
-      "link": "/documentation/sonarcloud-pricing/",
-      "text": "Pricing",
-      "scope": "sonarcloud"
-    }
-  ],
-  "global_permissions": [
-    {
-      "link": "/documentation/organizations/manage-team/",
-      "text": "Manage a Team",
-      "scope": "sonarcloud"
-    }
-  ],
+  "global_permissions": [],
   "issues": [],
   "marketplace": [],
-  "organization_members": [
-    {
-      "link": "/documentation/organizations/manage-team/",
-      "text": "Manage a Team",
-      "scope": "sonarcloud"
-    }
-  ],
-  "organization_projects": [
-    {
-      "link": "/documentation/organizations/manage-team/",
-      "text": "Manage a Team",
-      "scope": "sonarcloud"
-    }
-  ],
-  "organization_space": [
-    {
-      "link": "/documentation/organizations/overview/",
-      "text": "Organizations",
-      "scope": "sonarcloud"
-    }
-  ],
   "overview": [
     {
       "link": "/documentation/analysis/pull-request/",
     {
       "link": "/documentation/user-guide/clean-as-you-code/",
       "text": "Clean as You Code"
+    },
+    {
+      "link": "/documentation/user-guide/connected-mode/",
+      "text": "SonarLint connected mode"
     }
   ],
   "permission_templates": [],
       "text": "About Quality Profiles"
     }
   ],
-  "projects_management": [
-    {
-      "link": "/documentation/analysis/overview/",
-      "text": "Analyze a Project",
-      "scope": "sonarcloud"
-    }
-  ],
-  "projects": [
-    {
-      "link": "/documentation/analysis/overview/",
-      "text": "Analyze a Project",
-      "scope": "sonarcloud"
-    }
-  ],
+  "projects_management": [],
+  "projects": [],
   "pull_requests": [
     {
       "link": "/documentation/user-guide/clean-as-you-code/",
     {
       "link": "/documentation/analysis/pull-request/",
       "text": "Analyzing Pull Requests"
+    },
+    {
+      "link": "/documentation/user-guide/connected-mode/",
+      "text": "SonarLint connected mode"
     }
   ],
   "quality_gates": [
   ],
   "settings": [],
   "system_info": [],
-  "user_groups": [
-    {
-      "link": "/documentation/organizations/manage-team/",
-      "text": "Manage a Team",
-      "scope": "sonarcloud"
-    }
-  ],
+  "user_groups": [],
   "users": [],
   "webhooks": [
     {
index d1d31eb30c940af1525cf27840cc393eac014ef4..74c4598bd5785ab3cb805ad7088ff4658fbead8d 100644 (file)
@@ -72,16 +72,19 @@ it('should have valid links in trees files', () => {
 it('should have valid links in suggestions file', () => {
   const file = 'EmbedDocsSuggestions.json';
   const suggestions = JSON.parse(fs.readFileSync(path.join(rootPath, file), 'utf8'));
-  let hasErrors = false;
-  Object.keys(suggestions).forEach(key => {
-    suggestions[key].forEach(suggestion => {
+  const hasErrors = Object.keys(suggestions).some(key => {
+    return suggestions[key].some(suggestion => {
       if (!suggestion.link.startsWith('/documentation/')) {
-        console.log(`[${suggestion.link}] should starts with "/documentation/", in ${file}`);
-        hasErrors = true;
-      } else if (!urlExists(parsedFiles, suggestion.link.replace('/documentation', ''))) {
+        console.log(
+          `[${suggestion.link}] should starts with "/documentation/" or be a valid url, in ${file}`
+        );
+        return true;
+      }
+      if (!urlExists(parsedFiles, suggestion.link.replace('/documentation', ''))) {
         console.log(`[${suggestion.link}] is not a valid link, in ${file}`);
-        hasErrors = true;
+        return true;
       }
+      return false;
     });
   });
   expect(hasErrors).toBe(false);