diff --git a/it/it-tests/src/test/resources/updatecenter/installed-plugins.html b/it/it-tests/src/test/resources/updatecenter/installed-plugins.html index e691f40e3dd..552d627d1b8 100644 --- a/it/it-tests/src/test/resources/updatecenter/installed-plugins.html +++ b/it/it-tests/src/test/resources/updatecenter/installed-plugins.html @@ -2,53 +2,53 @@ - - installed-plugins + + installed-plugins - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
open/sonar/updatecenter
assertTextcontent*Installed Plugins*
assertTextuser-plugins*Plugins :: Fake*1.0-SNAPSHOT*
open/sonar/sessions/logout
open/sonar/settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
open/sonar/updatecenter
waitForTextcontent*Fake*
assertTextid=update-center-plugins*Fake*1.0-SNAPSHOT*
diff --git a/server/sonar-web/src/main/js/apps/nav/templates/nav-settings-navbar.hbs b/server/sonar-web/src/main/js/apps/nav/templates/nav-settings-navbar.hbs index caa9d3dd977..750d44830be 100644 --- a/server/sonar-web/src/main/js/apps/nav/templates/nav-settings-navbar.hbs +++ b/server/sonar-web/src/main/js/apps/nav/templates/nav-settings-navbar.hbs @@ -82,9 +82,5 @@ - -
  • - New Update Center -
  • diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb index a5d86ea82f6..95474e6a80f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_controller.rb @@ -21,132 +21,24 @@ class UpdatecenterController < ApplicationController SECTION=Navigation::SECTION_CONFIGURATION before_filter :admin_required - before_filter :updatecenter_activated - - verify :method => :post, :only => [:cancel, :install], :redirect_to => {:action => :index} def index - @uninstalls=java_facade.getPluginUninstalls() - @downloads=java_facade.getPluginDownloads() - load_plugin_center - @plugins = installed_plugins end - def available - @uninstalls=java_facade.getPluginUninstalls() - @downloads=java_facade.getPluginDownloads() - @update_plugin_center=nil - @updates_by_category={} - - load_plugin_center() - if @update_plugin_center - @update_plugin_center.findAvailablePlugins().each do |update| - already_download = update.plugin.releases.find {|release| @downloads.include? release.filename } - if !already_download - category = update.plugin.category||'' - @updates_by_category[category]||=[] - @updates_by_category[category]< 'index' end def updates - @uninstalls=java_facade.getPluginUninstalls() - @downloads=java_facade.getPluginDownloads() - - @update_plugin_center=nil - @updates_by_plugin={} - @installed_plugins={} - @last_compatible={} - - load_plugin_center() - if @update_plugin_center - @sonar_version = org.sonar.server.platform.Platform.getServer().getVersion() - - installed_plugins.each do |plugin| - @installed_plugins[plugin.getKey()]=plugin.lastRelease.getVersion() - end - - @update_plugin_center.findPluginUpdates().each do |update| - plugin = update.plugin - already_download = update.plugin.releases.find {|release| @downloads.include? release.filename } - if !already_download - @updates_by_plugin[plugin]||=[] - @updates_by_plugin[plugin]< 'index' end - def cancel_downloads - java_facade.cancelPluginDownloads() - flash[:notice]="Pending plugin installations are canceled." - redirect_to :action => 'index' + def available + render :action => 'index' end - def install - key=params[:key] - version=params[:version] - if key && version - begin - java_facade.downloadPlugin(key, version) - rescue Exception => e - flash[:error]=e.message - end - end - redirect_to :action => (params[:from] || 'index') - end - - def uninstall - key=params[:key] - if key - begin - java_facade.uninstallPlugin(key) - rescue Exception => e - flash[:error]=e.message - end - end - redirect_to :action => (params[:from] || 'index') - end - - def cancel_uninstalls - java_facade.cancelPluginUninstalls() - flash[:notice]="Pending plugin uninstalls are canceled." - redirect_to :action => 'index' - end - - def system_updates - @uninstalls=java_facade.getPluginUninstalls() - @downloads=java_facade.getPluginDownloads() - - @update_plugin_center=nil - @sonar_updates=[] - load_plugin_center() - if @update_plugin_center - @sonar_updates=@update_plugin_center.findSonarUpdates() - end - end - - private - - def load_plugin_center - @update_plugin_center = java_facade.getUpdatePluginCenter(params[:reload]=='true') - @installed_plugin_referential = java_facade.installedPluginReferential - end - - def updatecenter_activated - update_center_activated = java_facade.getSettings().getBoolean('sonar.updatecenter.activate') - unless update_center_activated - redirect_to home_url - end - end - - def installed_plugins - @installed_plugin_referential.lastMasterReleasePlugins + def system + render :action => 'index' end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_new_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_new_controller.rb deleted file mode 100644 index 14185ad966a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/updatecenter_new_controller.rb +++ /dev/null @@ -1,44 +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 UpdatecenterNewController < ApplicationController - - SECTION=Navigation::SECTION_CONFIGURATION - before_filter :admin_required - - def index - - end - - def installed - render :action => 'index' - end - - def updates - render :action => 'index' - end - - def available - render :action => 'index' - end - - def system - render :action => 'index' - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_operations.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_operations.html.erb deleted file mode 100644 index fe786c620ef..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_operations.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - - -<% if @uninstalls.size > 0 %> -
    -

    SonarQube needs to be restarted in order to uninstall the following plugins:

    -
      - <% @uninstalls.each do |uninstall| %> -
    • <%= uninstall -%>
    • - <% end %> -
    - -
    -<% end %> - -<% if @downloads.size > 0 %> -
    -

    SonarQube needs to be restarted in order to install the following plugins: -

      - <% @downloads.each do |download| %> -
    • <%= download -%>
    • - <% end %> -
    - -

    -
    -<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb deleted file mode 100644 index 74de7615e23..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_status.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% if @update_plugin_center.nil? %> -

    Not connected to update center. Please check your internet connection and logs.

    -<% else %> -

    - Updated on <%= @update_plugin_center.getDate() -%>. <%= link_to 'Refresh', :action => action, :reload => true %> -

    -<% end %> \ No newline at end of file diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_tabs.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_tabs.html.erb deleted file mode 100644 index 11c148d741f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/_tabs.html.erb +++ /dev/null @@ -1,14 +0,0 @@ - diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb deleted file mode 100644 index 3ffd2be1205..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/available.html.erb +++ /dev/null @@ -1,132 +0,0 @@ - - -
    - - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'available'} -%> -
    - - <%= render :partial => 'updatecenter/operations' -%> - - <% if @update_plugin_center %> - <% @updates_by_category.keys.sort_by { |c| c.downcase }.each do |category| - updates=@updates_by_category[category] - %> - - - - - - - - <% updates.sort_by { |update| update.plugin.key }.each do |update| - plugin = update.plugin - release = update.release - %> - - - - - <% end %> - -

    <%= category -%>

    - <%= h(plugin.getName()) -%> - - <%= plugin.getDescription() %> - -
    -
    - <% end %> - <% end %> - - <%= render :partial => 'updatecenter/status', :locals => {:action => 'available'} %> -
    -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb index aaf243c8278..80cb9c67be0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/index.html.erb @@ -1,106 +1,7 @@ -
    - - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'index'} -%> - -
    - - <%= render :partial => 'updatecenter/operations' -%> - - - - - - - - - - - - - - <% if @plugins.empty? %> - - - - <% else - @plugins.each do |plugin| - release = plugin.lastRelease - %> - - - - - - <% end %> - <% end %> - -

    Plugins

    PluginVersionDescription
    No plugins
    - <%= h(plugin.getName()) -%> - [<%= h plugin.getKey() -%>]<%= release.getVersion() || '-' -%> - <%= plugin.getDescription() -%> - -
    - -
    -
    +<% content_for :extra_script do %> + +<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/system_updates.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/system_updates.html.erb deleted file mode 100644 index 43b06d2723f..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/system_updates.html.erb +++ /dev/null @@ -1,119 +0,0 @@ - - - -
    - - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'system_updates'} -%> - -
    - - <%= render :partial => 'updatecenter/operations' -%> - - <% if @update_plugin_center %> - <% if @sonar_updates.empty? %> - - - - - - - - - - - -
    System is up to date.
    - <% else %> - - <% @sonar_updates.to_a.reverse.each do |update| - release=update.getRelease() - %> - - - - - - - - - - - -

    SonarQube <%= release.getVersion() -%>

    - - - - - - - - - - - - - - - - - - -
    Date: <%= release_date(release.getDate()) if release.getDate() -%>
    - <%= link_to_if release.getChangelogUrl(), 'Release Notes', release.getChangelogUrl(), :class => 'external' %> - : <%= release.getDescription() -%>
    How to upgrade: - <% if update.hasWarnings() %> - Follow those steps to upgrade SonarQube from version <%= sonar_version -%> to - version <%= release.getVersion() -%> : -
      -
    1. Stop SonarQube
    2. -
    3. <%= link_to 'Download', release.getDownloadUrl(), :class => 'external' -%> and install - SonarQube <%= release.getVersion() -%> after having carefully read the - upgrade guide. -
    4. - <% update.getIncompatiblePlugins().each do |incompatible_plugin| %> -
    5. - Uninstall the plugin <%= incompatible_plugin.getName() -%> which is not compatible with - SonarQube <%= release.getVersion() -%>. - -
    6. - <% end %> - <% update.getPluginsToUpgrade().each do |plugin_to_upgrade| %> -
    7. - Replace current version of plugin <%= plugin_to_upgrade.getArtifact().getName() -%> by - version <%= plugin_to_upgrade.getVersion() -%> - -
    8. - <% end %> -
    9. Start SonarQube
    10. -
    - - <% else %> - <%= link_to 'Download', release.getDownloadUrl(), :class => 'external' -%> and install - SonarQube <%= release.getVersion() -%> after having carefully read the - upgrade guide. - <% end %> -
    -
    -
    - <% end - end - end %> - - <%= render :partial => 'updatecenter/status', :locals => {:action => 'system_updates'} %> -
    -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb deleted file mode 100644 index 97f7dabd0c8..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter/updates.html.erb +++ /dev/null @@ -1,103 +0,0 @@ - - -
    - - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'updates'} -%> - -
    - - <%= render :partial => 'updatecenter/operations' -%> - - <% if @update_plugin_center %> - - - - - - - - <% if @updates_by_plugin.empty? %> - - - - <% end %> - <% @updates_by_plugin.keys.each do |plugin| - css=cycle('even', 'odd', :name => 'user-plugins') - updates=@updates_by_plugin[plugin] - updates.each_with_index do |update, index| - release=update.release - %> - - - - - - - - - <% - end - %> - - <% if @last_compatible[plugin.getKey()] %> - <% - version = @last_compatible[plugin.getKey()] - dependencies = @updates_by_plugin[plugin].last.dependencies.select { |dependency| dependency.master } - dependencies.each_with_index do |dependency, index| %> - - - - <% if index == 0 %> - - <% else %> - - <% end %> - - - <% end %> - - - - - - <% end %> - - <% - end - %> - -

    Plugins

    All of your plugins are up to date.
    - <% if index==0 %><%= h(plugin.getName()) -%> <%= @installed_plugins[plugin.getKey()] -%> -> - <% end %><%= release.getVersion() -%><%= release_date(release.getDate()) if release.getDate() -%><%= release.getDescription() -%><%= link_to 'Release Notes', release.getChangelogUrl(), :class => 'external' if release.getChangelogUrl() %> - <% if update.isIncompatible() %> - <%= image_tag 'warning.png' -%> Incompatible - <% elsif update.requiresSonarUpgrade %> - <%= image_tag 'warning.png' -%> <%= h(plugin.getName()) -%> <%= release.getVersion() -%> is not compatible with SonarQube <%= @sonar_version -%>. - You need to upgrade to SonarQube <%= release.getMinimumRequiredSonarVersion() -%> to perform the plugin upgrade. - <% elsif update.requiresSonarUpgradeForDependencies %> - <%= image_tag 'warning.png' -%> Incompatible, some dependencies requires SonarQube upgrade - <% end %> -
    Updating this plugin will also update:  - <%= dependency.artifact.name -%> : <%= dependency.artifact.description -%> -
    -
    - -
    -
    - - <% end %> - <%= render :partial => 'updatecenter/status', :locals => {:action => 'updates'} %> -
    -
    diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter_new/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter_new/index.html.erb deleted file mode 100644 index eab9021d51a..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/updatecenter_new/index.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -<% content_for :extra_script do %> - -<% end %>