]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5884 Apply feedback
authorStas Vilchik <vilchiks@gmail.com>
Thu, 8 Jan 2015 13:15:06 +0000 (14:15 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 8 Jan 2015 13:15:13 +0000 (14:15 +0100)
server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-all.hbs
server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-coverage.hbs
server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-test-cases.hbs
server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs
server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs
server/sonar-web/src/main/js/source-viewer/measures-overlay.js
server/sonar-web/src/main/less/components/source.less

index e38b18ac92d5acdcd3e418e588407faf6f117ceb..ee5ff5358a63f67032429c4bcaad4cebedd4fd60 100644 (file)
@@ -1,40 +1,42 @@
-<div class="source-viewer-measures-section source-viewer-measures-section-big">
-  {{#eachEven measuresToDisplay}}
-    <div class="source-viewer-measures-card">
-      <div class="measures">
-        <div class="measures-list">
-          <div class="measure measure-one-line measure-big">
-            <span class="measure-name">{{name}}</span>
+{{#notEmpty measuresToDisplay}}
+  <div class="source-viewer-measures-section source-viewer-measures-section-big">
+    {{#eachEven measuresToDisplay}}
+      <div class="source-viewer-measures-card">
+        <div class="measures">
+          <div class="measures-list">
+            <div class="measure measure-one-line measure-big">
+              <span class="measure-name">{{name}}</span>
+            </div>
+            {{#each metrics}}
+                <div class="measure measure-one-line" data-metric="{{key}}">
+                  <span class="measure-name">{{name}}</span>
+                  <span class="measure-value">&nbsp;{{value}}</span>
+                </div>
+            {{/each}}
           </div>
-          {{#each metrics}}
-              <div class="measure measure-one-line" data-metric="{{key}}">
-                <span class="measure-name">{{name}}</span>
-                <span class="measure-value">&nbsp;{{value}}</span>
-              </div>
-          {{/each}}
         </div>
       </div>
-    </div>
-  {{/eachEven}}
-</div>
+    {{/eachEven}}
+  </div>
 
-<div class="source-viewer-measures-section source-viewer-measures-section-big">
-  {{#eachOdd measuresToDisplay}}
-    <div class="source-viewer-measures-card">
-      <div class="measures">
-        <div class="measures-list">
-          <div class="measure measure-one-line measure-big">
-            <span class="measure-name">{{name}}</span>
-          </div>
-          {{#each metrics}}
-            <div class="measure measure-one-line" data-metric="{{key}}">
+  <div class="source-viewer-measures-section source-viewer-measures-section-big">
+    {{#eachOdd measuresToDisplay}}
+      <div class="source-viewer-measures-card">
+        <div class="measures">
+          <div class="measures-list">
+            <div class="measure measure-one-line measure-big">
               <span class="measure-name">{{name}}</span>
-              <span class="measure-value">&nbsp;{{value}}</span>
             </div>
-          {{/each}}
+            {{#each metrics}}
+              <div class="measure measure-one-line" data-metric="{{key}}">
+                <span class="measure-name">{{name}}</span>
+                <span class="measure-value">&nbsp;{{value}}</span>
+              </div>
+            {{/each}}
+          </div>
         </div>
       </div>
-    </div>
-  {{/eachOdd}}
-</div>
+    {{/eachOdd}}
+  </div>
+{{/notEmpty}}
 
index efdc1897abd67d5bbcec548998c5e1c0106b1078..b1fbadd7c735d2fdee629045eec42b9ae67879d3 100644 (file)
@@ -5,6 +5,7 @@
             data-value="{{default measures.overall_coverage_raw measures.coverage_raw measures.it_coverage_raw}}"
             data-max="100"
             data-color="#85bb43"
+            data-base-color="#d4333f"
             data-size="47"></span>
     </div>
     <div class="measure measure-big">
index d7cd79af548e0aa170fa9d0c30aa854344feb622..9676130c6d910928ca7b4f5bef3de015a2dcb6f3 100644 (file)
@@ -1,5 +1,5 @@
 <div class="source-viewer-measures-section source-viewer-measures-section-big">
-  <div class="source-viewer-measures-card">
+  <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height js-test-list">
     <div class="measures">
       <table class="source-viewer-tests-list">
         <tr>
@@ -44,8 +44,8 @@
 </div>
 
 {{#if selectedTest}}
-  <div class="source-viewer-measures-section source-viewer-measures-section-full js-selected-test">
-    <div class="source-viewer-measures-card source-viewer-measures-card-overflow">
+  <div class="source-viewer-measures-section source-viewer-measures-section-big js-selected-test">
+    <div class="source-viewer-measures-card source-viewer-measures-card-fixed-height">
       {{#notEq selectedTest.status 'ERROR'}}
         {{#notEq selectedTest.status 'FAILURE'}}
           <div class="bubble-popup-title">{{t 'component_viewer.transition.covers'}}</div>
index 8fedb453bf32ecd92750b952d14c2cae20e43359..14cc0e9e58f36e49c57dbaa228c2d29ba4178219 100644 (file)
     {{#notNull measures.issues}}
       <div class="source-viewer-header-measure">
         <span class="source-viewer-header-measure-value">
-          <a target="_blank" href="{{link '/issues/search#resolved=false|componentUuids=' uuid}}">{{measures.issues}}</a>
+          <a class="source-viewer-header-external-link" target="_blank"
+             href="{{link '/issues/search#resolved=false|componentUuids=' uuid}}">
+            {{measures.issues}}&nbsp;<i class="icon-detach"></i>
+          </a>
         </span>
         <span class="source-viewer-header-measure-label">{{t 'metric.violations.name'}}</span>
       </div>
index 02278679b8977429dae09e4bf70b4de2e1f5317f..efc58a184d33eb93e39b6e4d73a490562bcb4e5c 100644 (file)
@@ -19,8 +19,8 @@
     {{/unless}}
   </div>
 
-  <div class="source-viewer-measures">
-    {{#unless isUnitTest}}
+  {{#unless isUnitTest}}
+    <div class="source-viewer-measures">
       <div class="source-viewer-measures-section">
         <div class="source-viewer-measures-card">
           {{> '_source-viewer-measures-lines'}}
       <div class="source-viewer-measures-section">
         {{> '_source-viewer-measures-duplications'}}
       </div>
-    {{else}}
+    </div>
+  {{else}}
+    <div class="source-viewer-measures">
       <div class="source-viewer-measures-section">
         {{> '_source-viewer-measures-tests'}}
       </div>
+    </div>
+    <div class="source-viewer-measures">
       {{> '_source-viewer-measures-test-cases'}}
-    {{/unless}}
-  </div>
+    </div>
+  {{/unless}}
+
 
   <a class="js-show-all-measures">{{t 'component_viewer.show_all_measures'}}</a>
 
index a3ef116f142dcb90c013c9aa4e9be3ccb155e0f1..942d66e2050af1385a638759dcb775927afe2b76 100644 (file)
@@ -17,6 +17,7 @@ define([
       if (this.model.get('isUnitTest')) {
         requests.push(this.requestTests());
       }
+      this.testsScroll = 0;
       $.when.apply($, requests).done(function () {
         that.render();
         window.process.finishBackgroundProcess(p);
@@ -38,14 +39,7 @@ define([
     onRender: function () {
       ModalView.prototype.onRender.apply(this, arguments);
       this.$('.js-pie-chart').pieChart();
-      if (this.selectedTest != null) {
-        this.scrollToTest();
-      }
-    },
-
-    scrollToTest: function () {
-      var position = this.$('.js-selected-test').offset().top - this.$el.offset().top - 50;
-      this.$el.scrollTop(position);
+      this.$('.js-test-list').scrollTop(this.testsScroll);
     },
 
     getMetrics: function () {
@@ -216,6 +210,7 @@ define([
             key: this.model.key(),
             test: name
           };
+      this.testsScroll = $(e.currentTarget).scrollParent().scrollTop();
       return $.get(url, options).done(function (data) {
         that.coveredFiles = data.files;
         that.selectedTest = _.findWhere(that.model.get('tests'), { name: name });
index a3bd8c11bd87f6576d85eff73df68cd872669968..7ff32efa2d5c2dbf1dc20edb8717aab3ee98c6d1 100644 (file)
@@ -57,7 +57,7 @@
   opacity: 0.4;
 
   .source-meta {
-    border-color: transparent !important;
+    border-color: #f9f9f9 !important;
   }
 }
 
@@ -99,6 +99,7 @@
 .source-meta {
   vertical-align: top;
   width: 1px;
+  background-clip: padding-box;
   .user-select(none);
 }
 
   font-weight: 300;
 }
 
-.source-viewer-header-measure-issues {
-  width: 45px;
-}
-
-.source-viewer-header-measure-issue {
-  min-width: 1px;
-  height: 6px;
-
-  &.s-blocker { background-color: @severityBlockerColor; }
-  &.s-critical { background-color: @severityCriticalColor; }
-  &.s-major { background-color: @severityMajorColor; }
-  &.s-minor { background-color: @severityMinorColor; }
-  &.s-info { background-color: @severityInfoColor; }
-}
+.source-viewer-header-external-link {
+  .link-no-underline;
 
-.source-viewer-header-measure-issue + .source-viewer-header-measure-issue {
-  margin-top: 1px;
+  i {
+    position: relative;
+    top: -4px;
+  }
 }
 
 .source-viewer-header-actions {
   overflow: auto;
 }
 
+.source-viewer-measures-card-fixed-height {
+  max-height: 50vh;
+  overflow-y: scroll;
+}
+
+
 //.source-viewer-measures-section + .source-viewer-measures-section {
 //  border-left: 1px solid @barBorderColor;
 //}