From 4b10611e85adffe1234ce693348d87d11984b680 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 4 Oct 2012 22:48:29 +0200 Subject: [PATCH] Add HTML IDs for integration tests --- .../webapp/WEB-INF/app/controllers/dashboard_controller.rb | 2 +- .../app/views/dashboard/_widget_properties.html.erb | 7 ++++--- sonar-server/src/main/webapp/stylesheets/dashboard.css | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb index 5c02d7a47e1..a4d9cce2c80 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb @@ -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| diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb index cdc03e0d892..bcac687922d 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb @@ -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 -%> @@ -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}"} -%> <% end %> @@ -33,7 +34,7 @@
- <%= submit_tag message('save') %> + <%= submit_tag message('save'), :id => "widget-save-#{widget.key.parameterize}" -%> <% if widget.configured %> <%= message('cancel') -%> <% end %> diff --git a/sonar-server/src/main/webapp/stylesheets/dashboard.css b/sonar-server/src/main/webapp/stylesheets/dashboard.css index f7216704e12..4572c090454 100644 --- a/sonar-server/src/main/webapp/stylesheets/dashboard.css +++ b/sonar-server/src/main/webapp/stylesheets/dashboard.css @@ -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; -- 2.39.5