From b3fb72abc3f079dac17ed6d4eb5871794266b628 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 16 Jul 2014 13:03:14 +0200 Subject: [PATCH] SONAR-5207 remove unused ruby code --- .../app/controllers/columns_controller.rb | 5 -- .../app/controllers/treemap_controller.rb | 54 -------------- .../WEB-INF/app/models/sonar/columns_view.rb | 1 - .../views/measures/_display_treemap.html.erb | 73 ------------------- .../app/views/treemap/_gradient.html.erb | 19 ----- .../app/views/treemap/_treemap.html.erb | 3 - .../views/treemap/_treemap_container.html.erb | 36 --------- .../WEB-INF/app/views/treemap/index.html.erb | 5 -- 8 files changed, 196 deletions(-) delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap_container.html.erb delete mode 100644 server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/index.html.erb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/columns_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/columns_controller.rb index c5468dd31b9..2e3655b2c7c 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/columns_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/columns_controller.rb @@ -37,11 +37,6 @@ class ColumnsController < ApplicationController redirect_to :controller => 'components', :action => 'index', :configuring => 'true', :id => params[:rid] end - def toggle_treemap - @components_configuration.toggle_treemap_enabled - redirect_to :controller => 'components', :action => 'index', :configuring => 'true', :id => params[:rid] - end - def left column = @components_configuration.find_selected_column(@column_id) @components_configuration.move_column(column, "left") diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb deleted file mode 100644 index 7cbc5ce472e..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/treemap_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -class TreemapController < ApplicationController - helper :metrics - - def index - verify_ajax_request - require_parameters :html_id, :resource - - if params[:size_metric].present? - size_metric=Metric.by_key(params[:size_metric]) - bad_request('Unknown metric: ' + params[:size_metric]) unless size_metric - end - - if params[:color_metric].present? - color_metric=Metric.by_key(params[:color_metric]) - bad_request('Unknown metric: ' + params[:color_metric]) unless color_metric - end - - resource = Project.by_key(params[:resource]) - bad_request('Unknown resource: ' + params[:resource]) unless resource - bad_request('Data not available') unless resource.last_snapshot - access_denied unless has_role?(:user, resource) - resource = resource.permanent_resource - - filter = MeasureFilter.new - filter.set_criteria_value(:base, resource.key) - filter.set_criteria_value(:onBaseComponents, 'true') - filter.set_criteria_value(:display, 'treemap') - filter.set_criteria_value(:tmSize, size_metric.key) if size_metric - filter.set_criteria_value(:tmColor, color_metric.key) if color_metric - filter.execute(self, :user => current_user) - - render :text => filter.display.html - end - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb index e88c8e2b0c7..1aa3c6f5802 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/sonar/columns_view.rb @@ -23,7 +23,6 @@ class Sonar::ColumnsView TYPE_BUILD_TIME = 'BUILD_TIME' TYPE_LINKS = 'LINKS' TYPE_METRIC = 'METRIC' - TYPE_TREE_MAP = 'TREEMAP' TYPE_LANGUAGE = 'LANGUAGE' TYPE_VERSION = 'VERSION' diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb deleted file mode 100644 index 6b3a6c9aaa8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/_display_treemap.html.erb +++ /dev/null @@ -1,73 +0,0 @@ - -<% - treemap_id = widget_id.nil? ? 1 : widget_id - colspan = 1 -%> - - - <% if filter.display.size_metric %> - - <% - colspan += 1 - end %> - <% if filter.display.color_metric %> - - <% - colspan += 1 - end %> - - - - - -
<%= message('size') -%>: <%= filter.display.size_metric.short_name -%> - <%= message('color') -%>: <%= filter.display.color_metric.short_name -%> <%= render :partial => 'treemap/gradient', :locals => {:metric => filter.display.color_metric} %> - - <%= image_tag 'loading-small.gif', :id => "tm-loading-#{treemap_id}", :style => 'display:none' -%> -
- -
- -<% unless defined? widget - content_for :script do %> - - <% end - end %> - -<% if filter.rows.empty? %> -

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

-<% elsif filter.pagination.pages>1 %> -

<%= message('measure_filter.error.TOO_MANY_RESULTS') -%>

-<% else %> -
- <%= filter.display.html -%> -
- -
-
-
/
-
- - - -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb deleted file mode 100644 index c42b6acbf0c..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_gradient.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -<% -if metric && metric.worst_value && metric.best_value && (metric.val_type != Metric::VALUE_TYPE_RATING) - if metric.worst_value - <%= min -%><%= metric.suffix -%> <%= max - -%><%= metric.suffix -%> -<% -end -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap.html.erb deleted file mode 100644 index 52ced24fb64..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -
- <%= treemap.generate_html() -%> -
\ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap_container.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap_container.html.erb deleted file mode 100644 index 575cdcb37a7..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/_treemap_container.html.erb +++ /dev/null @@ -1,36 +0,0 @@ -
- - - - - - -
- <%= message('size') -%> -
- <%= select_tag "size", options_grouped_by_domain(Sonar::Treemap.size_metrics, (size_metric && size_metric.key), :include_empty => true), - :id => "tm-size-#{treemap_id}", :class => 'small medium-width spacer-right', :onchange => "return treemapById(#{treemap_id}).changeSizeMetric(this.value)" - %> -
- <%= message('color') -%> - -
- <%= select_tag 'color', options_grouped_by_domain(Sonar::Treemap.color_metrics, (color_metric && color_metric.key), :include_empty => true), - :id => "tm-color-#{treemap_id}", :class => 'small medium-width', :onchange => "return treemapById(#{treemap_id}).changeColorMetric(this.value)" %> - <%= image_tag 'loading.gif', :id => "tm-loading-#{treemap_id}", :style => 'vertical-align: top;display: none' -%> -
- -
-
- -
-
<%= image_tag 'help.png', :title => h(message('treemap.click_help')) -%>
-
/
-
- - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/index.html.erb deleted file mode 100644 index c901b2e9ee1..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/treemap/index.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<% if @treemap && @treemap.enough_data? %> -
-<%= @treemap.generate_html() %> -
-<% end %> \ No newline at end of file -- 2.39.5