From: Stas Vilchik Date: Tue, 26 May 2015 13:27:53 +0000 (+0200) Subject: SONAR-6553 drop dependencies page X-Git-Tag: 5.2-RC1~1843 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff31991df9551ffeaff35d5808406acf01f5d93e;p=sonarqube.git SONAR-6553 drop dependencies page --- diff --git a/server/sonar-web/src/main/js/apps/nav/search-view.js b/server/sonar-web/src/main/js/apps/nav/search-view.js index 57daa695031..09c7468851e 100644 --- a/server/sonar-web/src/main/js/apps/nav/search-view.js +++ b/server/sonar-web/src/main/js/apps/nav/search-view.js @@ -206,8 +206,7 @@ define([ { name: t('coding_rules.page'), url: baseUrl + '/coding_rules' }, { name: t('quality_profiles.page'), url: baseUrl + '/profiles' }, { name: t('quality_gates.page'), url: baseUrl + '/quality_gates' }, - { name: t('comparison_global.page'), url: baseUrl + '/comparison' }, - { name: t('dependencies.page'), url: baseUrl + '/dependencies' } + { name: t('comparison_global.page'), url: baseUrl + '/comparison' } ], customItems = []; if (window.SS.isUserAdmin) { diff --git a/server/sonar-web/src/main/js/apps/nav/templates/nav-global-navbar.hbs b/server/sonar-web/src/main/js/apps/nav/templates/nav-global-navbar.hbs index 11284eee4a9..8be3a11faa0 100644 --- a/server/sonar-web/src/main/js/apps/nav/templates/nav-global-navbar.hbs +++ b/server/sonar-web/src/main/js/apps/nav/templates/nav-global-navbar.hbs @@ -55,9 +55,6 @@
  • {{t 'comparison_global.page'}}
  • -
  • - {{t 'dependencies.page'}} -
  • {{#each globalPages}}
  • {{name}} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb deleted file mode 100644 index 16de4c40c8b..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb +++ /dev/null @@ -1,105 +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 DependenciesController < ApplicationController - - SECTION=Navigation::SECTION_HOME - - SEARCH_MINIMUM_SIZE=3 - QUALIFIERS=['TRK', 'BRC', 'LIB'] - - def index - @search=params[:search] || '' - @version=params[:version] - @resources=nil - @resource=nil - @versions=nil - - if @search.size>0 && @search.size 'index' - return - end - - if @search.size>=SEARCH_MINIMUM_SIZE - - # - # load all the resources (first column) - # - @resources=Project.find(:all, - :conditions => ["scope=? AND qualifier IN (?) AND enabled=? AND (UPPER(name) like ? OR kee like ?)", 'PRJ', QUALIFIERS, true, "%#{@search.upcase}%", "%#{@search}%"]) - @resources = select_authorized(:user, @resources) - - Api::Utils.insensitive_sort!(@resources){|r| r.name} - - if params[:resource] - @resource=@resources.select{|r| r.kee==params[:resource]}.first - elsif @resources.size==1 - @resource=@resources.first - end - - end - - if @resource - - # - # load all the snapshots and versions of the selected resource (second column) - # - snapshots=Snapshot.find(:all, :select => 'id,version', :conditions => ['project_id=? AND version IS NOT NULL AND status=?', @resource.id, 'P']) - @versions=snapshots.map{|s| s.version}.compact.uniq.sort.reverse - @version=@versions.first if @version.blank? && @versions.size==1 - - - # - # load all the dependencies to the selected resource - # - conditions=["dependencies.from_scope='PRJ' AND snapshots.status='P' AND snapshots.project_id=:rid"] - values={:rid => @resource.id} - if !@version.blank? - conditions<<'snapshots.version=:version' - values[:version]=@version - else - conditions<<'snapshots.version IS NOT NULL' - end - deps=Dependency.find(:all, - :include => 'to_snapshot', - :select => 'dependencies.project_snapshot_id', - :conditions => [conditions.join(' AND '), values]) - - - - # - # load all the projects defining the dependencies (third column) - # - @project_snapshots=[] - snapshot_ids = deps.map{|dep| dep.project_snapshot_id} - if snapshot_ids.size>0 - snapshot_ids.each_slice(999) do |safe_for_oracle_ids| - @project_snapshots.concat(Snapshot.all(:include => 'project', :conditions => ['id IN (?) AND islast=? AND status=?', safe_for_oracle_ids, true, 'P'])) - end - @project_snapshots = select_authorized(:user, @project_snapshots) - Api::Utils.insensitive_sort!(@project_snapshots) {|s| s.project.name} - end - - end - - end - - -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb deleted file mode 100644 index 2e12529cf3a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb +++ /dev/null @@ -1,109 +0,0 @@ -<% content_for :style do %> - -<% end %> -
    - - -
    - -
    -

    <%= message('dependencies.search_help') -%>

    -
    - -
    - <% if @resources %> -
    -

    <%= message('dependencies.select_library') -%> :

    -
    - - - <% if @resources.empty? %> - - <% end %> - <% @resources.each do |resource|%> - - - - <% end %> - -
    <%= message('no_data') -%>
    <%= qualifier_icon(resource) %> <%= h resource.name(true) -%>
    <%= h resource.kee -%>
    -
    -
    - <% end %> - - <% if @versions %> -
    -

    <%= message('dependencies.select_version') -%> :

    -
    - - - <% if @versions.size>1 %> - - - - <% end %> - <% @versions.each do |version|%> - - - - <% end %> - -
    All
    <%= version -%>
    -
    -
    - <% end %> - - <% if @project_snapshots %> -
    -

    <%= message('dependencies.used_by') -%> :

    -
    - - - <% if @project_snapshots.empty? %> - - <% end %> - <% @project_snapshots.each do |project_snapshot|%> - - - - <% end %> - -
    <%= message('dependencies.not_used') -%>
    - <%= qualifier_icon(project_snapshot.project) %> <%= link_to h(project_snapshot.project.name(true)), "#{ApplicationController.root_context}/libraries/index/#{project_snapshot.project_id}" -%>
    - <%= h project_snapshot.project.kee -%>
    -
    -
    - <% end %> -
    -
    -