summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-12-05 18:00:21 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-12-05 18:00:21 +0100
commit7cb4cf4d9f7b44ddc381eadc5b6dd87192a6dfed (patch)
treecacca4c5c66aedf9188bbdffed3bf7ecaa9a36d6
parentd0120d0b728928ee2b5d49fe933e9966af182e42 (diff)
downloadsonarqube-7cb4cf4d9f7b44ddc381eadc5b6dd87192a6dfed.tar.gz
sonarqube-7cb4cf4d9f7b44ddc381eadc5b6dd87192a6dfed.zip
SONAR-3825 move the "Project" criteria to "+ More Criteria"
-rw-r--r--plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties3
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb19
3 files changed, 13 insertions, 10 deletions
diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
index 8cd7fec38b6..126efdf8439 100644
--- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
+++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
@@ -390,6 +390,7 @@ measure_filter.criteria.key=Key
measure_filter.criteria.name=Name
measure_filter.criteria.language=Language
measure_filter.criteria.metric=Metric
+measure_filter.criteria.project=Project
measure_filter.criteria.age.from_date=From date
measure_filter.criteria.age.to_date=To date
measure_filter.criteria.age.note=year-month-day (2012-01-31)
@@ -949,7 +950,7 @@ widget.rfc.per_class.suffix=\ /class
widget.resource_id=project
widget.welcome.name=Welcome
-widget.welcome.description=
+widget.welcome.description=Welcome message used to provide links to the most valuable resources like documentation and support
widget.welcome.html=<h3>Welcome to Sonar Dashboard</h3>\
<p>Since you are able to read this, it means that you have successfully started your Sonar server. Well done!</p>\
<p>If you have not removed this text, it also means that you have not yet played much with Sonar. So here are a few pointers for your next step:</p>\
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
index dd1e4a557fc..0d1a7296125 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
@@ -22,6 +22,7 @@ class MeasuresController < ApplicationController
# GET /measures/index
def index
@filter = MeasureFilter.new
+ @filter.set_criteria_value('qualifiers', 'TRK')
render :action => 'search'
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
index a94004f1607..3b3efe0d19c 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
@@ -29,13 +29,13 @@
}
var hiddenConditionIndexes = [<%= hidden_condition_indexes.join(',') -%>];
$j(document).ready(function () {
- $j('#select-lang').select2({allowClear:true, width:'100%', placeholder:'<%= message 'measure_filter.languages' -%>'});
- $j('#select-qualifiers').select2({allowClear:true, width:'100%', placeholder:'Resources'});
+ $j('#select-lang').select2({allowClear: true, width: '100%', placeholder: '<%= message 'measure_filter.languages' -%>'});
+ $j('#select-qualifiers').select2({allowClear: true, width: '100%', placeholder: 'Resources'});
$j('#more-criteria')
- .select2({allowClear:true, width:'100%', placeholder:'<%= message 'measure_filter.more_criteria' -%>'})
+ .select2({allowClear: true, width: '100%', placeholder: '<%= message 'measure_filter.more_criteria' -%>'})
.on("change", function (e) {
$j("#criteria-" + e.val).insertBefore($j("#more-td")).show();
- if (e.val == 'lang') {
+ if (e.val == 'lang' || e.val == 'project') {
$j("#select-" + e.val).select2("enable");
$j("#select-" + e.val).select2("focus");
}
@@ -67,10 +67,10 @@
if @filter.display
%>
<input type="hidden" name="display" value="<%= @filter.display.key -%>"/>
- <%
+ <%
@filter.display.url_params.each do |k_v_array|
if k_v_array[1].is_a?(String)
- %>
+ %>
<%= hidden_field_tag k_v_array[0], k_v_array[1] -%>
<% else
k_v_array[1].each do |string_val|
@@ -85,9 +85,6 @@
<%= @filter.name.present? ? h(@filter.name) : 'New Search' -%>
</li>
<li>
- <%= resource_select_tag 'baseId', :resource_type_property => 'supportsGlobalDashboards', :width => '100%', :selected_resource => @filter.base_resource, :placeholder => 'Path' -%>
- </li>
- <li>
<%
qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type|
[message("qualifiers.#{resource_type.getQualifier()}"), resource_type.getQualifier()]
@@ -95,6 +92,9 @@
%>
<%= select_tag 'qualifiers[]', options_for_select(qualifiers, @filter.criteria['qualifiers']||''), :multiple => true, :id => 'select-qualifiers' -%>
</li>
+ <li id="criteria-project" <%= "style='display:none'" unless @filter.base_resource -%>>
+ <%= resource_select_tag 'baseId', :resource_type_property => 'supportsGlobalDashboards', :width => '100%', :selected_resource => @filter.base_resource, :placeholder => message('project'), :html_id => 'select-project' -%>
+ </li>
<li id="criteria-lang" <%= "style='display:none'" unless @filter.criteria('languages') -%>>
<% languages = [['', '']].concat(Api::Utils.languages.map { |lang| [lang.name, lang.key] }) %>
<%= select_tag 'languages[]', options_for_select(languages, @filter.criteria['languages']), :multiple => true, :id => 'select-lang' -%>
@@ -146,6 +146,7 @@
<option value="lang"><%= message 'measure_filter.criteria.language' -%></option>
<option value="metric"><%= message 'measure_filter.criteria.metric' -%></option>
<option value="name"><%= message 'measure_filter.criteria.name' -%></option>
+ <option value="project"><%= message 'measure_filter.criteria.project' -%></option>
</select>
</li>
<li>