]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 move the "Project" criteria to "+ More Criteria"
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 17:00:21 +0000 (18:00 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 5 Dec 2012 17:00:21 +0000 (18:00 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
sonar-server/src/main/webapp/WEB-INF/app/controllers/measures_controller.rb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb

index 8cd7fec38b640658b6bd944a318606fd9ac871ba..126efdf84395957308f71d45b958961f3c021f27 100644 (file)
@@ -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>\
index dd1e4a557fce44c29f1dd545f00ef2040f12d9fb..0d1a7296125d30571d23194001fba37cd8be986a 100644 (file)
@@ -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
 
index a94004f1607973149925ae45a2133d4bf8377ef5..3b3efe0d19cc4ec813ad2e6b01a760e0d2e3b565 100644 (file)
     }
     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");
           }
        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|
@@ -84,9 +84,6 @@
     <li class="sidebar-title">
       <%= @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|
@@ -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' -%>
         <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>