Commit 5a427787c196c202193ffe8bba03db9f76664281
Committed by
Carlos Morais
1 parent
64f6a393
Exists in
master
and in
29 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
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 | 23 | assert_equal 'Sets of thresholds to interpret metrics', MezuroPlugin::ConfigurationContent.description |
24 | 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 | 26 | should 'have an html view' do |
32 | 27 | assert_not_nil @content.to_html |
33 | 28 | end | ... | ... |
plugins/mezuro/views/cms/mezuro_plugin/_configuration_content.html.erb
1 | 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 | 11 | <%= error_messages_for 'kalibro_configuration' %> |
12 | 12 | |
... | ... | @@ -20,13 +20,19 @@ |
20 | 20 | <%= f.text_field :description %><br/> |
21 | 21 | |
22 | 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 %> | ... | ... |