From: Jean-Baptiste Lievremont Date: Thu, 10 Apr 2014 15:48:12 +0000 (+0200) Subject: SONAR-4988 Drop clouds page X-Git-Tag: 4.3~57 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=16e3e24652fbcc70741310fe1ebdb9227bb66053;p=sonarqube.git SONAR-4988 Drop clouds page --- diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb deleted file mode 100644 index e077bfb9763..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/cloud_controller.rb +++ /dev/null @@ -1,70 +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 CloudController < ApplicationController - - SECTION=Navigation::SECTION_RESOURCE - before_filter :init_resource_for_user_role - - def index - @size_metric=Metric.by_key(params[:size]||'ncloc') - @color_metric=Metric.by_key(params[:color]||'coverage') - - if @snapshot.measure(@color_metric).nil? - @color_metric=Metric.by_key('violations_density') - end - - snapshot_conditions='snapshots.islast=:islast AND snapshots.qualifier in (:qualifiers) AND snapshots.qualifier!=:test_qualifier AND - (snapshots.id=:sid OR (snapshots.root_snapshot_id=:root_sid AND snapshots.path LIKE :path))' - snapshot_values={ - :islast => true, - :qualifiers => @snapshot.leaves_qualifiers, - :test_qualifier => 'UTS', - :sid => @snapshot.id, - :root_sid => (@snapshot.root_snapshot_id || @snapshot.id), - :path => "#{@snapshot.path}#{@snapshot.id}.%" - } - - @snapshots=Snapshot.find(:all, :conditions => [snapshot_conditions, snapshot_values], :include => 'project', :order => 'projects.name') - - size_measures=ProjectMeasure.find(:all, - :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', - :joins => :snapshot, - :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@size_metric.id} AND project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL", snapshot_values], - :order => 'project_measures.value') - - color_measures=ProjectMeasure.find(:all, - :select => 'project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.text_value,project_measures.characteristic_id,project_measures.alert_status', - :joins => :snapshot, - :conditions => [snapshot_conditions + " AND project_measures.metric_id=#{@color_metric.id} AND project_measures.rule_id IS NULL AND project_measures.characteristic_id IS NULL AND project_measures.person_id IS NULL", snapshot_values], - :order => 'project_measures.value') - - @size_measure_by_sid={} - @color_measure_by_sid={} - size_measures.each do |m| - @size_measure_by_sid[m.snapshot_id]=m - end - color_measures.each do |m| - @color_measure_by_sid[m.snapshot_id]=m - end - @min_size_value=(size_measures.empty? ? 0.0 : size_measures.first.value) - @max_size_value=(size_measures.empty? ? 0.0 : size_measures.last.value) - end - -end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/cloud_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/cloud_helper.rb deleted file mode 100644 index de7914424ad..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/cloud_helper.rb +++ /dev/null @@ -1,33 +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. -# -module CloudHelper - MIN_SIZE_PERCENT=60.0 - MAX_SIZE_PERCENT=240.0 - - def font_size(value) - divisor=@max_size_value - @min_size_value - size=MIN_SIZE_PERCENT - if divisor!=0.0 - multiplier=(MAX_SIZE_PERCENT - MIN_SIZE_PERCENT)/divisor - size=MIN_SIZE_PERCENT + ((@max_size_value - (@max_size_value-(value - @min_size_value)))*multiplier) - end - size.to_i - end -end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb index 995c3051476..6fec577f475 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/measures_helper.rb @@ -86,19 +86,6 @@ module MeasuresHelper "" end - CLOUD_MIN_SIZE_PERCENT=60.0 - CLOUD_MAX_SIZE_PERCENT=240.0 - - def cloud_font_size(value, min_size_value, max_size_value) - divisor=max_size_value - min_size_value - size=CLOUD_MIN_SIZE_PERCENT - if divisor!=0.0 - multiplier=(CLOUD_MAX_SIZE_PERCENT - CLOUD_MIN_SIZE_PERCENT)/divisor - size=CLOUD_MIN_SIZE_PERCENT + ((max_size_value - (max_size_value-(value - min_size_value)))*multiplier) - end - size.to_i - end - def period_labels [Api::Utils.period_label(1), Api::Utils.period_label(2), Api::Utils.period_label(3)] end diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/cloud/index.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/cloud/index.html.erb deleted file mode 100644 index 2d3f7718562..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/cloud/index.html.erb +++ /dev/null @@ -1,75 +0,0 @@ - - - -
-
-
    -
  • - <%= message('color') -%>: - - -
  • -
  • -
  • - onclick="document.forms['cloudform'].submit()" id="radio-quick"> - -   - onclick="document.forms['cloudform'].submit()" id="radio-top"> - -
  • -
-
-
- -
- <% - color_options={ - :check_alert_status => false, - :min_color => Color::RGB.from_html("EE0000"), # red - :mean_color => Color::RGB.from_html("4D05B1"), # purple - :max_color => Color::RGB.from_html("2360BF") # blue - } - @snapshots.each do |s| - size_measure=@size_measure_by_sid[s.id] - if size_measure && size_measure.value - color_measure=@color_measure_by_sid[s.id] - if s.source_code? - link="of(#{s.project_id})" - else - link="ov(#{s.project_id})" - end - - title="#{s.resource.long_name} | #{@size_metric.short_name}: #{size_measure.formatted_value}" - if color_measure && color_measure.value - title += " | #{@color_metric.short_name}: #{color_measure.formatted_value}" - end - %> - <%= h s.resource.name %> - <% end - end %> -
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 ecec918cc28..92f6894cdeb 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 @@ -105,9 +105,6 @@ <%= h message(page.getId() + '.page', :default => page.getTitle()) -%> <% end %> -
  • - <%= message('clouds.page') -%> -
  • <% if controller.java_facade.getResourceTypeBooleanProperty(@project.qualifier, 'comparable') %>
  • <%= message('comparison.page') -%> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_cloud.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_cloud.html.erb deleted file mode 100644 index 30303f54ac5..00000000000 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/measures/_display_cloud.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -
    - <% - color_options={ - :check_alert_status => false, - :min_color => Color::RGB.from_html("EE0000"), # red - :mean_color => Color::RGB.from_html("4D05B1"), # purple - :max_color => Color::RGB.from_html("2360BF") # blue - } - size_measure_values = filter.rows.map do |row| - size_measure = row.measure(filter.display.size_metric) - size_measure.value if size_measure - end.compact - - min_size_value=(size_measure_values.empty? ? 0.0 : size_measure_values.min) - max_size_value=(size_measure_values.empty? ? 0.0 : size_measure_values.max) - - filter.rows.each do |row| - size_measure=row.measure(filter.display.size_metric) - if size_measure && size_measure.value - color_measure=row.measure(filter.display.color_metric) - - title="#{row.snapshot.resource.long_name} | #{filter.display.size_metric.short_name}: #{size_measure.formatted_value}" - if color_measure && color_measure.value - title += " | #{filter.display.color_metric.short_name}: #{color_measure.formatted_value}" - end - %> - - <%= h row.snapshot.resource.name %> - <% end - end %> -