]> source.dussan.org Git - sonarqube.git/commitdiff
Add HTML IDs for integration tests
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 4 Oct 2012 20:48:29 +0000 (22:48 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 4 Oct 2012 20:48:58 +0000 (22:48 +0200)
sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb
sonar-server/src/main/webapp/stylesheets/dashboard.css

index 5c02d7a47e13c5788119f7ef2ab2b932801b4b5e..a4d9cce2c808273c29547caa464cf48ad4de6720 100644 (file)
@@ -119,7 +119,7 @@ class DashboardController < ApplicationController
           prop.save!
         end
       end
-      widget.resource_id=params[:resource_id]
+      widget.resource_id=Project.by_key(params[:resource_id]).id
       widget.configured=true
       widget.save!
       render :update do |page|
index cdc03e0d8925bc797a633ebb03079d1079bb22bc..bcac687922dda7cd1a8323bf4cd00d24df72f345 100644 (file)
@@ -1,7 +1,8 @@
 <% form_remote_tag :url => {:action => :save_widget, :wid => widget.id, :id => params[:id]},
                    :method => :post,
                    :update => {:failure => "error#{widget.id}"},
-                   :failure => "$('error#{widget.id}').show()" do -%>
+                   :failure => "$('error#{widget.id}').show()",
+                   :id => "form-edit-#{widget.key.parameterize}" do -%>
   <div id="error<%= widget.id -%>" class="error" style="display: none"></div>
   <table class="table width100">
     <tbody>
@@ -14,7 +15,7 @@
               :resource_type_property => 'supportsGlobalDashboards',
               :selected_resource => widget.resource,
               :width => '250px',
-              :html_id => "sel-prj-#{widget.id}"} -%>
+              :html_id => "widget-select-prj-#{widget.key.parameterize}"} -%>
         </td>
       </tr>
     <% end %>
@@ -33,7 +34,7 @@
 
     <tr>
       <td colspan="2">
-        <%= submit_tag message('save') %>
+        <%= submit_tag message('save'), :id => "widget-save-#{widget.key.parameterize}" -%>
         <% if widget.configured %>
           <a href="#" onClick="portal.cancelEditWidget(<%= widget.id -%>);return false;"><%= message('cancel') -%></a>
         <% end %>
index f7216704e12e228a4c7893606f04a62d46a1075e..4572c090454b4adae62ca271d77a95c6c3c6a1aa 100644 (file)
@@ -46,7 +46,7 @@
 #dashboard .widget-title {
   background-color: #4B9FD5;
   color: #FEFEFE;
-  padding: 3px 0 3px 5px;
+  padding: 5px;
   height: 16px;
   line-height: 16px;
   vertical-align: middle;