]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 many different improvements on usability
authorSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Dec 2012 17:22:06 +0000 (18:22 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Mon, 10 Dec 2012 17:22:24 +0000 (18:22 +0100)
plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb
plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/_sidebar.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb

index aaf89c1c9382c90004b8d1e73c4f6f5c96662676..8fc028e7661191f02def9856852bba3847e03c7a 100644 (file)
@@ -28,6 +28,7 @@ changelog=Changelog
 change_verb=Change
 class=Class
 classes=Classes
+close=Close
 closed=Closed
 code=Code
 color=Color
@@ -96,6 +97,7 @@ plugin=Plugin
 project=Project
 projects=Projects
 raw=Raw
+refresh=Refresh
 remove=Remove
 rename=Rename
 reset_verb=Reset
@@ -392,13 +394,15 @@ 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)
-measure_filter.criteria.age.more_than=More than
-measure_filter.criteria.age.within_last=Within the last
+measure_filter.criteria.from_date=Inspected since
+measure_filter.criteria.to_date=Inspected before
+measure_filter.criteria.date_format=year-month-day (2013-01-31)
+measure_filter.criteria.age.more_than=Inspected more than
+measure_filter.criteria.age.within_last=Inspected within the last
 measure_filter.criteria.age.days_ago=days ago
 measure_filter.criteria.age.days=days
+measure_filter.criteria.components_of=Components of
+measure_filter.criteria.components_of_project=Components of project
 measure_filter.new_search=New search
 measure_filter.more_criteria=+ More Criteria
 measure_filter.languages=Languages
@@ -429,8 +433,11 @@ measure_filter.name_contains=Name contains
 measure_filter.manage_filters=Manage Filters
 measure_filter.display.list=List
 measure_filter.display.treemap=Treemap
-measure_filter.configure_columns=Configure Columns
+measure_filter.list.change=Change Columns
+measure_filter.treemap.change=Change Treemap
 measure_filter.too_many_results=Too many results. Please refine your search.
+measure_filter.add_column_button=Add Column
+measure_filter.widget.unknown_filter_warning=This widget is configured to display a measure filter that doesn't exist anymore.
 
 
 #------------------------------------------------------------------------------
@@ -962,6 +969,13 @@ widget.welcome.html=<h3 class="marginbottom5">Welcome to Sonar Dashboard</h3>\
                       <li>If you have a question or an issue, please report it on the <a href="http://redirect.sonarsource.com/4">mailing list</a>.</li>\
                     </ul>
 
+widget.measure_filter_list.name=Measure Filter as List
+widget.measure_filter_list.description=Displays the result of a pre-configured measure filter as a list
+
+widget.measure_filter_treemap.name=Measure Filter as Treemap
+widget.measure_filter_treemap.description=Displays the result of pre-configured measure filter as a Treemap
+
+
 #------------------------------------------------------------------------------
 #
 # COMPONENTS
index dbfaacd82e9b798385caf8d32616be1605170030..c92b0abdbd8fbf23a5f8c1e1e1c5d4b70feb50f9 100644 (file)
        filter.execute(self, :user => current_user)
        @widget_title = link_to h(filter.name), {:controller => 'measures', :action => 'filter', :id => filter.id, :display => 'list'}
 %>
+    <% if filter.description.present? %><p><%= h filter.description -%></p><% end %>
     <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
-  <%
-     end
+<%
      end
-  %>
\ No newline at end of file
+   else
+%>
+  <p><%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%></p>
+<%
+   end
+%>
\ No newline at end of file
index 599d802ae84b6738787a18e602380160bc14b2d7..d1c59cb5ad07534f29e62abbaad8c475e0e68c46 100644 (file)
 
        @widget_title = link_to h(filter.name), url_options
 %>
+    <% if filter.description.present? %><p><%= h filter.description -%></p><% end %>
     <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %>
-  <%
+<%
      end
+  else
+%>
+  <p><%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%></p>
+<%
      end
