diff options
12 files changed, 58 insertions, 730 deletions
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 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://selenium-ide.openqa.org/profiles/test-case"> - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> - <title>installed-plugins</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <title>installed-plugins</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> - <tbody> - <tr> - <td>open</td> - <td>/sonar/sessions/logout</td> - <td></td> - </tr> - <tr> - <td>open</td> - <td>/sonar/settings</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>id=login</td> - <td>admin</td> - </tr> - <tr> - <td>type</td> - <td>id=password</td> - <td>admin</td> - </tr> - <tr> - <td>clickAndWait</td> - <td>name=commit</td> - <td></td> - </tr> - <tr> - <td>open</td> - <td>/sonar/updatecenter</td> - <td></td> - </tr> - <tr> - <td>assertText</td> - <td>content</td> - <td>*Installed Plugins*</td> - </tr> - <tr> - <td>assertText</td> - <td>user-plugins</td> - <td>*Plugins :: Fake*1.0-SNAPSHOT*</td> - </tr> - </tbody> + <tbody> + <tr> + <td>open</td> + <td>/sonar/sessions/logout</td> + <td></td> + </tr> + <tr> + <td>open</td> + <td>/sonar/settings</td> + <td></td> + </tr> + <tr> + <td>type</td> + <td>id=login</td> + <td>admin</td> + </tr> + <tr> + <td>type</td> + <td>id=password</td> + <td>admin</td> + </tr> + <tr> + <td>clickAndWait</td> + <td>name=commit</td> + <td></td> + </tr> + <tr> + <td>open</td> + <td>/sonar/updatecenter</td> + <td></td> + </tr> + <tr> + <td>waitForText</td> + <td>content</td> + <td>*Fake*</td> + </tr> + <tr> + <td>assertText</td> + <td>id=update-center-plugins</td> + <td>*Fake*1.0-SNAPSHOT*</td> + </tr> + </tbody> </table> </body> </html> 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 @@ </li> </ul> </li> - - <li {{#isActiveLink '/updatecenter_new'}}class="active"{{/isActiveLink}}> - <a href="{{link '/updatecenter_new'}}"><span class="text-info">New</span> Update Center</a> - </li> </ul> </div> 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]<<update - end - end - end + def installed + render :action => '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]<<update - if update.isCompatible - @last_compatible[plugin.key]=update.release.version - end - end - end - end - end - - def cancel_downloads - java_facade.cancelPluginDownloads() - flash[:notice]="Pending plugin installations are canceled." - redirect_to :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') + render :action => '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 + def available + render :action => 'index' 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 @@ -<script type="text/javascript"> - function showPlugin (key) { - if ($j('#detail-' + key).is(':visible')) { - $j('#detail-' + key).hide(); - } else { - $j('#detail-' + key).show(); - } - return false; - } -</script> - -<% if @uninstalls.size > 0 %> - <form action="<%= ApplicationController.root_context -%>/updatecenter/cancel_uninstalls" method="post" class="warning"> - <p>SonarQube needs to be restarted in order to uninstall the following plugins:</p> - <ul class="list-styled spacer-top spacer-bottom"> - <% @uninstalls.each do |uninstall| %> - <li><%= uninstall -%></li> - <% end %> - </ul> - <input type="submit" value="Cancel uninstalls" id="cancel-uninstall"/> - </form> -<% end %> - -<% if @downloads.size > 0 %> - <form action="<%= ApplicationController.root_context -%>/updatecenter/cancel_downloads" method="post" class="warning"> - <p>SonarQube needs to be restarted in order to install the following plugins: - <ul> - <% @downloads.each do |download| %> - <li><%= download -%></li> - <% end %> - </ul> - <input type="submit" value="Cancel pending installations" id="cancel-pending-installations"/> - </p> - </form> -<% 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? %> - <p class="error">Not connected to update center. Please check your internet connection and logs.</p> -<% else %> - <p class="notes"> - Updated on <%= @update_plugin_center.getDate() -%>. <%= link_to 'Refresh', :action => action, :reload => true %> - </p> -<% 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 @@ -<ul class="tabs"> - <li> - <a href="<%= url_for :action => 'index' -%>" class="<%= 'selected' if tab=='index' -%>">Installed Plugins</a> - </li> - <li> - <a href="<%= url_for :action => 'available' -%>" class="<%= 'selected' if tab=='available' -%>">Available Plugins</a> - </li> - <li> - <a href="<%= url_for :action => 'updates' -%>" class="<%= 'selected' if tab=='updates' -%>">Plugin Updates</a> - </li> - <li> - <a href="<%= url_for :action => 'system_updates' -%>" class="<%= 'selected' if tab=='system_updates' -%>">System Updates</a> - </li> -</ul> 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 @@ -<script> - function installPlugin (key) { - /* check terms & conditions */ - var tc = $j('#tc-' + key); - if (tc.length != 0 && !tc.prop('checked')) { - alert('Please accept the Terms and Conditions'); - return false; - } - $j('#install-form-' + key).submit(); - - var button = $j('#submit-' + key); - button.prop('disabled', 'true'); - button.attr('value', 'Installing'); - return false; - } -</script> - -<div class="page"> - <header class="page-header"> - <h1 class="page-title"><%= message('update_center.page') -%></h1> - <p class="page-description"><%= message('update_center.page.description') -%></p> - </header> - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'available'} -%> - <div class="tabs-panel"> - - <%= 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] - %> - <table class="data width100"> - <thead> - <tr> - <th colspan="2"><h2><%= category -%></h2></th> - </tr> - </thead> - <tbody> - <% updates.sort_by { |update| update.plugin.key }.each do |update| - plugin = update.plugin - release = update.release - %> - <tr class="<%= cycle('even', 'odd', :name => category) -%>" id="select-<%= plugin.getKey() -%>"> - <td width="150" nowrap> - <b><a href="#plugin" onClick="showPlugin('<%= plugin.getKey() -%>');"><%= h(plugin.getName()) -%></a></b> - </td> - <td> - <%= plugin.getDescription() %> - <div id="detail-<%= plugin.getKey() -%>" style="display:none"> - <table class="spaced width100"> - - <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %> - <tr> - <% if index == 0 %> - <td class="thin nowrap"><b>Installing this plugin will also install:</b></td> - <% else %> - <td> </td> - <% end %> - <td><span><%= outgoing_release.artifact.name -%></span> : - <span><%= outgoing_release.artifact.description -%></span></td> - </tr> - <% end %> - - <% if plugin.getLicense() %> - <tr> - <td class="thin nowrap"><b>License:</b></td> - <td><%= h(plugin.getLicense()) %></td> - </tr> - <% end %> - <% if plugin.getOrganization() %> - <tr> - <td class="thin nowrap"><b>Author:</b></td> - <td><%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class => 'external' %></td> - </tr> - <% end %> - <% if !plugin.getHomepageUrl().blank? || !plugin.getIssueTrackerUrl().blank? %> - <tr> - <td class="thin nowrap"><b>Links:</b></td> - <td> - <%= link_to 'Homepage', plugin.getHomepageUrl(), :class => 'external' unless plugin.getHomepageUrl().blank? -%> - <%= link_to 'Issue Tracker', plugin.getIssueTrackerUrl(), :class => 'external' unless plugin.getIssueTrackerUrl().blank? -%> - </td> - </tr> - <% end %> - <% - if update.isCompatible() - %> - <tr> - <% date=release_date(update.getRelease().getDate()) %> - <td class="thin nowrap"><b>Version:</b></td> - <td><%= update.getRelease().getVersion() -%> <%= "(#{date})" if date -%></td> - </tr> - <tr> - <td colspan="2"> - <% if plugin.getTermsConditionsUrl() %> - <input type="checkbox" id="tc-<%= plugin.getKey() -%>"/> I accept the <%= link_to 'Terms and Conditions', plugin.getTermsConditionsUrl(), :class => 'external' %> - <% end %> - <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=available&key=<%= plugin.getKey() -%>&version=<%= update.getRelease().getVersion() -%>" style="display: inline-block" id="install-form-<%= plugin.getKey() -%>"> - <input type="submit" value="Install" onClick="installPlugin('<%= plugin.getKey() -%>');return false;" id="submit-<%= plugin.getKey() -%>"/> - </form> - </td> - </tr> - <% elsif update.requiresSonarUpgrade - %> - <tr> - <td class="thin nowrap"><b>Last version:</b></td> - <td><%= update.getRelease().getVersion() -%> (<%= image_tag 'warning.png' -%> Not compatible, requires SonarQube upgrade)</td> - </tr> - <% elsif update.requiresSonarUpgradeForDependencies - %> - <tr> - <td class="thin nowrap"><b>Last version:</b></td> - <td><%= update.getRelease().getVersion() -%> (<%= image_tag 'warning.png' -%> Not compatible, some dependencies requires SonarQube upgrade)</td> - </tr> - <% - end - %> - </table> - </div> - </td> - </tr> - <% end %> - </tbody> - </table> - <div class="break30"></div> - <% end %> - <% end %> - - <%= render :partial => 'updatecenter/status', :locals => {:action => 'available'} %> - </div> -</div> 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 @@ -<div class="page"> - <header class="page-header"> - <h1 class="page-title"><%= message('update_center.page') -%></h1> - <p class="page-description"><%= message('update_center.page.description') -%></p> - </header> - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'index'} -%> - - <div class="tabs-panel"> - - <%= render :partial => 'updatecenter/operations' -%> - - <table class="data width100" id="user-plugins"> - <thead> - <tr> - <th colspan="3"><h2>Plugins</h2></th> - </tr> - <tr> - <th>Plugin</th> - <th>Version</th> - <th>Description</th> - </tr> - </thead> - <tbody> - <% if @plugins.empty? %> - <tr class="even"> - <td colspan="5">No plugins</td> - </tr> - <% else - @plugins.each do |plugin| - release = plugin.lastRelease - %> - <tr class="select <%= cycle('even', 'odd', :name => 'user') -%>" id="select_<%= plugin.getKey() -%>"> - <td width="1%" class="nowrap"> - <b><a href="#plugin" onclick="showPlugin('<%= plugin.getKey() -%>')"><%= h(plugin.getName()) -%></a></b> - <span class="note">[<%= h plugin.getKey() -%>]</span></td> - <td class="nowrap"><%= release.getVersion() || '-' -%></td> - <td> - <%= plugin.getDescription() -%> - <div id="detail-<%= plugin.getKey() -%>" style="display:none"> - - <table class="spaced width100"> - - <% release.outgoingDependencies.each_with_index do |outgoing_release, index| %> - <tr> - <% if index == 0 %> - <td class="thin nowrap"><b>Depends upon:</b></td> - <% else %> - <td> </td> - <% end %> - <td><span><%= outgoing_release.artifact.name -%></span> : - <span><%= outgoing_release.artifact.description -%></span></td> - </tr> - <% end %> - - <% release.incomingDependencies.each_with_index do |incoming_release, index| %> - <tr> - <% if index == 0 %> - <td class="thin nowrap"><b>Uninstalling this plugin will also uninstall:</b></td> - <% else %> - <td> </td> - <% end %> - <td><span><%= incoming_release.artifact.name -%></span> : - <span><%= incoming_release.artifact.description -%></span></td> - </tr> - <% end %> - - <% if plugin.getLicense() %> - <tr> - <td class="thin nowrap"><b>License:</b></td> - <td><%= plugin.getLicense() -%></td> - </tr> - <% end %> - <% if plugin.getOrganization() %> - <tr> - <td class="thin nowrap"><b>Author:</b></td> - <td><%= link_to_if plugin.getOrganizationUrl(), plugin.getOrganization(), plugin.getOrganizationUrl(), :class => 'external' -%></td> - </tr> - <% end %> - <% if !plugin.getHomepageUrl().blank? || !plugin.getIssueTrackerUrl().blank? %> - <tr> - <td class="thin nowrap"><b>Links:</b></td> - <td> - <%= link_to 'Homepage', plugin.getHomepageUrl(), :class => 'external' unless plugin.getHomepageUrl().blank? -%> - <%= link_to 'Issue Tracker', plugin.getIssueTrackerUrl(), :class => 'external' unless plugin.getIssueTrackerUrl().blank? -%> - </td> - </tr> - <% end %> - <tr> - <td colspan="2"> - <form method="post" action="<%= ApplicationController.root_context -%>/updatecenter/uninstall?key=<%= plugin.getKey() -%>" style="display: inline-block"> - <input type="submit" value="Uninstall" class="red-button" id="uninstall-<%= plugin.getKey() -%>"/> - </form> - </td> - </tr> - </table> - </div> - </td> - </tr> - <% end %> - <% end %> - </tbody> - </table> - - </div> -</div> +<% content_for :extra_script do %> + <script> + require(['apps/update-center/app'], function (App) { + App.start({ el: '#content', urlRoot: baseUrl + '/updatecenter' }); + }); + </script> +<% 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 @@ -<style> - ol.bulletpoints li { - list-style-type: decimal; - list-style-position: inside; - } -</style> -<script> - function submitForm (elt) { - elt.submit(); - elt.disable(); - return false; - } -</script> - -<div class="page"> - <header class="page-header"> - <h1 class="page-title"><%= message('update_center.page') -%></h1> - <p class="page-description"><%= message('update_center.page.description') -%></p> - </header> - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'system_updates'} -%> - - <div class="tabs-panel"> - - <%= render :partial => 'updatecenter/operations' -%> - - <% if @update_plugin_center %> - <% if @sonar_updates.empty? %> - <table class="data width100 marginbottom10"> - <thead> - <tr> - <td></td> - </tr> - </thead> - <tbody> - <tr class="even"> - <td>System is up to date.</td> - </tr> - </tbody> - </table> - <% else %> - - <% @sonar_updates.to_a.reverse.each do |update| - release=update.getRelease() - %> - <table class="data width100" id="sonar-<%= release.getVersion() -%>"> - <thead> - <tr> - <th><h2>SonarQube <%= release.getVersion() -%></h2></th> - </tr> - </thead> - <tbody> - <tr class="even"> - <td> - <table class="width100 spaced"> - <tbody style="vertical-align: top"> - <tr> - <td class="thin nowrap"><b>Date: </b></td> - <td class="sep"></td> - <td><%= release_date(release.getDate()) if release.getDate() -%></td> - </tr> - <tr> - <td class="thin nowrap"> - <b><%= link_to_if release.getChangelogUrl(), 'Release Notes', release.getChangelogUrl(), :class => 'external' %> - : </b></td> - <td class="sep"></td> - <td><%= release.getDescription() -%></td> - </tr> - <tr> - <td class="thin nowrap" valign="top"><b>How to upgrade: </b></td> - <td class="sep"></td> - <td> - <% if update.hasWarnings() %> - Follow those steps to upgrade SonarQube from version <%= sonar_version -%> to - version <%= release.getVersion() -%> : - <ol class="bulletpoints"> - <li>Stop SonarQube</li> - <li><%= link_to 'Download', release.getDownloadUrl(), :class => 'external' -%> and install - SonarQube <%= release.getVersion() -%> after having carefully read the - <a href="http://redirect.sonarsource.com/doc/upgrading.html" class="external">upgrade guide</a>. - </li> - <% update.getIncompatiblePlugins().each do |incompatible_plugin| %> - <li> - Uninstall the plugin <%= incompatible_plugin.getName() -%> which is not compatible with - SonarQube <%= release.getVersion() -%>. - </form> - </li> - <% end %> - <% update.getPluginsToUpgrade().each do |plugin_to_upgrade| %> - <li> - Replace current version of plugin <%= plugin_to_upgrade.getArtifact().getName() -%> by - version <%= plugin_to_upgrade.getVersion() -%> - </form> - </li> - <% end %> - <li>Start SonarQube</li> - </ol> - - <% else %> - <%= link_to 'Download', release.getDownloadUrl(), :class => 'external' -%> and install - SonarQube <%= release.getVersion() -%> after having carefully read the - <a href="http://redirect.sonarsource.com/doc/upgrading.html" class="external">upgrade guide</a>. - <% end %> - </td> - </tr> - </tbody> - </table> - </td> - </tr> - </tbody> - </table> - <div class="break30"></div> - <% end - end - end %> - - <%= render :partial => 'updatecenter/status', :locals => {:action => 'system_updates'} %> - </div> -</div> 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 @@ -<script> - function upgradePlugin (key) { - $j('#upgrade-form-' + key).submit(); - var button = $j('#upgrade-submit-' + key); - button.prop('disabled', 'true'); - button.attr('value', 'Upgrading'); - return false; - } -</script> - -<div class="page"> - <header class="page-header"> - <h1 class="page-title"><%= message('update_center.page') -%></h1> - <p class="page-description"><%= message('update_center.page.description') -%></p> - </header> - - <%= render :partial => 'updatecenter/tabs', :locals => {:tab => 'updates'} -%> - - <div class="tabs-panel"> - - <%= render :partial => 'updatecenter/operations' -%> - - <% if @update_plugin_center %> - <table class="data width100 marginbottom10" id="plugin-updates"> - <thead> - <tr> - <th colspan="2"><h2>Plugins</h2></th> - </tr> - </thead> - <tbody> - <% if @updates_by_plugin.empty? %> - <tr class="even"> - <td colspan="2">All of your plugins are up to date.</td> - </tr> - <% 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 - %> - <tr class="<%= css -%>" id="select-<%= plugin.getKey() -%>"> - <td width="1%" nowrap> - <% if index==0 %><b><%= h(plugin.getName()) -%></b> <%= @installed_plugins[plugin.getKey()] -%> -> - <% end %></td> - <td width="1%" nowrap><b><%= release.getVersion() -%></b></td> - <td width="1%" nowrap><%= release_date(release.getDate()) if release.getDate() -%></td> - <td><%= release.getDescription() -%></td> - <td><%= link_to 'Release Notes', release.getChangelogUrl(), :class => 'external' if release.getChangelogUrl() %></td> - <td> - <% 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 %> - </td> - </tr> - <% - 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| %> - <tr class="<%= css -%> dep-<%= plugin.getKey() -%>"> - <td></td> - <td></td> - <% if index == 0 %> - <td class="thin nowrap"><b>Updating this plugin will also update:</b></td> - <% else %> - <td> </td> - <% end %> - <td colspan="4"> - <span><%= dependency.artifact.name -%></span> : <span><%= dependency.artifact.description -%></span> - </td> - </tr> - <% end %> - - <tr class="<%= css -%>"> - <td></td> - <td colspan="5"> - <form method="post" id="upgrade-form-<%= plugin.getKey() -%>" action="<%= ApplicationController.root_context -%>/updatecenter/install?from=updates&key=<%= plugin.getKey() -%>&version=<%= version -%>" style="display: inline-block"> - <input type="submit" id="upgrade-submit-<%= plugin.getKey() -%>" value="Upgrade to <%= @last_compatible[plugin.getKey()] -%>" onClick="upgradePlugin('<%= plugin.getKey() -%>');return false;"/> - </form> - </td> - </tr> - <% end %> - - <% - end - %> - </tbody> - </table> - - <% end %> - <%= render :partial => 'updatecenter/status', :locals => {:action => 'updates'} %> - </div> -</div> 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 %> - <script> - require(['apps/update-center/app'], function (App) { - App.start({ el: '#content', urlRoot: baseUrl + '/updatecenter_new' }); - }); - </script> -<% end %> |