From 4fbc2e23e03e693ebc4b3dc5c971e42fbb2379ee Mon Sep 17 00:00:00 2001 From: Fabrice Bellingard Date: Wed, 4 Jul 2012 16:00:53 +0200 Subject: [PATCH] SONAR-1608 Variable renaming for more consistency --- .../app/controllers/project_controller.rb | 16 ++++++++-------- .../WEB-INF/app/views/project/key.html.erb | 4 ++-- .../project/prepare_key_bulk_update.html.erb | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb index 3e4643915f7..1391edd4ac0 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/project_controller.rb @@ -99,13 +99,13 @@ class ProjectController < ApplicationController def prepare_key_bulk_update @project = get_current_project(params[:id]) - @old_prefix = params[:old_prefix].strip - @new_prefix = params[:new_prefix].strip - if @old_prefix.blank? || @new_prefix.blank? + @string_to_replace = params[:string_to_replace].strip + @replacement_string = params[:replacement_string].strip + if @string_to_replace.blank? || @replacement_string.blank? flash[:error] = message('update_key.fieds_cant_be_blank_for_bulk_update') redirect_to :action => 'key', :id => @project.id else - @key_check_results = java_facade.checkModuleKeysBeforeRenaming(@project.id, @old_prefix, @new_prefix) + @key_check_results = java_facade.checkModuleKeysBeforeRenaming(@project.id, @string_to_replace, @replacement_string) @can_update = false @duplicate_key_found = false @key_check_results.each do |key, value| @@ -122,12 +122,12 @@ class ProjectController < ApplicationController def perform_key_bulk_update project = get_current_project(params[:id]) - old_prefix = params[:old_prefix].strip - new_prefix = params[:new_prefix].strip + string_to_replace = params[:string_to_replace].strip + replacement_string = params[:replacement_string].strip - unless old_prefix.blank? || new_prefix.blank? + unless string_to_replace.blank? || replacement_string.blank? begin - java_facade.bulkUpdateKey(project.id, old_prefix, new_prefix) + java_facade.bulkUpdateKey(project.id, string_to_replace, replacement_string) flash[:notice] = message('update_key.key_updated') rescue Exception => e flash[:error] = message('update_key.error_occured_while_renaming_key_of_x', diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/key.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/key.html.erb index fdc99f36876..7efb7581e41 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/key.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/key.html.erb @@ -29,12 +29,12 @@ - + - + diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/prepare_key_bulk_update.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/prepare_key_bulk_update.html.erb index cd7d6d45e84..e7cf3b3bd68 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/prepare_key_bulk_update.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/prepare_key_bulk_update.html.erb @@ -1,5 +1,5 @@ <% - if @old_prefix && @new_prefix + if @string_to_replace && @replacement_string # validation screen for bulk update reset_cycle 'modules_tree' %> @@ -19,9 +19,9 @@ <%= message('update_key.keys_will_be_updated_as_follows') -%> <% else %> <% if @duplicate_key_found %> - <%= message('update_key.cant_update_because_duplicate_keys', :params => [@old_prefix, @new_prefix]) -%> + <%= message('update_key.cant_update_because_duplicate_keys', :params => [@string_to_replace, @replacement_string]) -%> <% else %> - <%= message('update_key.no_key_to_update', :params => @old_prefix) -%> + <%= message('update_key.no_key_to_update', :params => @string_to_replace) -%> <% end %> <% end %>

@@ -41,8 +41,8 @@ <% if @can_update %> <% form_tag( {:action => 'perform_key_bulk_update', :id => @project.id }, :onsubmit => "update_launched();$('loading_bulk_update').show();") do -%> - - + +
<%= submit_tag message('update_key.rename'), :id => 'bulk_update_button', :class => 'action' -%> <%= message('cancel') -%> -- 2.39.5
<%= message('update_key.replace') -%>: <%= message('update_key.replace_example') -%>
<%= message('update_key.by') -%>: <%= message('update_key.by_example') -%>