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
| 1 | GIT | 1 | GIT |
| 2 | remote: https://github.com/mezuro/kalibro_client | 2 | remote: https://github.com/mezuro/kalibro_client |
| 3 | - revision: f602fbb76c2dd5e1b8ad9c28934647c33f85c991 | 3 | + revision: cd8c53baa30bf507e9ef7a59407ef3cfe9226cb4 |
| 4 | specs: | 4 | specs: |
| 5 | kalibro_client (0.0.1) | 5 | kalibro_client (0.0.1) |
| 6 | activeresource (~> 4.0.0) | 6 | activeresource (~> 4.0.0) |
app/assets/javascripts/metric_collector.js.coffee
| 1 | class @MetricCollector | 1 | class @MetricCollector |
| 2 | 2 | ||
| 3 | # Static Method | 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 | $("#metric_collector_name").val(metric_collector_name) | 6 | $("#metric_collector_name").val(metric_collector_name) |
| 7 | $("form").submit() | 7 | $("form").submit() |
app/controllers/metric_configurations_controller.rb
| @@ -8,7 +8,7 @@ class MetricConfigurationsController < BaseMetricConfigurationsController | @@ -8,7 +8,7 @@ class MetricConfigurationsController < BaseMetricConfigurationsController | ||
| 8 | def new | 8 | def new |
| 9 | super | 9 | super |
| 10 | metric_configuration.metric_collector_name = params[:metric_collector_name] | 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 | end | 12 | end |
| 13 | 13 | ||
| 14 | def create | 14 | def create |
app/views/metric_configurations/choose_metric.html.erb
| @@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
| 4 | 4 | ||
| 5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> | 5 | <%= form_tag kalibro_configuration_new_metric_configuration_path(@kalibro_configuration.id) do %> |
| 6 | <%= hidden_field_tag(:metric_collector_name,) %> | 6 | <%= hidden_field_tag(:metric_collector_name,) %> |
| 7 | - <%= hidden_field_tag(:metric_name) %> | 7 | + <%= hidden_field_tag(:metric_code) %> |
| 8 | <% end %> | 8 | <% end %> |
| 9 | 9 | ||
| 10 | <div id="base-tool-accordion"> | 10 | <div id="base-tool-accordion"> |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | <h3 class="jquery-ui-accordion"><%= metric_collector_name %></h3> | 12 | <h3 class="jquery-ui-accordion"><%= metric_collector_name %></h3> |
| 13 | <div> | 13 | <div> |
| 14 | <% supported_metrics_of(metric_collector_name).each do |metric| %> | 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 | <% end %> | 16 | <% end %> |
| 17 | </div> | 17 | </div> |
| 18 | <% end %> | 18 | <% end %> |