diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-09 18:34:17 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-06-09 18:34:17 +0200 |
commit | 71adc6f55bf33b2d345e264301d7a68010a3737a (patch) | |
tree | 450ac2e7de2aa0fb9263b938dd16bdb4ecdebaf4 /sonar-server | |
parent | 7bd45e07ff1136563ae4c82fe4d0113c13fa95dd (diff) | |
download | sonarqube-71adc6f55bf33b2d345e264301d7a68010a3737a.tar.gz sonarqube-71adc6f55bf33b2d345e264301d7a68010a3737a.zip |
SONAR-4764 do not force deleting profiles before restoring defaults
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb | 4 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_recreate_built_in_form.html.erb | 8 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb index eb50ac9101a..58d2e10e31a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/profiles_controller.rb @@ -66,9 +66,7 @@ class ProfilesController < ApplicationController require_parameters 'language' @language = java_facade.getLanguages().find { |l| l.getKey()==params[:language].to_s } call_backend do - @default_profile_names = Internal.component(Java::OrgSonarServerQualityprofile::QProfileService.java_class).builtInProfileNamesForLanguage(params[:language].to_s) - profiles = Internal.quality_profiles.profilesByLanguage(@language.getKey()).to_a - @existing_default_profiles = profiles.select { |p| @default_profile_names.find { |default_profile| default_profile == p.name() } }.collect { |p| p.name() } + @builtin_profile_names = Internal.component(Java::OrgSonarServerQualityprofile::QProfileService.java_class).builtInProfileNamesForLanguage(params[:language].to_s) end render :partial => 'profiles/recreate_built_in_form' end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_recreate_built_in_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_recreate_built_in_form.html.erb index 2f424ac06e8..d35429a6e84 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_recreate_built_in_form.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/profiles/_recreate_built_in_form.html.erb @@ -7,15 +7,11 @@ </div> <div class="modal-body"> - <% if @existing_default_profiles.empty? %> - <%= h message('quality_profiles.recreate_built_in_profiles_confirmation', :params => [@default_profile_names.join('\', \''), @language.getName()]) -%> - <% else %> - <%= h message('quality_profiles.recreate_built_in_profiles_warning', :params => [@language.getName(), @existing_default_profiles.join('\', \'')]) -%> - <% end %> + <%= h message('quality_profiles.recreate_built_in_profiles_confirmation', :params => [@builtin_profile_names.join('\', \''), @language.getName()]) -%> </div> <div class="modal-foot"> - <input type="submit" value="<%= h message('restore') -%>" id="recreate-built-in-profiles-submit" <%= 'disabled=disabled' unless @existing_default_profiles.empty? -%>/> + <input type="submit" value="<%= h message('restore') -%>" id="recreate-built-in-profiles-submit"/> <a href="#" onclick="return closeModalWindow()" id="recreate-built-in-profiles-cancel"><%= h message('cancel') -%></a> </div> </fieldset> |