From: Julien Lancelot Date: Mon, 12 Jan 2015 16:13:01 +0000 (+0100) Subject: SONAR-6008 Display login and email in SCM accounts of My Profile's page X-Git-Tag: latest-silver-master-#65~244 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dc4873dec54dc3e6bbccf1c0840aa11f69e61056;p=sonarqube.git SONAR-6008 Display login and email in SCM accounts of My Profile's page --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb index 001521734bd..a727b0b529e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb @@ -84,6 +84,15 @@ class User < ActiveRecord::Base write_attribute :email, (value && value.downcase) end + # SCM accounts should also contain login and email + def full_scm_accounts + new_scm_accounts = self.scm_accounts.split(',').reject { |c| c.empty? } if self.scm_accounts + new_scm_accounts = [] unless new_scm_accounts + new_scm_accounts << self.login + new_scm_accounts << self.email + new_scm_accounts + end + def available_groups Group.all - self.groups end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb index b781aeb2740..7bcd1ac00b4 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb @@ -29,7 +29,7 @@ <%= message('my_profile.scm_accounts') -%>: - <%= current_user.scm_accounts.split(',').reject { |c| c.empty? }.join(', ') if current_user.scm_accounts %> + <%= current_user.full_scm_accounts.join(', ') %> diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index be1b723a853..964a145b46a 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2004,7 +2004,7 @@ my_profile.login=Login my_profile.name=Name my_profile.email=Email my_profile.groups=Groups -my_profile.scm_accounts=SCM ccounts +my_profile.scm_accounts=SCM Accounts my_profile.password.title=Change password my_profile.password.old=Old value my_profile.password.new=New value