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 /server/sonar-web/src | |
parent | 822405efd0ddde6b1e123c40cc1255e9b57c05f8 (diff) | |
download | sonarqube-16ef824afc30f2d8e9578abe8ba7422a69de28e2.tar.gz sonarqube-16ef824afc30f2d8e9578abe8ba7422a69de28e2.zip |
SONAR-12169 Provisioned applications should not act like a project
Diffstat (limited to 'server/sonar-web/src')
2 files changed, 16 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`] = ` |