From: David Gageot Date: Tue, 2 Oct 2012 11:30:41 +0000 (+0200) Subject: SONAR-3529 Fix deletion of property sets X-Git-Tag: 3.3~144 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=974be60a7b4c3f75c6e1ccfb1a55459f1ff817b0;p=sonarqube.git SONAR-3529 Fix deletion of property sets --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb index 83741be6f9f..8125a303679 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/settings_controller.rb @@ -56,7 +56,7 @@ class SettingsController < ApplicationController def update_property_sets(resource_id) (params[:property_sets] || []).each do |key, set_keys| - Property.with_key_prefix(key + '.').delete_all + Property.with_key_prefix(key + '.').with_resource(resource_id).delete_all update_property(key, set_keys, resource_id) params[key].each do |field_key, field_values| diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET.html.erb index 20f34618e46..ae8159a9df4 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/settings/_type_PROPERTY_SET.html.erb @@ -1,14 +1,11 @@ <% choices = Property.values(property.propertySetKey).reject(&:blank?) -%> <% prompt = [[message('default'), '']] -%> -<% if choices.exclude? value -%> +<% if !value.blank? && (choices.exclude? value) -%> + <%= image_tag 'exclamation.png' -%> <% missing = [[h(value + ' <' + message('deleted') + '>'), value]] -%> <% else -%> <% missing = [] -%> <% end -%> -<%= select_tag name, options_for_select(prompt + choices + missing, value), :id => id -%> - -<% if choices.exclude? value -%> - <%= image_tag 'exclamation.png' -%> -<% end -%> +<%= select_tag name, options_for_select(prompt + choices + missing, value), :id => id -%> \ No newline at end of file