]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7167 Display function key on project overview page
authorStas Vilchik <vilchiks@gmail.com>
Wed, 13 Jan 2016 10:04:01 +0000 (11:04 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Wed, 13 Jan 2016 10:04:01 +0000 (11:04 +0100)
server/sonar-web/src/main/js/apps/overview/meta.js
server/sonar-web/src/main/less/pages/overview.less

index 3506f29c1add471ffe6e1fa0ce2f300916708cdd..bb2f6fa5510532bc8075a860a49047f09343c884 100644 (file)
@@ -84,26 +84,35 @@ export default React.createClass({
     });
 
     let descriptionCard = this.props.component.description ? (
-        <div className="overview-meta-card">
-          <div className="overview-meta-description">{this.props.component.description}</div>
+        <div className="overview-meta-description big-spacer-bottom">
+          {this.props.component.description}
         </div>
     ) : null;
 
     let linksCard = _.size(this.props.component.links) > 0 ? (
-        <div className="overview-meta-card">
-          <ul className="overview-meta-list">{links}</ul>
-        </div>
+        <ul className="overview-meta-list big-spacer-bottom">
+          {links}
+        </ul>
     ) : null;
 
+    let keyCard = (
+        <div>
+          <h4 className="overview-meta-header">{translate('key')}</h4>
+          <div style={{ overflow: 'auto', whiteSpace: 'nowrap' }}>
+            <code>{this.props.component.key}</code>
+          </div>
+        </div>
+    );
+
     let profilesCard = !this.isView() && !this.isDeveloper() && _.size(this.props.component.profiles) > 0 ? (
-        <div className="overview-meta-card">
+        <div>
           <h4 className="overview-meta-header">{translate('overview.quality_profiles')}</h4>
           <ul className="overview-meta-list">{profiles}</ul>
         </div>
     ) : null;
 
     let gateCard = !this.isView() && !this.isDeveloper() && this.props.component.gate ? (
-        <div className="overview-meta-card">
+        <div className="big-spacer-bottom">
           <h4 className="overview-meta-header">{translate('overview.quality_gate')}</h4>
           <ul className="overview-meta-list">
             <li>
@@ -119,10 +128,17 @@ export default React.createClass({
 
     return (
         <div className="overview-meta">
-          {descriptionCard}
-          {linksCard}
-          {gateCard}
-          {profilesCard}
+          <div className="overview-meta-card">
+            {descriptionCard}
+            {linksCard}
+            {keyCard}
+          </div>
+          {(!!gateCard || !!profilesCard) && (
+              <div className="overview-meta-card">
+                {gateCard}
+                {profilesCard}
+              </div>
+          )}
           {this.renderEvents()}
         </div>
     );
index cf27bd92e628385d25cf214d6027a019ec33d3b4..c0851c59e3c9589c77345d662a72706a638be2af 100644 (file)
   }
 
   .overview-meta .overview-meta-card {
-    max-width: 25%;
+    width: calc(100% / 3);
   }
 }