aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/overview/gate.js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-10-19 16:40:37 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-10-20 11:03:41 +0200
commit187f501d31cba9ff220c44bbcd222768a4eee40e (patch)
tree51e71412637be96d9458c761f3d09dc236570d22 /server/sonar-web/src/main/js/apps/overview/gate.js
parent26817f2f1b31d777b681cc08f3a06db201521007 (diff)
downloadsonarqube-187f501d31cba9ff220c44bbcd222768a4eee40e.tar.gz
sonarqube-187f501d31cba9ff220c44bbcd222768a4eee40e.zip
SONAR-6331 add project overview page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/overview/gate.js')
-rw-r--r--server/sonar-web/src/main/js/apps/overview/gate.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/overview/gate.js b/server/sonar-web/src/main/js/apps/overview/gate.js
new file mode 100644
index 00000000000..2436d2d468e
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/overview/gate.js
@@ -0,0 +1,25 @@
+import React from 'react';
+import GateConditions from './gate-conditions';
+import GateEmpty from './gate-empty';
+
+export default React.createClass({
+ render() {
+ if (!this.props.gate || !this.props.gate.level) {
+ return this.props.component.qualifier === 'TRK' ? <GateEmpty/> : null;
+ }
+
+ let
+ badgeClassName = 'badge badge-' + this.props.gate.level.toLowerCase(),
+ badgeText = window.t('overview.gate', this.props.gate.level);
+
+ return (
+ <div className="overview-gate">
+ <h2 className="overview-title">
+ {window.t('overview.quality_gate')}
+ <span className={badgeClassName}>{badgeText}</span>
+ </h2>
+ <GateConditions gate={this.props.gate} component={this.props.component}/>
+ </div>
+ );
+ }
+});