-  %>
\ No newline at end of file
+%>
\ No newline at end of file
index cae0f929c621f3607b92dd71158f3d9c47ef484d..baa087c687bed4f9689b5efd4fd853aab1236ea5 100644 (file)
@@ -73,8 +73,6 @@
                 <a href="<%= ApplicationController.root_context -%>/dashboard/index/<%= @project.id -%>?did=<%= active_dashboard.dashboard_id -%><%= "&"+period_param if period_param -%>"><%= active_dashboard.dashboard.name(true) -%></a>
               </li>
             <% end %>
-            <li class="<%= 'active' if request.request_uri.include?('/cloud/index') -%>">
-              <a href="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>"><%= message('clouds.page') -%></a></li>
             <li class="spacer"></li>
             <li class="sidebar-title"><%= message('sidebar.tools') -%></li>
             <li class="<%= 'active' if request.request_uri.include?('/components/index') -%>">
             <li class="<%= 'active' if request.request_uri.include?('/drilldown/violations') -%>">
               <a href="<%= ApplicationController.root_context -%>/drilldown/violations/<%= @project.id -%><%= "?"+period_param if period_param -%>"><%= message('violations_drilldown.page') -%></a>
             </li>
-              <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %>
-              <li class="<%= 'active' if request.request_uri.include?('/comparison/index') -%>">
-                <a href="<%= ApplicationController.root_context -%>/comparison/index?resource=<%= @project.key -%>"><%= message('comparison.page') -%></a>
-              </li>
-            <% end %>
             <% controller.java_facade.getPages(Navigation::SECTION_RESOURCE, @project.scope, @project.qualifier, @project.language, @project.last_snapshot.metric_keys.to_java(:string)).each do |page|
               page_url = (page.isController() ? "#{page.getId()}?id=#{@project.id}" : "/plugins/resource/#{@project.id}?page=#{page.getId()}")
             %>
                 <a href="<%= ApplicationController.root_context -%><%= page_url -%>"><%= message(page.getId() + '.page', :default => page.getTitle()) %></a>
               </li>
             <% end %>
+            <li class="<%= 'active' if controller.controller_path=='cloud' -%>">
+              <a href="<%= ApplicationController.root_context -%>/cloud/index/<%= @project.id -%>"><%= message('clouds.page') -%></a>
+            </li>
+            <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %>
+              <li class="<%= 'active' if request.request_uri.include?('/comparison/index') -%>">
+                <a href="<%= ApplicationController.root_context -%>/comparison/index?resource=<%= @project.key -%>"><%= message('comparison.page') -%></a>
+              </li>
+            <% end %>
+
 
           <% elsif selected_section==Navigation::SECTION_CONFIGURATION %>
 
index 81836524f4b29bc93c94ea29ebae6e21bfc62d28..57b872cb69a3da3fa70cc6059a13079e9e8f5ec0 100644 (file)
@@ -4,7 +4,7 @@
    colspan += 1 if display_favourites
    table_columns = []
    table_columns << '' if display_favourites
-   table_columns.concat(filter.display.columns.map{|c| c.key})
+   table_columns.concat(filter.display.columns.map { |c| c.key })
    if edit_mode
      content_for :script do
 %>
@@ -63,7 +63,7 @@
   %>
 
 <% if edit_mode %>
-  <table class="spaced width100 admin">
+  <table class="spaced width100 box">
     <tr>
       <td>
         <%= metric_select_tag 'metric', Metric.all.reject { |m| m.hidden || m.data? },
           <% end %>
         </select>
 
-        <button id="add-metric">Add Column</button>
+        <button id="add-metric"><%= message 'measure_filter.add_column_button' %></button>
       </td>
       <td class="right">
-        <a href="#" class="button" id="exit-edit">Done</a>
+        <a href="#" class="button" id="exit-edit"><%= message 'close' -%></a>
+        <% if filter.owner?(current_user) %>
+          <a id="save-columns" href="<%= url_for params.merge({:action => 'save_form', :id => filter.id}) -%>" class="button open-modal"><%= message('save_and_close') -%></a>
+        <% end %>
       </td>
     </tr>
   </table>
   <tbody>
 
   <% if edit_mode %>
-    <tr class="admin">
+    <tr class="bordered-bottom">
       <% if display_favourites %>
         <td></td>
       <% end %>
