aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-05-26 15:27:53 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-05-26 15:28:01 +0200
commitff31991df9551ffeaff35d5808406acf01f5d93e (patch)
treeda1294300274b6c3a3b0b8c001d8fbaa28da2788 /server
parentf63ea546f656b7150bea668f76a7f367eee97a41 (diff)
downloadsonarqube-ff31991df9551ffeaff35d5808406acf01f5d93e.tar.gz
sonarqube-ff31991df9551ffeaff35d5808406acf01f5d93e.zip
SONAR-6553 drop dependencies page
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/nav/search-view.js3
-rw-r--r--server/sonar-web/src/main/js/apps/nav/templates/nav-global-navbar.hbs3
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dependencies_controller.rb105
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb109
4 files changed, 1 insertions, 219 deletions
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 @@
<li>
<a href="{{link '/comparison'}}">{{t 'comparison_global.page'}}</a>
</li>
- <li>
- <a href="{{link '/dependencies'}}">{{t 'dependencies.page'}}</a>
- </li>
{{#each globalPages}}
<li>
<a href="{{link url}}">{{name}}</a>
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<SEARCH_MINIMUM_SIZE
- flash[:notice]="Minimum search is #{SEARCH_MINIMUM_SIZE} characters."
- redirect_to :action => '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 %>
-<style>
-.drilldown_col {
- float: left;
- margin: 10px 5px 15px 0;
-}
-.drilldown_col div.col {
-max-height: 35em;
-overflow-x: hidden;
-overflow-y: auto;
-border-top: 1px solid #ccc;
-border-bottom: 1px solid #ccc;
-margin-right: 17px; // scrollbar width
-}
-.drilldown_col h3 {
-padding: 5px;
-}
-.drilldown_col div.col table {
-
-}
-.drilldown_col div.col td {
- padding: 3px 7px;
- min-width: 15em;
- white-space: nowrap;
-}
-</style>
-<% end %>
-<div class="page">
- <header class="page-header">
- <h1 class="page-title"><%= h message('dependencies.page') -%></h1>
- </header>
-
- <form action="<%= ApplicationController.root_context -%>/dependencies/index" id="search_form">
- <input type="text" name="search" value="<%= h params[:search] -%>" id="search_input"> </input>
- <input type="submit" value="<%= message('dependencies.search_library') -%>" id="search_submit"/><br/>
- <p class="small gray"><%= message('dependencies.search_help') -%></p>
- </form>
-
- <div id="deps_drilldown">
- <% if @resources %>
- <div id="artifacts_col" class="drilldown_col">
- <h3><%= message('dependencies.select_library') -%> :</h3>
- <div class="col">
- <table>
- <tbody>
- <% if @resources.empty? %>
- <tr class="even"><td><%= message('no_data') -%></td></tr>
- <% end %>
- <% @resources.each do |resource|%>
- <tr class="<%= cycle('even', 'odd', :name => 'lib') -%> <%= 'selected' if resource==@resource -%>">
- <td ><%= qualifier_icon(resource) %> <a href="<%= url_for :action => 'index', :overwrite_params => {:version => nil, :resource => resource.kee} -%>"><%= h resource.name(true) -%></a><br/><span class="small gray"><%= h resource.kee -%></span></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
- <% end %>
-
- <% if @versions %>
- <div id="versions_col" class="drilldown_col">
- <h3><%= message('dependencies.select_version') -%> :</h3>
- <div class="col">
- <table>
- <tbody>
- <% if @versions.size>1 %>
- <tr class="<%= cycle('even', 'odd', :name => 'version') -%> <%= 'selected' if @version.blank? -%>">
- <td><a href="<%= url_for :action => 'index', :overwrite_params => {:version => nil, :resource => @resource.kee} -%>">All</a></td>
- </tr>
- <% end %>
- <% @versions.each do |version|%>
- <tr class="<%= cycle('even', 'odd', :name => 'version') -%> <%= 'selected' if version==@version-%>">
- <td><a href="<%= url_for :action => 'index', :overwrite_params => {:version => version, :resource => @resource.kee} -%>"><%= version -%></a></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
- <% end %>
-
- <% if @project_snapshots %>
- <div id="results_col" class="drilldown_col">
- <h3><%= message('dependencies.used_by') -%> :</h3>
- <div class="col">
- <table>
- <tbody>
- <% if @project_snapshots.empty? %>
- <tr class="even"><td><%= message('dependencies.not_used') -%></td></tr>
- <% end %>
- <% @project_snapshots.each do |project_snapshot|%>
- <tr class="<%= cycle('even', 'odd', :name => 'dep') -%>">
- <td>
- <%= qualifier_icon(project_snapshot.project) %> <%= link_to h(project_snapshot.project.name(true)), "#{ApplicationController.root_context}/libraries/index/#{project_snapshot.project_id}" -%><br/>
- <span class="small gray"><%= h project_snapshot.project.kee -%></span></td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- </div>
- <% end %>
- </div>
-</div>
-<script>
-$j('#artifacts_col tr.selected').each(function(index,item) {item.scrollIntoView(true);});
-$j('#versions_col tr.selected').each(function(index,item) {item.scrollIntoView(true);});
-$j('#results_col tr.selected').each(function(index,item) {item.scrollIntoView(true);});
-</script>