From 0c91e0f731870da7731b1fd77587646c463bf51d Mon Sep 17 00:00:00 2001 From: João M. M. da Silva + Diego Araújo Date: Wed, 9 Jan 2013 16:13:19 -0200 Subject: [PATCH] [Mezuro] Fixed chart and call to metric history. --- plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb | 1 - plugins/mezuro/public/javascripts/processing.js | 7 ++++--- plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb index feab0f9..258dc72 100644 --- a/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb +++ b/plugins/mezuro/lib/mezuro_plugin/helpers/content_viewer_helper.rb @@ -43,7 +43,6 @@ class MezuroPlugin::Helpers::ContentViewerHelper ) end - def self.format_name(metric_configuration_snapshot) metric_configuration_snapshot.metric.name.delete("() ") end diff --git a/plugins/mezuro/public/javascripts/processing.js b/plugins/mezuro/public/javascripts/processing.js index 42d19f1..766b070 100644 --- a/plugins/mezuro/public/javascripts/processing.js +++ b/plugins/mezuro/public/javascripts/processing.js @@ -17,9 +17,10 @@ function showProcessing() { //TODO review for project history function display_metric_history() { var module_result_id = jQuery(this).attr('data-module-id'); - var metric_name = jQuery(this).attr('show-metric-history'); - toggle_mezuro("." + metric_name); - metricName = metric_name; + var formatted_name = jQuery(this).attr('show-metric-history'); + var metric_name = jQuery(this).attr('data-metric-name'); + toggle_mezuro("." + formatted_name); + metricName = formatted_name; callAction('module_result', 'metric_result_history', {metric_name: metric_name, module_result_id: module_result_id}, show_metrics); return false; } diff --git a/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml b/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml index 18ab68d..14d6b69 100644 --- a/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml +++ b/plugins/mezuro/views/mezuro_plugin_module_result/_metric_results.rhtml @@ -10,10 +10,11 @@ <% @metric_results.each do |metric_result| %> <% metric_configuration_snapshot = metric_result.metric_configuration_snapshot%> <% range_snapshots = metric_configuration_snapshot.range_snapshot %> - <% formatted_name = MezuroPlugin::Helpers::ContentViewerHelper.format_name(metric_configuration_snapshot) %> + <% metric_name = metric_configuration_snapshot.metric.name %> + <% formatted_name = metric_name.delete("() ") %> <% if !range_snapshots.nil? %> - <%= metric_configuration_snapshot.metric.name %> + <%= metric_name %> <%= MezuroPlugin::Helpers::ContentViewerHelper.format_grade(metric_result.value) %> <%= metric_configuration_snapshot.weight %> <% range_snapshots.each do |range_snapshot| %> -- libgit2 0.21.2