index 46de81a4af9d9e72be2fcc1c29c1157110c06ac1..8b20b0ab9904b3ccc5889cabdfeebfd767a33450 100644 (file)
@@ -1,7 +1,6 @@
 <%
-   treemap_id = 1
-   if defined? widget
-     treemap_id = widget.id
+   treemap_id = (defined? widget) ? widget.id : 1
+   unless edit_mode
 %>
   <table class="spaced">
     <tr>
@@ -11,7 +10,7 @@
       <% if filter.display.color_metric %>
         <td class="thin nowrap">
           <span class="note"><%= message('color') -%>
-          : <b><%= filter.display.color_metric.short_name -%></b> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %></span>
+            : <b><%= filter.display.color_metric.short_name -%></b> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %></span>
         </td>
       <% end %>
       <td>
@@ -20,7 +19,7 @@
     </tr>
   </table>
 <% else %>
-  <table class="spaced width100">
+  <table class="spaced width100 box">
     <tr>
       <td valign="top" class="thin nowrap">
         <span class="comments"><%= message('size') -%></span>
                               :allow_empty => true,
                               :selected_key => (filter.display.color_metric ? filter.display.color_metric.key : nil) -%>
 
-        <button id="update-treemap">Update</button>
+        <button id="update-treemap"><%= message 'refresh' -%></button>
       </td>
       <td valign="bottom"><%= image_tag 'loading.gif', :id => "tm-loading-#{treemap_id}", :style => 'display:none' -%></td>
+      <td class="right" valign="bottom">
+        <a href="#" class="button" id="exit-edit"><%= message 'close' -%></a>
+        <% if filter.owner?(current_user) %>
+          <a id="save-columns" href="<%= url_for params.merge({:action => 'save_form', :id => filter.id}) -%>" class="button open-modal"><%= message('save_and_close') -%></a>
+        <% end %>
+      </td>
     </tr>
   </table>
 <% end %>
 
 <% unless defined? widget
