Commit 93da36940bd5f9ba467f1756f364e2f51f4de52c
1 parent
bc2113ca
Exists in
colab
and in
4 other branches
After selecting a metric, the MetriConfiguration form should search it again by code
Signed off by: Daniel Paulino Alves <danpaulalves@gmail.com>
Showing
4 changed files
with
6 additions
and
6 deletions
Show diff stats
Gemfile.lock
app/assets/javascripts/metric_collector.js.coffee
| 1 | 1 | class @MetricCollector |
| 2 | 2 | |
| 3 | 3 | # Static Method |
| 4 | - @choose_metric: (metric_name, metric_collector_name) -> | |
| 5 | - $("#metric_name").val(metric_name) | |
| 4 | + @choose_metric: (metric_code, metric_collector_name) -> | |
| 5 | + $("#metric_code").val(metric_code) | |
| 6 | 6 | $("#metric_collector_name").val(metric_collector_name) |
| 7 | 7 | $("form").submit() | ... | ... |
app/controllers/metric_configurations_controller.rb
| ... | ... | @@ -8,7 +8,7 @@ class MetricConfigurationsController < BaseMetricConfigurationsController |
| 8 | 8 | def new |
| 9 | 9 | super |
| 10 | 10 | metric_configuration.metric_collector_name = params[:metric_collector_name] |
| 11 | - metric_configuration.metric = KalibroClient::Processor::MetricCollector.find(params[:metric_collector_name]).metric params[:metric_name] | |
| 11 | + metric_configuration.metric = KalibroClient::Processor::MetricCollector.find(params[:metric_collector_name]).metric params[:metric_code] | |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | 14 | def create | ... | ... |
app/views/metric_configurations/choose_metric.html.erb
| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> |
| 6 | 6 | <%= hidden_field_tag(:metric_collector_name,) %> |
| 7 | - <%= hidden_field_tag(:metric_name) %> | |
| 7 | + <%= hidden_field_tag(:metric_code) %> | |
| 8 | 8 | <% end %> |
| 9 | 9 | |
| 10 | 10 | <div id="base-tool-accordion"> |
| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | <h3 class="jquery-ui-accordion"><%= metric_collector_name %></h3> |
| 13 | 13 | <div> |
| 14 | 14 | <% supported_metrics_of(metric_collector_name).each do |metric| %> |
| 15 | - <%= link_to metric.name, '#', onclick: "MetricCollector.choose_metric(\"#{metric.name}\", \"#{metric_collector_name}\");", remote: true %><br> | |
| 15 | + <%= link_to metric.name, '#', onclick: "MetricCollector.choose_metric(\"#{metric.code}\", \"#{metric_collector_name}\");", remote: true %><br> | |
| 16 | 16 | <% end %> |
| 17 | 17 | </div> |
| 18 | 18 | <% end %> | ... | ... |