]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-12169 Provisioned applications should not act like a project
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Thu, 19 Dec 2019 13:17:24 +0000 (14:17 +0100)
committerSonarTech <sonartech@sonarsource.com>
Mon, 10 Feb 2020 19:46:15 +0000 (20:46 +0100)
server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx
server/sonar-web/src/main/js/apps/overview/components/__tests__/__snapshots__/EmptyOverview-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 970ee8560a6761c8ededc3116f15d34b61be5f67..633b7587789ecb373d16c8c8db56cf314417b066 100644 (file)
@@ -26,6 +26,7 @@ import { getBranchLikeDisplayName, isBranch, isMainBranch } from '../../../helpe
 import { isLoggedIn } from '../../../helpers/users';
 import { getCurrentUser, Store } from '../../../store/rootReducer';
 import { BranchLike } from '../../../types/branch-like';
+import { ComponentQualifier } from '../../../types/component';
 import AnalyzeTutorial from '../../tutorials/analyzeProject/AnalyzeTutorial';
 
 interface Props {
@@ -39,7 +40,13 @@ interface Props {
 export function EmptyOverview(props: Props) {
   const { branchLike, branchLikes, component, currentUser, hasAnalyses } = props;
 
-  if (!isBranch(branchLike)) {
+  if (component.qualifier === ComponentQualifier.Application) {
+    return (
+      <div className="page page-limited">
+        <Alert variant="warning">{translate('provisioning.no_analysis.application')}</Alert>
+      </div>
+    );
+  } else if (!isBranch(branchLike)) {
     return null;
   }
 
@@ -49,8 +56,7 @@ export function EmptyOverview(props: Props) {
     (branchLikes.length === 2 && branchLikes.some(branch => isBranch(branch)));
 
   const showWarning = isMainBranch(branchLike) && hasBranches;
-  const showTutorial =
-    isMainBranch(branchLike) && !hasBranches && !hasAnalyses && component.qualifier !== 'APP';
+  const showTutorial = isMainBranch(branchLike) && !hasBranches && !hasAnalyses;
 
   let warning;
   if (isLoggedIn(currentUser) && showWarning && hasBadBranchConfig) {
index 204c5941596357c327e83ed3dc921eb4c4304d4b..b26d0feb600ea65f21dd557c9de77178d62811d1 100644 (file)
@@ -71,7 +71,13 @@ exports[`renders correctly 3`] = `
 exports[`should not render the tutorial for applications 1`] = `
 <div
   className="page page-limited"
-/>
+>
+  <Alert
+    variant="warning"
+  >
+    provisioning.no_analysis.application
+  </Alert>
+</div>
 `;
 
 exports[`should render another message when there are branches 1`] = `
index 67bb752c54ffc59c2a6bea8bfd964a9ceb63257f..539e962987e9400326bb7170512b09ba1d55ac93 100644 (file)
@@ -1768,6 +1768,7 @@ provisioning.no_analysis_on_main_branch="{branchName}" branch has not been analy
 provisioning.no_analysis_on_main_branch.bad_configuration="{branchName}" branch has not been analyzed yet and you have multiple branches already. It looks like it is not your {branchType}, check your configuration.
 provisioning.only_provisioned=Only Provisioned
 provisioning.only_provisioned.tooltip=Provisioned projects are projects that have been created, but have not been analyzed yet.
+provisioning.no_analysis.application=No analysis has been performed since creation. Analyze a project to see information here.
 
 
 #------------------------------------------------------------------------------