From 0cbd2d32b8b1d677313a22ad8121cf987e0ed8e6 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 10 Dec 2012 18:22:06 +0100 Subject: [PATCH] SONAR-3825 many different improvements on usability --- .../resources/org/sonar/l10n/core.properties | 26 +++++++-- .../core/widgets/measure_filter_list.html.erb | 11 +++- .../widgets/measure_filter_treemap.html.erb | 9 ++- .../app/views/layouts/_layout.html.erb | 16 +++--- .../app/views/measures/_display_list.html.erb | 13 +++-- .../views/measures/_display_treemap.html.erb | 55 ++++++++++--------- .../app/views/measures/_sidebar.html.erb | 38 +++++++------ .../app/views/measures/manage.html.erb | 6 +- .../app/views/measures/search.html.erb | 13 +++-- 9 files changed, 113 insertions(+), 74 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 aaf89c1c938..8fc028e7661 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 @@ -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=

Welcome to Sonar Dashboard

\
  • If you have a question or an issue, please report it on the mailing list.
  • \ +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 diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb index dbfaacd82e9..c92b0abdbd8 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_list.html.erb @@ -10,8 +10,13 @@ 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? %>

    <%= h filter.description -%>

    <% 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 +%> +

    <%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%>

    +<% + end +%> \ No newline at end of file diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb index 599d802ae84..d1c59cb5ad0 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/plugins/core/widgets/measure_filter_treemap.html.erb @@ -21,8 +21,13 @@ @widget_title = link_to h(filter.name), url_options %> + <% if filter.description.present? %>

    <%= h filter.description -%>

    <% end %> <%= render :partial => "measures/display_#{filter.display.key}", :locals => {:edit_mode => false, :widget => widget, :filter => filter} %> - <% +<% end + else +%> +

    <%= image_tag 'warning.png' %> <%= message 'measure_filter.widget.unknown_filter_warning' -%>

    +<% end - %> \ No newline at end of file +%> \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index cae0f929c62..baa087c687b 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -73,8 +73,6 @@ "><%= active_dashboard.dashboard.name(true) -%> <% end %> -
  • - <%= message('clouds.page') -%>
  • @@ -83,11 +81,6 @@
  • "><%= message('violations_drilldown.page') -%>
  • - <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %> -
  • - <%= message('comparison.page') -%> -
  • - <% 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()}") %> @@ -95,6 +88,15 @@ <%= message(page.getId() + '.page', :default => page.getTitle()) %> <% end %> +
  • + <%= message('clouds.page') -%> +
  • + <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %> +
  • + <%= message('comparison.page') -%> +
  • + <% end %> + <% elsif selected_section==Navigation::SECTION_CONFIGURATION %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb index 81836524f4b..57b872cb69a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_list.html.erb @@ -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 %> - +
    <%= metric_select_tag 'metric', Metric.all.reject { |m| m.hidden || m.data? }, @@ -78,10 +78,13 @@ <% end %> - + - Done + <%= message 'close' -%> + <% if filter.owner?(current_user) %> + <%= message('save_and_close') -%> + <% end %>
    @@ -139,7 +142,7 @@ <% if edit_mode %> - + <% if display_favourites %> <% end %> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb index 46de81a4af9..8b20b0ab990 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb @@ -1,7 +1,6 @@ <% - treemap_id = 1 - if defined? widget - treemap_id = widget.id + treemap_id = (defined? widget) ? widget.id : 1 + unless edit_mode %> @@ -11,7 +10,7 @@ <% if filter.display.color_metric %> <% end %>
    <%= message('color') -%> - : <%= filter.display.color_metric.short_name -%> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> + : <%= filter.display.color_metric.short_name -%> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> @@ -20,7 +19,7 @@
    <% else %> - +
    +
    <%= message('size') -%> @@ -42,34 +41,40 @@ :allow_empty => true, :selected_key => (filter.display.color_metric ? filter.display.color_metric.key : nil) -%> - + <%= image_tag 'loading.gif', :id => "tm-loading-#{treemap_id}", :style => 'display:none' -%> + <%= message 'close' -%> + <% if filter.owner?(current_user) %> + <%= message('save_and_close') -%> + <% end %> +
    <% end %> <% unless defined? widget - content_for :script do %> - -<% end -end %> + + <% end + end %> <% if filter.results.empty? %>

    <%= message('no_data') -%>

    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 4dd87419063..30f77a4ddca 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 @@ -83,7 +83,7 @@ -
  • +
  • <% 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' -%>
  • -
  • > +
  • 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'), @@ -99,26 +100,26 @@ :allow_clear => true -%>
  • -
  • > +
  • 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' -%>
  • -
  • > +
  • class="marginbottom5"> <%= message('measure_filter.name_contains') -%>:
  • -
  • > +
  • class="marginbottom5"> <%= message('measure_filter.key_like') -%>:
  • -
  • > +
  • class="marginbottom5"> <%= message 'measure_filter.criteria.only_favourites' %>: <%= check_box_tag 'onFavourites', 'true', @filter.criteria['onFavourites']=='true' -%>
  • <% condition_metrics = Metric.all.select { |m| m.numeric? && !m.hidden } %> <% for i in 1..3 %> -
  • "> +
  • " 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")) -%>
    @@ -126,21 +127,22 @@ ">
  • <% end %> -
  • > - <%= message 'measure_filter.criteria.age.from_date' -%>: - +
  • class="marginbottom5"> + <%= message('measure_filter.criteria.from_date') -%>:
    +
    - <%= message 'measure_filter.criteria.age.to_date' -%>: + <%= message 'measure_filter.criteria.to_date' -%>:

    - <%= message 'measure_filter.criteria.age.note' -%>: + <%= message 'measure_filter.criteria.date_format' -%>
  • -
  • > - <%= message 'measure_filter.criteria.age.more_than' -%>: - <%= message 'measure_filter.criteria.age.days_ago' -%> -
    <%= message 'measure_filter.criteria.age.within_last' -%>: +
  • class="marginbottom5"> + <%= message 'measure_filter.criteria.age.more_than' -%>:
    + <%= message 'measure_filter.criteria.age.days_ago' -%> +
    + <%= message 'measure_filter.criteria.age.within_last' -%>:
    <%= message 'measure_filter.criteria.age.days' -%>
  • -
  • +
  • diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb index 0ee639049e0..a3bce8fe26c 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/manage.html.erb @@ -29,7 +29,7 @@
    -

    <%= message 'measure_filter.manage.my_filters' -%>

    +

    <%= message 'measure_filter.manage.my_filters' -%>

    @@ -84,7 +84,7 @@
    -

    <%= message 'measure_filter.manage.shared_filters' -%>

    +

    <%= message 'measure_filter.manage.shared_filters' -%>

    @@ -108,7 +108,7 @@
    <%= link_to h(filter.name), :action => 'filter', :id => filter.id -%> <% if filter.description %> -
    <%= h filter.description -%>
    +
    <%= h filter.description -%>
    <% end %>
    diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index 6ce16c95087..c440fd2862a 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -10,10 +10,10 @@ -
    - <% if @filter.description.present? %> - <%= h @filter.description -%> +
    + <% if @filter.name.present? %> + <%= h @filter.name -%> + <% if @filter.description.present? %> +  <%= h @filter.description -%> + <% end %> <% end %>
    -- 2.39.5