diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-12-19 14:17:24 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2020-02-10 20:46:15 +0100 |
commit | 16ef824afc30f2d8e9578abe8ba7422a69de28e2 (patch) | |
tree | 5b9ae4ff0ed90c8cbab11af6778e24ce9e2bf2c9 | |
parent | 822405efd0ddde6b1e123c40cc1255e9b57c05f8 (diff) | |
download | sonarqube-16ef824afc30f2d8e9578abe8ba7422a69de28e2.tar.gz sonarqube-16ef824afc30f2d8e9578abe8ba7422a69de28e2.zip |
SONAR-12169 Provisioned applications should not act like a project
3 files changed, 17 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx index 970ee8560a6..633b7587789 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/EmptyOverview.tsx @@ -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) { diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/__snapshots__/EmptyOverview-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/components/__tests__/__snapshots__/EmptyOverview-test.tsx.snap index 204c5941596..b26d0feb600 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/__snapshots__/EmptyOverview-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/__snapshots__/EmptyOverview-test.tsx.snap @@ -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`] = ` diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 67bb752c54f..539e962987e 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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. #------------------------------------------------------------------------------ |