-   content_for :script do %>
-  <script>
-    $j(document).ready(function () {
-      $j("#update-treemap").on("click", function (e) {
-        var url = removeUrlAttr(decodeURI(window.location.href), 'tmSize');
-        url = removeUrlAttr(url, 'tmColor');
-        url += '&tmSize=' + $j('#select-tm-size').val();
-        var color = $j('#select-tm-color').val();
-        if (color != null && color != '') {
-          url += '&tmColor=' + color;
-        }
-        window.location = url;
+     content_for :script do %>
+    <script>
+      $j(document).ready(function () {
+        $j("#update-treemap").on("click", function (e) {
+          var url = removeUrlAttr(decodeURI(window.location.href), 'tmSize');
+          url = removeUrlAttr(url, 'tmColor');
+          url += '&tmSize=' + $j('#select-tm-size').val();
+          var color = $j('#select-tm-color').val();
+          if (color != null && color != '') {
+            url += '&tmColor=' + color;
+          }
+          window.location = url;
+        });
+        $j("#exit-edit").on("click", function (e) {
+          window.location = removeUrlAttr(decodeURI(window.location.href), 'edit');
+        });
       });
-      $j("#exit-edit").on("click", function (e) {
-        window.location = removeUrlAttr(decodeURI(window.location.href), 'edit');
-      });
-    });
-  </script>
-<% end
-end %>
+    </script>
+  <% end
+     end %>
 
 <% if filter.results.empty? %>
   <p><%= message('no_data') -%></p>
index 4dd87419063816e2d852ccdd8bc0d74e91393823..30f77a4ddcabd0621cf5ae25640e78e44a3c6502 100644 (file)
@@ -83,7 +83,7 @@
     <li class="sidebar-title">
       <%= @filter.name.present? ? h(@filter.name) : 'New Search' -%>
     </li>
-    <li>
+    <li class="marginbottom5">
       <%
          qualifiers = Api::Utils.java_facade.getResourceTypesForFilter().map do |resource_type|
            [message("qualifiers.#{resource_type.getQualifier()}"), resource_type.getQualifier()]
@@ -91,7 +91,8 @@
       %>
       <%= 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 -%>>
+    <li id="criteria-project" <%= "style='display:none'" unless @filter.base_resource -%> class="marginbottom5">
+      <%= message 'measure_filter.criteria.components_of' -%>:
       <%= resource_select_tag 'baseId', :resource_type_property => 'supportsGlobalDashboards', :width => '100%',
                               :selected_resource => @filter.base_resource,
                               :placeholder => message('project'),
                               :allow_clear => true
       -%>
     </li>
-    <li id="criteria-lang" <%= "style='display:none'" unless @filter.criteria('languages') -%>>
+    <li id="criteria-lang" <%= "style='display:none'" unless @filter.criteria('languages') -%> class="marginbottom5">
       <% 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' -%>
     </li>
-    <li id="criteria-name" <%= "style='display:none'" unless @filter.criteria('nameSearch') -%>>
+    <li id="criteria-name" <%= "style='display:none'" unless @filter.criteria('nameSearch') -%> class="marginbottom5">
       <%= message('measure_filter.name_contains') -%>:<br>
       <input type="text" name="nameSearch" value="<%= h @filter.criteria['nameSearch'] -%>">
     </li>
-    <li id="criteria-key" <%= "style='display:none'" unless @filter.criteria('keyRegexp') -%>>
+    <li id="criteria-key" <%= "style='display:none'" unless @filter.criteria('keyRegexp') -%> class="marginbottom5">
       <%= message('measure_filter.key_like') -%>:<br>
       <input type="text" name="keyRegexp" value="<%= h @filter.criteria['keyRegexp'] -%>">
     </li>
-    <li id="criteria-fav" <%= "style='display:none'" unless @filter.criteria('onFavourites') -%>>
+    <li id="criteria-fav" <%= "style='display:none'" unless @filter.criteria('onFavourites') -%> class="marginbottom5">
       <img src="<%= ApplicationController.root_context -%>/images/star.png"> <%= message 'measure_filter.criteria.only_favourites' %>:
       <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%>
     </li>
 
     <% condition_metrics = Metric.all.select { |m| m.numeric? && !m.hidden } %>
     <% for i in 1..3 %>
-      <li id="criteria-metric-<%= i -%>" style="<%= "display: none" if hidden_condition_indexes.include?(i) -%>">
+      <li id="criteria-metric-<%= i -%>" style="<%= "display: none" if hidden_condition_indexes.include?(i) -%>" class="marginbottom5">
         <%= metric_select_tag "c#{i}_metric", condition_metrics, :allow_empty => true, :selected_key => @filter.criteria("c#{i}_metric"), :width => '100%', :placeholder => 'Metric' -%>
         <%= select_tag "c#{i}_period", options_for_select([['Value', ''], [Api::Utils.period_label(1), '1'], [Api::Utils.period_label(2), '2'], [Api::Utils.period_label(3), '3']], @filter.criteria("c#{i}_period")) -%>
         <br>
         <input type="text" size="5" name="c<%= i -%>_val" value="<%= h @filter.criteria("c#{i}_val") -%>">
       </li>
     <% end %>
-    <li id="criteria-date" <%= "style='display:none'" unless @filter.criteria('fromDate') || @filter.criteria('toDate') -%>>
-      <%= message 'measure_filter.criteria.age.from_date' -%>:
-      <input type="text" name="fromDate" value="<%= @filter.criteria['fromDate'] -%>" size="10" maxlength="10">
+    <li id="criteria-date" <%= "style='display:none'" unless @filter.criteria('fromDate') || @filter.criteria('toDate') -%> class="marginbottom5">
+      <%= message('measure_filter.criteria.from_date') -%>:<br>
+      <input type="text" name="fromDate" value="<%= @filter.criteria['fromDate'] -%>" size="10" maxlength="10" class="marginbottom5">
       <br>
-      <%= message 'measure_filter.criteria.age.to_date' -%>:
+      <%= message 'measure_filter.criteria.to_date' -%>:<br>
       <input type="text" name="toDate" value="<%= @filter.criteria['toDate'] -%>" size="10" maxlength="10"><br>
-      <span class="note"><%= message 'measure_filter.criteria.age.note' -%>:</span>
+      <span class="small gray"><%= message 'measure_filter.criteria.date_format' -%></span>
     </li>
-    <li id="criteria-age" <%= "style='display:none'" unless @filter.criteria('ageMinDays') || @filter.criteria('ageMaxDays') -%>>
-      <%= message 'measure_filter.criteria.age.more_than' -%>:
-      <input type="text" name="ageMinDays" value="<%= @filter.criteria['ageMinDays'] -%>" size="3"> <%= message 'measure_filter.criteria.age.days_ago' -%>
-      <br><%= message 'measure_filter.criteria.age.within_last' -%>:
+    <li id="criteria-age" <%= "style='display:none'" unless @filter.criteria('ageMinDays') || @filter.criteria('ageMaxDays') -%> class="marginbottom5">
+      <%= message 'measure_filter.criteria.age.more_than' -%>:<br>
+      <input type="text" name="ageMinDays" value="<%= @filter.criteria['ageMinDays'] -%>" size="3" class="marginbottom5"> <%= message 'measure_filter.criteria.age.days_ago' -%>
+      <br>
+      <%= message 'measure_filter.criteria.age.within_last' -%>:<br>
       <input type="text" name="ageMaxDays" value="<%= @filter.criteria['ageMaxDays'] -%>" size="3"> <%= message 'measure_filter.criteria.age.days' -%>
     </li>
-    <li id="more-td">
+    <li id="more-td" class="marginbottom5">
       <select id="more-criteria">
         <option value=""></option>
         <option value="age"><%= message 'measure_filter.criteria.age' -%></option>
         <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>
+        <option value="project"><%= message 'measure_filter.criteria.components_of_project' -%></option>
       </select>
     </li>
     <li>
index 0ee639049e0f10f31fd09b27877ad3424c41d352..a3bce8fe26c60a7a5897c0f981dc6cb5171485f8 100644 (file)
@@ -29,7 +29,7 @@
   </div>
   <div class="page-split-right">
     <div id="content">
-      <h2><%= message 'measure_filter.manage.my_filters' -%></h2>
+      <h1><%= message 'measure_filter.manage.my_filters' -%></h1>
       <table class="data marginbottom10" id="my-filters">
         <thead>
         <tr>
@@ -84,7 +84,7 @@
 
       <br/>
 
-      <h2><%= message 'measure_filter.manage.shared_filters' -%></h2>
+      <h1><%= message 'measure_filter.manage.shared_filters' -%></h1>
       <table class="data" id="shared-filters">
         <thead>
         <tr>
               <td>
                 <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%>
                 <% if filter.description %>
-                  <div><%= h filter.description -%></div>
+                  <div class="note"><%= h filter.description -%></div>
                 <% end %>
               </td>
               <td>
index 6ce16c9508735873ec1bb24517ff3cfb32caf415..c440fd2862aad7aff8f63563bf60f3b4e1709c56 100644 (file)
           <ul class="operations">
             <%
                edit_mode = (params[:edit]=='true')
-               if @filter.display.key==:list && !edit_mode
+               unless edit_mode
             %>
               <li>
-                <a id="configure-columns" href="<%= url_for params.merge({:edit => true, :id => @filter.id}) -%>"><%= message('measure_filter.configure_columns') -%></a>
+                <a id="change-display" href="<%= url_for params.merge({:edit => true, :id => @filter.id}) -%>"><%= message("measure_filter.#{@filter.display.key}.change") -%></a>
               </li>
             <% end %>
             <li>
               <% end %>
             <% end %>
           </ul>
-          <div class="page_title" style="padding-left: 10px">
-            <% if @filter.description.present? %>
-              <%= h @filter.description -%>
+          <div class="page_title">
+            <% if @filter.name.present? %>
+              <span class="h3"><%= h @filter.name -%></span>
+                <% if @filter.description.present? %>
+                  &nbsp;<span class="note"><%= h @filter.description -%></span>
+                <% end %>
             <% end %>
           </div>
         </div>