Commit c204718cc70cc9b3b3614111adc3ac01f89c3ad6
Committed by
Rafael Manzo
1 parent
76a10b5a
Exists in
master
and in
29 other branches
[Mezuro] created a fake to display compound metric in show configuration view
Showing
2 changed files
with
22 additions
and
2 deletions
Show diff stats
plugins/mezuro/views/content_viewer/show_configuration.rhtml
| 1 | <% @configuration_content = @page | 1 | <% @configuration_content = @page |
| 2 | @configuration = Kalibro::Client::ConfigurationClient.new.configuration(@configuration_content.name) %> | 2 | @configuration = Kalibro::Client::ConfigurationClient.new.configuration(@configuration_content.name) %> |
| 3 | +<% | ||
| 4 | + # FAKE de CompoundMetric | ||
| 5 | + fake_compound_metric = Kalibro::Entities::CompoundMetric.new | ||
| 6 | + fake_compound_metric.script = "return LOC*1;" | ||
| 7 | + fake_compound_metric.name = "new LOC" | ||
| 8 | + fake_compound_metric.scope = "CLASS" | ||
| 9 | + fake_compound_metric.description = "Description" | ||
| 10 | + fake_compound_metric_configuration = Kalibro::Entities::MetricConfiguration.new | ||
| 11 | + fake_compound_metric_configuration.metric = fake_compound_metric | ||
| 12 | + fake_compound_metric_configuration.code = "code" | ||
| 13 | + @configuration.metric_configurations << fake_compound_metric_configuration | ||
| 14 | +%> | ||
| 3 | 15 | ||
| 4 | <table id="project_info"> | 16 | <table id="project_info"> |
| 5 | <tr> | 17 | <tr> |
| @@ -14,7 +26,7 @@ | @@ -14,7 +26,7 @@ | ||
| 14 | 26 | ||
| 15 | <br/> | 27 | <br/> |
| 16 | 28 | ||
| 17 | -<%= link_to "#{image_tag ('/plugins/mezuro/images/plus.png')}Add Metric", :controller => "mezuro_plugin_myprofile", | 29 | +<%= link_to "#{image_tag ('/plugins/mezuro/images/plus.png')}Add Metric", :controller => "mezuro_plugin_myprofile", |
| 18 | :action => "choose_base_tool", :params => {:configuration_name => @configuration.name} %><br/> | 30 | :action => "choose_base_tool", :params => {:configuration_name => @configuration.name} %><br/> |
| 19 | 31 | ||
| 20 | <table> | 32 | <table> |
| @@ -26,7 +38,14 @@ | @@ -26,7 +38,14 @@ | ||
| 26 | <% @configuration.metric_configurations.each do |metric_configuration| %> | 38 | <% @configuration.metric_configurations.each do |metric_configuration| %> |
| 27 | <tr class="metric"> | 39 | <tr class="metric"> |
| 28 | <td><%= metric_configuration.metric.name %></td> | 40 | <td><%= metric_configuration.metric.name %></td> |
| 29 | - <td><%= metric_configuration.metric.origin %></td> | 41 | + |
| 42 | + <td> | ||
| 43 | + <% if metric_configuration.metric.instance_of? Kalibro::Entities::NativeMetric %> | ||
| 44 | + <%= metric_configuration.metric.origin %> | ||
| 45 | + <% else %> Compound Metric | ||
| 46 | + <% end %> | ||
| 47 | + </td> | ||
| 48 | + | ||
| 30 | <td><%= metric_configuration.code %></td> | 49 | <td><%= metric_configuration.code %></td> |
| 31 | <td><%= link_to "Edit", :controller => "mezuro_plugin_myprofile", :action => "edit_metric_configuration", :params => | 50 | <td><%= link_to "Edit", :controller => "mezuro_plugin_myprofile", :action => "edit_metric_configuration", :params => |
| 32 | {:configuration_name => @configuration.name, :metric_name => metric_configuration.metric.name} %></td> | 51 | {:configuration_name => @configuration.name, :metric_name => metric_configuration.metric.name} %></td> |
plugins/mezuro/views/mezuro_plugin_myprofile/new_compound_metric.html.erb