From 7cb4cf4d9f7b44ddc381eadc5b6dd87192a6dfed Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 5 Dec 2012 18:00:21 +0100 Subject: [PATCH] SONAR-3825 move the "Project" criteria to "+ More Criteria" --- .../resources/org/sonar/l10n/core.properties | 3 ++- .../app/controllers/measures_controller.rb | 1 + .../app/views/measures/_sidebar.html.erb | 19 ++++++++++--------- 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=

Welcome to Sonar Dashboard

\

Since you are able to read this, it means that you have successfully started your Sonar server. Well done!

\

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:

\ 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 %> - <% + <% @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| @@ -84,9 +84,6 @@ -
  • - <%= resource_select_tag 'baseId', :resource_type_property => 'supportsGlobalDashboards', :width => '100%', :selected_resource => @filter.base_resource, :placeholder => 'Path' -%> -
  • <% qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type| @@ -95,6 +92,9 @@ %> <%= select_tag 'qualifiers[]', options_for_select(qualifiers, @filter.criteria['qualifiers']||''), :multiple => true, :id => 'select-qualifiers' -%>
  • +
  • > + <%= resource_select_tag 'baseId', :resource_type_property => 'supportsGlobalDashboards', :width => '100%', :selected_resource => @filter.base_resource, :placeholder => message('project'), :html_id => 'select-project' -%> +
  • > <% 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 @@ +
  • -- 2.39.5