From 71451ce97546ac1356e466f425d2495e0ed011b7 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 8 Jan 2015 14:15:06 +0100 Subject: [PATCH] SONAR-5884 Apply feedback --- .../measures/_source-viewer-measures-all.hbs | 64 ++++++++++--------- .../_source-viewer-measures-coverage.hbs | 1 + .../_source-viewer-measures-test-cases.hbs | 6 +- .../source-viewer/source-viewer-header.hbs | 5 +- .../source-viewer/source-viewer-measures.hbs | 15 +++-- .../main/js/source-viewer/measures-overlay.js | 11 +--- .../src/main/less/components/source.less | 31 ++++----- 7 files changed, 68 insertions(+), 65 deletions(-) diff --git a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-all.hbs b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-all.hbs index e38b18ac92d..ee5ff5358a6 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-all.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-all.hbs @@ -1,40 +1,42 @@ -
- {{#eachEven measuresToDisplay}} -
-
-
-
- {{name}} +{{#notEmpty measuresToDisplay}} +
+ {{#eachEven measuresToDisplay}} +
+
+
+
+ {{name}} +
+ {{#each metrics}} +
+ {{name}} +  {{value}} +
+ {{/each}}
- {{#each metrics}} -
- {{name}} -  {{value}} -
- {{/each}}
-
- {{/eachEven}} -
+ {{/eachEven}} +
-
- {{#eachOdd measuresToDisplay}} -
-
-
-
- {{name}} -
- {{#each metrics}} -
+
+ {{#eachOdd measuresToDisplay}} +
+
+
+
{{name}} -  {{value}}
- {{/each}} + {{#each metrics}} +
+ {{name}} +  {{value}} +
+ {{/each}} +
-
- {{/eachOdd}} -
+ {{/eachOdd}} +
+{{/notEmpty}} diff --git a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-coverage.hbs b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-coverage.hbs index efdc1897abd..b1fbadd7c73 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-coverage.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-coverage.hbs @@ -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">
diff --git a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-test-cases.hbs b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-test-cases.hbs index d7cd79af548..9676130c6d9 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-test-cases.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/measures/_source-viewer-measures-test-cases.hbs @@ -1,5 +1,5 @@
-
+
@@ -44,8 +44,8 @@ {{#if selectedTest}} -
-
+
+
{{#notEq selectedTest.status 'ERROR'}} {{#notEq selectedTest.status 'FAILURE'}}
{{t 'component_viewer.transition.covers'}}
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs index 8fedb453bf3..14cc0e9e58f 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-header.hbs @@ -62,7 +62,10 @@ {{#notNull measures.issues}}
- {{measures.issues}} + + {{measures.issues}}  + {{t 'metric.violations.name'}}
diff --git a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs index 02278679b89..efc58a184d3 100644 --- a/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs +++ b/server/sonar-web/src/main/hbs/source-viewer/source-viewer-measures.hbs @@ -19,8 +19,8 @@ {{/unless}}
-
- {{#unless isUnitTest}} + {{#unless isUnitTest}} +
{{> '_source-viewer-measures-lines'}} @@ -42,13 +42,18 @@
{{> '_source-viewer-measures-duplications'}}
- {{else}} +
+ {{else}} +
{{> '_source-viewer-measures-tests'}}
+
+
{{> '_source-viewer-measures-test-cases'}} - {{/unless}} -
+
+ {{/unless}} + {{t 'component_viewer.show_all_measures'}} diff --git a/server/sonar-web/src/main/js/source-viewer/measures-overlay.js b/server/sonar-web/src/main/js/source-viewer/measures-overlay.js index a3ef116f142..942d66e2050 100644 --- a/server/sonar-web/src/main/js/source-viewer/measures-overlay.js +++ b/server/sonar-web/src/main/js/source-viewer/measures-overlay.js @@ -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 }); diff --git a/server/sonar-web/src/main/less/components/source.less b/server/sonar-web/src/main/less/components/source.less index a3bd8c11bd8..7ff32efa2d5 100644 --- a/server/sonar-web/src/main/less/components/source.less +++ b/server/sonar-web/src/main/less/components/source.less @@ -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); } @@ -275,23 +276,13 @@ 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 { @@ -385,6 +376,12 @@ 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; //} -- 2.39.5