From 16ef824afc30f2d8e9578abe8ba7422a69de28e2 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Thu, 19 Dec 2019 14:17:24 +0100 Subject: [PATCH] SONAR-12169 Provisioned applications should not act like a project --- .../js/apps/overview/components/EmptyOverview.tsx | 12 +++++++++--- .../__snapshots__/EmptyOverview-test.tsx.snap | 8 +++++++- .../main/resources/org/sonar/l10n/core.properties | 1 + 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 ( +
+ {translate('provisioning.no_analysis.application')} +
+ ); + } 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`] = `
+> + + provisioning.no_analysis.application + +
`; 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. #------------------------------------------------------------------------------ -- 2.39.5