]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4100 When adding a new project, select "Email" by default
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 19 Feb 2013 13:35:06 +0000 (14:35 +0100)
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>
Tue, 19 Feb 2013 14:28:11 +0000 (15:28 +0100)
sonar-server/src/main/webapp/WEB-INF/app/controllers/account_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/account/_per_project_notifications.html.erb

index 47e81d1c9d28f87fb5ccb9b7a130bf4c83dd1a32..6277b81c0cdc1ad3668b27b80f44f324ace30ddf 100644 (file)
@@ -34,6 +34,7 @@ class AccountController < ApplicationController
       new_project = Project.by_key params[:new_project]
       unless @per_project_notifications[new_project.id]
         @per_project_notifications[new_project.id] = init_project_notifications
+        @new_project_id = new_project.id
       end
       @selected_project_id = new_project.id
     end
index cc4a61bff167a5c9f09f2fac90b4167116a9c5d1..92e0d301b2a98f54710553e9716527b83aa69091 100644 (file)
@@ -59,7 +59,7 @@
           <td>
             <select id="<%= select_id -%>" name="notifications[<%= r_id.to_s -%>][<%= dispatcher-%>][]" multiple style="width: 100%">
               <% @channels.each do |channel| -%>
-                <option value="<%= channel.getKey() -%>" <%= 'selected' if per_project_notif[dispatcher].include?(channel.getKey()) -%>><%= message('notification.channel.' + channel.getKey()) -%></option>
+                <option value="<%= channel.getKey() -%>" <%= 'selected' if per_project_notif[dispatcher].include?(channel.getKey()) || (r_id==@new_project_id && channel.getKey()=='EmailNotificationChannel') -%>><%= message('notification.channel.' + channel.getKey()) -%></option>
               <% end %>
             </select>
             <script>