From: Pascal Mugnier Date: Tue, 20 Mar 2018 10:24:32 +0000 (+0100) Subject: SONAR-10486 Offer built-in projects badges in SonarQube X-Git-Tag: 7.5~1441 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1b0d202bc0741274469e50f8bf77b17d951952a3;p=sonarqube.git SONAR-10486 Offer built-in projects badges in SonarQube --- diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/measure-example.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/measure-example.svg index c40fc8c06e8..87b8b43ee72 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/measure-example.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/measure-example.svg @@ -7,9 +7,9 @@ - - - + + + quality gate @@ -17,6 +17,8 @@ passed passed - - + + + + \ No newline at end of file diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/quality_gate-example.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/quality_gate-example.svg index 12bc8205ff8..957e85063dd 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/quality_gate-example.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/quality_gate-example.svg @@ -1,13 +1,12 @@ - + - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/badge.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/badge.svg index a25766b1e9e..5a295899265 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/badge.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/badge.svg @@ -17,6 +17,8 @@ ${value} ${value} - - + + + + \ No newline at end of file diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_failed.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_failed.svg index a83f9c79d62..38a288fda43 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_failed.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_failed.svg @@ -1,13 +1,12 @@ - + - - - - - - - - + + + + + + + \ No newline at end of file diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_passed.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_passed.svg index 12bc8205ff8..eae908e800c 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_passed.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_passed.svg @@ -1,13 +1,12 @@ - - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_warn.svg b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_warn.svg index 48e4d353950..420cda6dc34 100644 --- a/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_warn.svg +++ b/server/sonar-server/src/main/resources/org/sonar/server/badge/ws/templates/quality_gate_warn.svg @@ -1,13 +1,12 @@ - - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx b/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx index ebea71b75a6..e666f5cb5c3 100644 --- a/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx +++ b/server/sonar-web/src/main/js/apps/overview/badges/BadgesModal.tsx @@ -32,6 +32,7 @@ import { Button, ResetButtonLink } from '../../../components/ui/buttons'; interface Props { branchLike?: BranchLike; metrics: { [key: string]: Metric }; + onSonarCloud: boolean; project: string; } @@ -69,6 +70,9 @@ export default class BadgesModal extends React.PureComponent { const { selectedType, badgeOptions } = this.state; const header = translate('overview.badges.title'); const fullBadgeOptions = { project, ...badgeOptions, ...getBranchLikeQuery(branchLike) }; + const badges = this.props.onSonarCloud + ? [BadgeType.measure, BadgeType.qualityGate, BadgeType.marketing] + : [BadgeType.measure, BadgeType.qualityGate]; return (
+
+`; + +exports[`should display the modal after click on sonar qube 2`] = ` + +
+

+ overview.badges.title +

+
+
+

+ overview.badges.description +

+
+ + +
+

+ overview.badges.measure.description +

+ + +
+
+ + close + +
+
+`; diff --git a/server/sonar-web/src/main/js/apps/overview/meta/Meta.tsx b/server/sonar-web/src/main/js/apps/overview/meta/Meta.tsx index edca9b4c4cb..ef5991a2a12 100644 --- a/server/sonar-web/src/main/js/apps/overview/meta/Meta.tsx +++ b/server/sonar-web/src/main/js/apps/overview/meta/Meta.tsx @@ -104,10 +104,14 @@ export default class Meta extends React.PureComponent { {organizationsEnabled && } - {onSonarCloud && - isProject && + {isProject && !isPrivate && ( - + )} );