Commit 5a427787c196c202193ffe8bba03db9f76664281
Committed by
Carlos Morais
1 parent
64f6a393
Exists in
master
and in
22 other branches
[Mezuro] Removing metric_ids and list metrics from BaseTool
Showing
5 changed files
with
22 additions
and
32 deletions
Show diff stats
plugins/mezuro/lib/kalibro/client/base_tool_client.rb
| @@ -11,7 +11,6 @@ class Kalibro::Client::BaseToolClient | @@ -11,7 +11,6 @@ class Kalibro::Client::BaseToolClient | ||
| 11 | def base_tool(name) | 11 | def base_tool(name) |
| 12 | hash = @port.request(:get_base_tool, {:base_tool_name => name})[:base_tool] | 12 | hash = @port.request(:get_base_tool, {:base_tool_name => name})[:base_tool] |
| 13 | Kalibro::Entities::BaseTool.from_hash(hash) | 13 | Kalibro::Entities::BaseTool.from_hash(hash) |
| 14 | - #FIXME dando erro | ||
| 15 | end | 14 | end |
| 16 | 15 | ||
| 17 | end | 16 | end |
plugins/mezuro/lib/kalibro/client/metrics_client.rb
plugins/mezuro/lib/mezuro_plugin/configuration_content.rb
plugins/mezuro/test/unit/mezuro_plugin/configuration_content_test.rb
| @@ -23,11 +23,6 @@ class ConfigurationContentTest < ActiveSupport::TestCase | @@ -23,11 +23,6 @@ class ConfigurationContentTest < ActiveSupport::TestCase | ||
| 23 | assert_equal 'Sets of thresholds to interpret metrics', MezuroPlugin::ConfigurationContent.description | 23 | assert_equal 'Sets of thresholds to interpret metrics', MezuroPlugin::ConfigurationContent.description |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | - should 'accept metric_ids' do | ||
| 27 | - @content.metric_ids = [1,5] | ||
| 28 | - assert_equal @content.metric_ids, [1,5] | ||
| 29 | - end | ||
| 30 | - | ||
| 31 | should 'have an html view' do | 26 | should 'have an html view' do |
| 32 | assert_not_nil @content.to_html | 27 | assert_not_nil @content.to_html |
| 33 | end | 28 | end |
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
| 1 | <h1> <%= _(MezuroPlugin::ConfigurationContent.short_description) %> </h1> | 1 | <h1> <%= _(MezuroPlugin::ConfigurationContent.short_description) %> </h1> |
| 2 | 2 | ||
| 3 | <% | 3 | <% |
| 4 | - begin | ||
| 5 | - @configuration = @article.title.nil? ? nil : Kalibro::Client::ConfigurationClient.new.configuration(@article.title) | ||
| 6 | - rescue | ||
| 7 | - @configuration = nil | ||
| 8 | - end | ||
| 9 | - %> | 4 | +begin |
| 5 | + @configuration = @article.title.nil? ? nil : Kalibro::Client::ConfigurationClient.new.configuration(@article.title) | ||
| 6 | +rescue | ||
| 7 | + @configuration = nil | ||
| 8 | +end | ||
| 9 | +%> | ||
| 10 | 10 | ||
| 11 | <%= error_messages_for 'kalibro_configuration' %> | 11 | <%= error_messages_for 'kalibro_configuration' %> |
| 12 | 12 | ||
| @@ -20,13 +20,19 @@ | @@ -20,13 +20,19 @@ | ||
| 20 | <%= f.text_field :description %><br/> | 20 | <%= f.text_field :description %><br/> |
| 21 | 21 | ||
| 22 | <h3> Metrics </h3> | 22 | <h3> Metrics </h3> |
| 23 | -<% @tool_names = Kalibro::Client::BaseToolClient.new | ||
| 24 | -@tool_names.base_tool_names.each do |collector_name| | ||
| 25 | - @collector = @tool_names.base_tool(collector_name) | ||
| 26 | - #FIXME dando erro | ||
| 27 | - @collector.supported_metrics.each do |metric| %> | ||
| 28 | - <div class="metric"> | ||
| 29 | - <%= label_tag "#{metric.name}" %> | ||
| 30 | - </div> | ||
| 31 | - <% end | ||
| 32 | -end %> | 23 | +<table> |
| 24 | + <% @tool_names = Kalibro::Client::BaseToolClient.new | ||
| 25 | + @tool_names.base_tool_names.each do |collector_name| | ||
| 26 | + @collector = @tool_names.base_tool(collector_name) | ||
| 27 | + @collector.supported_metrics.each do |metric| %> | ||
| 28 | + | ||
| 29 | + <tr class="metric" title="<%= metric.description %>"> | ||
| 30 | + <td> | ||
| 31 | + <%= check_box_tag metric.name, metric.name, true %> | ||
| 32 | + <%= label_tag metric.name %> | ||
| 33 | + </td> | ||
| 34 | + </tr> | ||
| 35 | + | ||
| 36 | + <% end %> | ||
| 37 | + </table> | ||
| 38 | +<% end %> |