Просмотр исходного кода

SONAR-12169 Provisioned applications should not act like a project

tags/8.2.0.32929
Wouter Admiraal 4 лет назад
Родитель
Сommit
16ef824afc

+ 9
- 3
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) {

+ 7
- 1
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`] = `

+ 1
- 0
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.


#------------------------------------------------------------------------------

Загрузка…
Отмена
Сохранить