Commit 0c91e0f731870da7731b1fd77587646c463bf51d
Committed by
João M. M. da Silva
1 parent
d6b6aab8
Exists in
master
and in
28 other branches
[Mezuro] Fixed chart and call to metric history.
Showing
3 changed files
with
7 additions
and
6 deletions
Show diff stats
plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb
| @@ -43,7 +43,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | @@ -43,7 +43,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper | ||
| 43 | ) | 43 | ) |
| 44 | end | 44 | end |
| 45 | 45 | ||
| 46 | - | ||
| 47 | def self.format_name(metric_configuration_snapshot) | 46 | def self.format_name(metric_configuration_snapshot) |
| 48 | metric_configuration_snapshot.metric.name.delete("() ") | 47 | metric_configuration_snapshot.metric.name.delete("() ") |
| 49 | end | 48 | end |
plugins/mezuro/public/javascripts/processing.js
| @@ -17,9 +17,10 @@ function showProcessing() { | @@ -17,9 +17,10 @@ function showProcessing() { | ||
| 17 | //TODO review for project history | 17 | //TODO review for project history |
| 18 | function display_metric_history() { | 18 | function display_metric_history() { |
| 19 | var module_result_id = jQuery(this).attr('data-module-id'); | 19 | var module_result_id = jQuery(this).attr('data-module-id'); |
| 20 | - var metric_name = jQuery(this).attr('show-metric-history'); | ||
| 21 | - toggle_mezuro("." + metric_name); | ||
| 22 | - metricName = metric_name; | 20 | + var formatted_name = jQuery(this).attr('show-metric-history'); |
| 21 | + var metric_name = jQuery(this).attr('data-metric-name'); | ||
| 22 | + toggle_mezuro("." + formatted_name); | ||
| 23 | + metricName = formatted_name; | ||
| 23 | callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); | 24 | callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); |
| 24 | return false; | 25 | return false; |
| 25 | } | 26 | } |
plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml
| @@ -10,10 +10,11 @@ | @@ -10,10 +10,11 @@ | ||
| 10 | <% @metric_results.each do |metric_result| %> | 10 | <% @metric_results.each do |metric_result| %> |
| 11 | <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> | 11 | <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> |
| 12 | <% range_snapshots = metric_configuration_snapshot.range_snapshot %> | 12 | <% range_snapshots = metric_configuration_snapshot.range_snapshot %> |
| 13 | - <% formatted_name = MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_configuration_snapshot) %> | 13 | + <% metric_name = metric_configuration_snapshot.metric.name %> |
| 14 | + <% formatted_name = metric_name.delete("() ") %> | ||
| 14 | <% if !range_snapshots.nil? %> | 15 | <% if !range_snapshots.nil? %> |
| 15 | <tr> | 16 | <tr> |
| 16 | - <td style="width: 74%"><a href="#" show-metric-history="<%= formatted_name %>" data-module-id="<%= @module_result.id %>"><%= metric_configuration_snapshot.metric.name %></a></td> | 17 | + <td style="width: 74%"><a href="#" show-metric-history="<%= formatted_name %>" data-metric-name="<%= metric_name %>" data-module-id="<%= @module_result.id %>"><%= metric_name %></a></td> |
| 17 | <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> | 18 | <td><%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %></td> |
| 18 | <td><%= metric_configuration_snapshot.weight %></td> | 19 | <td><%= metric_configuration_snapshot.weight %></td> |
| 19 | <% range_snapshots.each do |range_snapshot| %> | 20 | <% range_snapshots.each do |range_snapshot| %> |