]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6008 Display login and email in SCM accounts of My Profile's page
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 12 Jan 2015 16:13:01 +0000 (17:13 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 12 Jan 2015 16:39:46 +0000 (17:39 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/models/user.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 001521734bddab3e91df5a78fbfca2bb2b260e3d..a727b0b529e7400df949dce6868f68902023c34d 100644 (file)
@@ -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
index b781aeb2740a33e273e87c1caab5ba6aff7606a0..7bcd1ac00b4cb63a374ad1f0de91b34298aac1d5 100644 (file)
@@ -29,7 +29,7 @@
       </tr>
       <tr>
         <td><b><%= message('my_profile.scm_accounts') -%>:</b></td>
-        <td id="groups"><%= current_user.scm_accounts.split(',').reject { |c| c.empty? }.join(', ') if current_user.scm_accounts %></td>
+        <td id="groups"><%= current_user.full_scm_accounts.join(', ') %></td>
       </tr>
     </table>
   </div>
index be1b723a853e25cba2b42ca2ffd146075b23d18e..964a145b46ad8c4ce80956fbcea2f8f13ec03d09 100644 (file)
@@ -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