]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5884 Fix line fading in measures drilldown page
authorStas Vilchik <vilchiks@gmail.com>
Thu, 8 Jan 2015 16:16:16 +0000 (17:16 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 8 Jan 2015 16:16:16 +0000 (17:16 +0100)
server/sonar-web/src/main/js/drilldown/app.js
server/sonar-web/src/main/js/source-viewer/viewer.js
server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb

index dc86cfc67495782950d4a667d7387a4157191854..5ed7c996cc417d3deda44e0ac63feddb52d8cd90 100644 (file)
@@ -38,9 +38,9 @@ requirejs([
           viewer = new SourceViewer();
       App.viewerRegion.show(viewer);
       viewer.open(uuid);
-      if (typeof window.drilldown.period === 'number') {
+      if (window.drilldown.period != null) {
         viewer.on('loaded', function () {
-          viewer.filterLinesByPeriod(window.drilldown.period);
+          viewer.filterLinesByDate(window.drilldown.period);
         });
       }
     });
index 0056db64dfdd5ab707b2daf5505a2b943ae0f0e3..3800f3407ec218b1648000a8167883d34bc11126 100644 (file)
@@ -614,18 +614,13 @@ define([
           });
         },
 
-        filterLinesByPeriod: function (periodId) {
-          var periods = this.model.get('periods'),
-              period = _.find(periods, function (candidate) {
-                return candidate[0] === periodId;
-              });
-          if (period) {
-            var sinceDate = moment(period[2]).toDate();
-            this.filterLines(function (line) {
-              var scmDate = moment(line.scmDate).toDate();
-              return scmDate >= sinceDate;
-            });
-          }
+        filterLinesByDate: function (date) {
+          var sinceDate = moment(date).toDate();
+          this.filterLines(function (line) {
+            var scmDate = moment(line.scmDate).toDate();
+            console.log(scmDate, sinceDate);
+            return scmDate >= sinceDate;
+          });
         }
       });
 
index 58f6d8cdd351244661c03e3ad3036c70db0c1612..117ae080c94bd0f612ba953b4575311cb53ce419 100644 (file)
     metric: <% if @metric %>'<%= @metric.key -%>'<% else %>null<% end %>,
     rule: null,
     severity: null,
-    period: <% if @period %><%= @period -%><% else %>null<% end %>
+    period: <% if @period %>'<%= @snapshot.period_datetime(@period) -%>'<% else %>null<% end %>
   };
 </script>