aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-01-23 10:36:29 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-01-23 10:36:29 +0100
commit656f908c6ba470ef8d5fb2274d8b3962453fa13c (patch)
tree81ca29217cf5772ada865a4c8b5331572d7c5b4a /sonar-server/src
parentd622654adeb4c657e426732b8d4d24aa6b62d9c6 (diff)
downloadsonarqube-656f908c6ba470ef8d5fb2274d8b3962453fa13c.tar.gz
sonarqube-656f908c6ba470ef8d5fb2274d8b3962453fa13c.zip
SONAR-3692 Fix issue with property set
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb2
5 files changed, 7 insertions, 5 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
index fd19bacb372..3e815005411 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/properties_helper.rb
@@ -90,7 +90,7 @@ module PropertiesHelper
default_value = options[:default].blank? ? '' : message('default')
select_options = "<option value=''>#{ default_value }</option>"
options[:values].each do |option|
- message = screen == SCREEN_WIDGET ? option_name_with_key(options[:extra_values][:key], nil, option, 'widget') :
+ message = screen == SCREEN_WIDGET ? option_name_with_key(name, nil, option, 'widget.'+ options[:extra_values][:widget_key]) :
option_name(options[:extra_values][:property], options[:extra_values][:field], option)
select_options += "<option value='#{ html_escape option }' #{ 'selected' if value && value==option }>#{ message }</option>"
end
@@ -142,6 +142,8 @@ module PropertiesHelper
message
else
# Old key used for retro-compatibility
+ puts "#### "+ prefix.to_s
+
message = message(prefix +"option.#{property_key}.#{option}.name", :default => '')
message = message(prefix +"property.#{property_key}.option.#{option}.name", :default => option) unless message != ''
message
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
index 53dd397cbfd..465f7ba0c3b 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/widget_properties_helper.rb
@@ -23,7 +23,7 @@ module WidgetPropertiesHelper
def property_value_field(definition, value, widget)
id = definition.type.name != PropertyType::TYPE_METRIC ? definition.key : "prop-#{widget.id}-#{widget.key.parameterize}-#{definition.key.parameterize}"
options = {:values => definition.options, :id => id, :default => definition.defaultValue}
- options[:extra_values] = {:key => widget.key} if definition.type.name == PropertyType::TYPE_SINGLE_SELECT_LIST
+ options[:extra_values] = {:widget_key => widget.key} if definition.type.name == PropertyType::TYPE_SINGLE_SELECT_LIST
property_input_field definition.key, definition.type.name, value, 'WIDGET', options
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
index e1e809eb2b2..74e6c8c8635 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_BOOLEAN.html.erb
@@ -1 +1 @@
-<%= property_input_field(name, PropertyType::TYPE_BOOLEAN, value, PropertiesHelper::SCREEN_SETTINGS, {:id => id, :default => (defined? defaultValue) ? property.defaultValue : nil }) %> \ No newline at end of file
+<%= property_input_field(name, PropertyType::TYPE_BOOLEAN, value, PropertiesHelper::SCREEN_SETTINGS, {:id => id, :default => (defined? property.defaultValue) ? property.defaultValue : nil }) %> \ No newline at end of file
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb
index 4f121917ca4..18e706b7f26 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_METRIC.html.erb
@@ -1,5 +1,5 @@
<%
- defaultValue = (defined? defaultValue) ? property.defaultValue : nil
+ defaultValue = (defined? property.defaultValue) ? property.defaultValue : nil
%>
<select name="<%= name -%>" id="<%= id -%>">
<option value=""><%= !defaultValue.blank? ? message('default') : nil -%></option>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
index 9dbeac7a2b5..4153c332d13 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_SINGLE_SELECT_LIST.html.erb
@@ -1,2 +1,2 @@
<%= property_input_field(name, PropertyType::TYPE_SINGLE_SELECT_LIST, value, PropertiesHelper::SCREEN_SETTINGS,
- {:id => id, :default => property.defaultValue, :values => property.options, :extra_values => {:property => property, :field => field}}) %> \ No newline at end of file
+ {:id => id, :default => (defined? property.defaultValue) ? property.defaultValue : nil, :values => property.options, :extra_values => {:property => property, :field => field}}) %> \ No newline at end of file