Commit f83c66b0b506e3ab68e10aa32677d4f2163e9f85
Committed by
Alessandro Palmeira
1 parent
23d37175
Exists in
staging
and in
42 other branches
[Mezuro] Added link to remove metric_configuration in show_configuration view
Showing
2 changed files
with
9 additions
and
0 deletions
Show diff stats
plugins/mezuro/controllers/mezuro_plugin_profile_controller.rb
| ... | ... | @@ -89,6 +89,13 @@ class MezuroPluginProfileController < ProfileController |
| 89 | 89 | @range.comments = params[:range][:comments] |
| 90 | 90 | end |
| 91 | 91 | |
| 92 | + def remove_metric_configuration | |
| 93 | + configuration_name = params[:configuration_name] | |
| 94 | + metric_name = params[:metric_name] | |
| 95 | + Kalibro::Client::MetricConfigurationClient.new.remove(configuration_name, metric_name) | |
| 96 | + redirect_to "/#{profile.identifier}/#{configuration_name.downcase.gsub(/\s/, '-')}" | |
| 97 | + end | |
| 98 | + | |
| 92 | 99 | private |
| 93 | 100 | |
| 94 | 101 | def set_metric_configuration(params) #FIXME isso foi feito para evitar duplicar o codigo de create e update metric configuration, faça de um jeito melhor | ... | ... |
plugins/mezuro/views/content_viewer/show_configuration.rhtml
| ... | ... | @@ -30,6 +30,8 @@ |
| 30 | 30 | <td><%= metric_configuration.code %></td> |
| 31 | 31 | <td><%= link_to "Edit", :controller => "mezuro_plugin_profile", :action => "edit_metric_configuration", :params => |
| 32 | 32 | {:configuration_name => @configuration.name, :metric_name => metric_configuration.metric.name} %></td> |
| 33 | + <td><%= link_to "Remove", :controller => "mezuro_plugin_profile", :action => "remove_metric_configuration", :params => | |
| 34 | + {:configuration_name => @configuration.name, :metric_name => metric_configuration.metric.name} %></td> | |
| 33 | 35 | </tr> |
| 34 | 36 | <% end %> |
| 35 | 37 | </table> | ... | ... |