aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-01-18 11:18:04 +0100
committerJulien Lancelot <julien.lancelot@gmail.com>2013-01-18 11:18:04 +0100
commit8e786de62da9869c93eb9d7232f19e2ff5d1c2d3 (patch)
tree1c6d9fa4f4f5694bb51917f61e3f114785e2405c /sonar-server
parent06270f8f95a8ea553b491d9139cad77926a93db6 (diff)
downloadsonarqube-8e786de62da9869c93eb9d7232f19e2ff5d1c2d3.tar.gz
sonarqube-8e786de62da9869c93eb9d7232f19e2ff5d1c2d3.zip
SONAR-3991 Add html class for Selenium test
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb6
2 files changed, 7 insertions, 3 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
index 5f271aadbe1..54d0dcbbdf5 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/application_helper.rb
@@ -544,6 +544,7 @@ module ApplicationHelper
# ==== Options
# * <tt>:width</tt> - The width suffixed with unit, for example '300px' or '100%'. Default is '250px'
# * <tt>:html_id</tt> - The id of the HTML element. Default is the name.
+ # * <tt>:html_class</tt> - The class of the HTML element. Default is empty.
# * <tt>:qualifiers</tt> - Array of resource qualifiers to filter.
# * <tt>:resource_type_property</tt> -Filter on resource types on which the property is enabled, for example 'supportsGlobalDashboards'.
# * <tt>:selected_resource</tt> - the resource that is selected by default.
@@ -554,6 +555,7 @@ module ApplicationHelper
def resource_select_tag(name, options={})
width=options[:width]
html_id=options[:html_id]||name
+ html_class=options[:html_class]||''
ws_url="#{ApplicationController::root_context}/api/resources/search?f=s2&"
if options[:qualifiers]
@@ -583,7 +585,7 @@ module ApplicationHelper
js_options['ajax']='{' + ajax_options.map { |k, v| "#{k}:#{v}" }.join(',') + '}'
js_options.merge!(options[:select2_options]) if options[:select2_options]
- html = "<input type='hidden' id='#{html_id}' name='#{name}'/>"
+ html = "<input type='hidden' id='#{html_id}' class='#{html_class}' name='#{name}'/>"
js = "$j('##{html_id}').select2({#{js_options.map { |k, v| "#{k}:#{v}" }.join(',')}});"
resource = options[:selected_resource]
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 72970d01683..b1d3cc3e57e 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
@@ -15,7 +15,9 @@
:resource_type_property => 'supportsGlobalDashboards',
:selected_resource => widget.resource,
:width => '250px',
- :html_id => "widget-#{widget.id}-select-prj-#{widget.key.parameterize}"} -%>
+ :html_id => "widget-#{widget.id}-select-prj-#{widget.key.parameterize}",
+ :html_class => "widget-select-prj-#{widget.key.parameterize}"
+ } -%>
</td>
</tr>
<% end %>
@@ -34,7 +36,7 @@
<tr>
<td colspan="2">
- <%= submit_tag message('save'), :id => "widget-save-#{widget.key.parameterize}" -%>
+ <%= submit_tag message('save'), :id => "widget-#{widget.id}-save-#{widget.key.parameterize}", :class => "widget-save-#{widget.key.parameterize}" -%>
<% if widget.configured %>
<a href="#" onClick="portal.cancelEditWidget(<%= widget.id -%>);return false;"><%= message('cancel') -%></a>
<% end %>