From 48273b291da4055577db98e0ac2f28660bf5976f Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 23 Nov 2012 13:44:24 +0100 Subject: [PATCH] SONAR-3792 When renaming a manual metric, the key of this manual metric must not change --- .../WEB-INF/app/controllers/metrics_controller.rb | 2 +- .../webapp/WEB-INF/app/views/metrics/index.html.erb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb index 688d266a324..f1aa452e304 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb @@ -44,7 +44,7 @@ class MetricsController < ApplicationController metric.attributes=params[:metric] if metric.short_name(false) - metric.name = metric.short_name(false).downcase.gsub(/\s/, '_')[0..59] + metric.name = metric.short_name(false).downcase.gsub(/\s/, '_')[0..59] unless params[:id] end unless params[:newdomain].blank? metric.domain = params[:newdomain] diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb index 411bd851ab6..ef3a13ffb0a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb @@ -16,11 +16,11 @@ <% @metrics.each do |metric| %> - <%= metric.key -%> - <%= h metric.short_name -%> - <%= h metric.description -%> - <%= metric.domain -%> - <%= metric.value_type_name -%> + <%= metric.key -%> + <%= h metric.short_name -%> + <%= h metric.description -%> + <%= metric.domain -%> + <%= metric.value_type_name -%> <% if is_admin? && metric.updatable_online? %> <%= link_to 'Edit', {:action => 'index', :id => metric.id}, {:class => 'link-action', :id => "edit_#{h(metric.short_name)}", :method => 'get'} %> -- 2.39.5