From 8f7a9ad479a219fc22ac729a23f220e450c572b7 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 1 Feb 2016 20:35:30 +0100 Subject: [PATCH] SONAR-7122 Drop the ability to customize the web app context --- it/it-tests/pom.xml | 2 +- .../src/test/java/it/Category1Suite.java | 1 - .../src/test/java/it/Category2Suite.java | 2 - .../src/test/java/it/Category3Suite.java | 1 - .../src/test/java/it/Category4Suite.java | 1 - .../test/java/it/analysis/IssuesModeTest.java | 19 ++++----- it/it-tests/src/test/java/util/ItUtils.java | 39 ++----------------- .../process/ProcessTest/sonar.properties | 4 -- .../process/ProcessTest/sonar.properties | 4 -- .../java/org/sonar/server/app/Webapp.java | 14 +------ .../org/sonar/server/platform/ServerImpl.java | 6 +-- .../java/org/sonar/server/app/WebappTest.java | 32 +-------------- .../sonar/server/platform/ServerImplTest.java | 14 ------- .../platform/ServerLifecycleNotifierTest.java | 2 +- .../app/controllers/account_controller.rb | 2 +- .../app/controllers/application_controller.rb | 2 +- .../WEB-INF/app/helpers/application_helper.rb | 28 ++++++------- .../account/_change_password_form.html.erb | 2 +- .../app/views/account/_favorites.html.erb | 2 +- .../WEB-INF/app/views/account/index.html.erb | 2 +- .../app/views/account/notifications.html.erb | 4 +- .../app/views/action_plans/index.html.erb | 10 ++--- .../views/api_documentation/index.html.erb | 2 +- .../app/views/background_tasks/index.html.erb | 2 +- .../WEB-INF/app/views/code/index.html.erb | 2 +- .../app/views/coding_rules/index.html.erb | 2 +- .../app/views/comparison/index.html.erb | 10 ++--- .../app/views/component/index.html.erb | 2 +- .../app/views/component_issues/index.html.erb | 2 +- .../app/views/confirm/_confirm.html.erb | 2 +- .../app/views/custom_measures/index.html.erb | 2 +- .../dashboard/_widget_properties.html.erb | 2 +- .../app/views/dashboard/configure.html.erb | 4 +- .../app/views/dashboard/index.html.erb | 4 +- .../app/views/dashboard/no_dashboard.html.erb | 2 +- .../views/dashboards/_create_form.html.erb | 2 +- .../views/dashboards/_delete_form.html.erb | 2 +- .../app/views/dashboards/_edit_form.html.erb | 2 +- .../app/views/drilldown/measures.html.erb | 4 +- .../views/email_configuration/index.html.erb | 4 +- .../generate_secret_form.html.erb | 2 +- .../encryption_configuration/index.html.erb | 4 +- .../WEB-INF/app/views/groups/index.html.erb | 2 +- .../views/issues/_bulk_change_form.html.erb | 2 +- .../views/issues/_filter_copy_form.html.erb | 2 +- .../views/issues/_filter_edit_form.html.erb | 2 +- .../issues/_filter_save_as_form.html.erb | 2 +- .../WEB-INF/app/views/issues/manage.html.erb | 16 ++++---- .../WEB-INF/app/views/issues/search.html.erb | 2 +- .../app/views/layouts/_footer.html.erb | 2 +- .../WEB-INF/app/views/layouts/_head.html.erb | 8 ++-- .../app/views/layouts/_layout.html.erb | 2 +- .../WEB-INF/app/views/layouts/nonav.html.erb | 8 ++-- .../app/views/maintenance/index.html.erb | 2 +- .../WEB-INF/app/views/markdown/help.html.erb | 2 +- .../app/views/measures/_copy_form.html.erb | 4 +- .../app/views/measures/_edit_form.html.erb | 4 +- .../app/views/measures/_favourites.html.erb | 6 +-- .../app/views/measures/_save_as_form.html.erb | 4 +- .../views/measures/_search_header.html.erb | 2 +- .../app/views/measures/manage.html.erb | 12 +++--- .../app/views/measures/search.html.erb | 4 +- .../WEB-INF/app/views/metrics/index.html.erb | 2 +- .../WEB-INF/app/views/overview/index.html.erb | 2 +- .../views/permission_templates/index.html.erb | 2 +- .../WEB-INF/app/views/profiles/index.html.erb | 2 +- .../app/views/project/_delete_form.html.erb | 4 +- .../views/project/background_tasks.html.erb | 2 +- .../app/views/project/deletion.html.erb | 2 +- .../app/views/project/profile.html.erb | 2 +- .../app/views/project/qualitygate.html.erb | 2 +- .../widgets/issues/_issues_list.html.erb | 2 +- .../app/views/project_roles/index.html.erb | 2 +- .../WEB-INF/app/views/projects/index.html.erb | 2 +- .../app/views/quality_gates/index.html.erb | 2 +- .../WEB-INF/app/views/roles/global.html.erb | 2 +- .../WEB-INF/app/views/roles/projects.html.erb | 2 +- .../server_id_configuration/index.html.erb | 2 +- .../WEB-INF/app/views/sessions/_form.html.erb | 23 +++++++++-- .../app/views/settings/_properties.html.erb | 2 +- .../WEB-INF/app/views/setup/index.html.erb | 2 +- .../WEB-INF/app/views/system/index.html.erb | 2 +- .../app/views/updatecenter/index.html.erb | 2 +- .../app/views/users/_edit_form.html.erb | 2 +- .../WEB-INF/app/views/users/index.html.erb | 2 +- .../app/views/view_projects/index.html.erb | 2 +- .../WEB-INF/app/views/widget/index.html.erb | 6 +-- .../src/main/assembly/conf/sonar.properties | 4 -- .../sonar/batch/platform/DefaultServer.java | 2 +- .../java/org/sonar/api/platform/Server.java | 4 ++ 90 files changed, 172 insertions(+), 254 deletions(-) diff --git a/it/it-tests/pom.xml b/it/it-tests/pom.xml index 386f69257e8..25b1a8b2ac1 100644 --- a/it/it-tests/pom.xml +++ b/it/it-tests/pom.xml @@ -21,7 +21,7 @@ org.sonarsource.orchestrator sonar-orchestrator - 3.7 + 3.9 test diff --git a/it/it-tests/src/test/java/it/Category1Suite.java b/it/it-tests/src/test/java/it/Category1Suite.java index f9b138e88af..b5bdb5574da 100644 --- a/it/it-tests/src/test/java/it/Category1Suite.java +++ b/it/it-tests/src/test/java/it/Category1Suite.java @@ -118,7 +118,6 @@ public class Category1Suite { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setContext("/") .setServerProperty("sonar.notifications.delay", "1") .addPlugin(pluginArtifact("property-sets-plugin")) .addPlugin(pluginArtifact("sonar-subcategories-plugin")) diff --git a/it/it-tests/src/test/java/it/Category2Suite.java b/it/it-tests/src/test/java/it/Category2Suite.java index 0505c30af73..3c1bbbf6c27 100644 --- a/it/it-tests/src/test/java/it/Category2Suite.java +++ b/it/it-tests/src/test/java/it/Category2Suite.java @@ -105,8 +105,6 @@ public class Category2Suite { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setContext("/") - .addPlugin(xooPlugin()) // issue diff --git a/it/it-tests/src/test/java/it/Category3Suite.java b/it/it-tests/src/test/java/it/Category3Suite.java index 3bd7dfa8afc..8576080b5cb 100644 --- a/it/it-tests/src/test/java/it/Category3Suite.java +++ b/it/it-tests/src/test/java/it/Category3Suite.java @@ -54,7 +54,6 @@ public class Category3Suite { public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() .addPlugin(xooPlugin()) .setOrchestratorProperty("javaVersion", "LATEST_RELEASE").addPlugin("java") - .setContext("/") // Used by SettingsEncryptionTest .addPlugin(pluginArtifact("settings-encryption-plugin")) diff --git a/it/it-tests/src/test/java/it/Category4Suite.java b/it/it-tests/src/test/java/it/Category4Suite.java index f743ad74fc4..57ea1d1553a 100644 --- a/it/it-tests/src/test/java/it/Category4Suite.java +++ b/it/it-tests/src/test/java/it/Category4Suite.java @@ -70,7 +70,6 @@ public class Category4Suite { @ClassRule public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setContext("/") .addPlugin(xooPlugin()) .build(); } diff --git a/it/it-tests/src/test/java/it/analysis/IssuesModeTest.java b/it/it-tests/src/test/java/it/analysis/IssuesModeTest.java index b9a761165a2..81d219aa56d 100644 --- a/it/it-tests/src/test/java/it/analysis/IssuesModeTest.java +++ b/it/it-tests/src/test/java/it/analysis/IssuesModeTest.java @@ -24,7 +24,8 @@ import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.build.BuildFailureException; import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarRunner; -import com.sonar.orchestrator.build.SonarRunnerInstaller; +import com.sonar.orchestrator.build.SonarScanner; +import com.sonar.orchestrator.build.SonarScannerInstaller; import com.sonar.orchestrator.config.FileSystem; import com.sonar.orchestrator.locator.FileLocation; import com.sonar.orchestrator.version.Version; @@ -405,7 +406,7 @@ public class IssuesModeTest { private void runConcurrentIssues() throws Exception { // Install sonar-runner in advance to avoid concurrent unzip issues FileSystem fileSystem = orchestrator.getConfiguration().fileSystem(); - new SonarRunnerInstaller(fileSystem).install(Version.create(SonarRunner.DEFAULT_RUNNER_VERSION), fileSystem.workspace()); + new SonarScannerInstaller(fileSystem).install(Version.create(SonarScanner.DEFAULT_RUNNER_VERSION), fileSystem.workspace()); final int nThreads = 3; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); List> tasks = new ArrayList<>(); @@ -414,7 +415,7 @@ public class IssuesModeTest { tasks.add(new Callable() { public BuildResult call() throws Exception { - SonarRunner runner = configureRunnerIssues("shared/xoo-sample", homeDir, "sonar.it.enableWaitingSensor", "true"); + SonarScanner runner = configureRunnerIssues("shared/xoo-sample", homeDir, "sonar.it.enableWaitingSensor", "true"); return orchestrator.executeBuild(runner); } }); @@ -447,18 +448,18 @@ public class IssuesModeTest { return orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics(key, "lines")); } - private SonarRunner configureRunnerIssues(String projectDir, @Nullable File homeDir, String... props) throws IOException { - SonarRunner runner = SonarRunner.create(ItUtils.projectDir(projectDir), + private SonarScanner configureRunnerIssues(String projectDir, @Nullable File homeDir, String... props) throws IOException { + SonarScanner scanner = SonarScanner.create(ItUtils.projectDir(projectDir), "sonar.working.directory", temp.newFolder().getAbsolutePath(), "sonar.analysis.mode", "issues", "sonar.report.export.path", "sonar-report.json"); if (homeDir != null) { - runner.setProperty("sonar.userHome", homeDir.getAbsolutePath()); + scanner.setProperty("sonar.userHome", homeDir.getAbsolutePath()); } else { - runner.setProperty("sonar.userHome", temp.newFolder().getAbsolutePath()); + scanner.setProperty("sonar.userHome", temp.newFolder().getAbsolutePath()); } - runner.setProperties(props); - return runner; + scanner.setProperties(props); + return scanner; } private SonarRunner configureRunner(String projectDir, String... props) throws IOException { diff --git a/it/it-tests/src/test/java/util/ItUtils.java b/it/it-tests/src/test/java/util/ItUtils.java index 7702f25df00..7eb6464faa6 100644 --- a/it/it-tests/src/test/java/util/ItUtils.java +++ b/it/it-tests/src/test/java/util/ItUtils.java @@ -17,14 +17,8 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -package util;/* - * Copyright (C) 2009-2014 SonarSource SA - * All rights reserved - * mailto:contact AT sonarsource DOT com - */ +package util; -import com.google.common.base.Supplier; -import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.sonar.orchestrator.Orchestrator; @@ -67,29 +61,8 @@ public class ItUtils { private ItUtils() { } - private static final Supplier HOME_DIR = Suppliers.memoize(new Supplier() { - @Override - public File get() { - File testResources = FileUtils.toFile(ItUtils.class.getResource("/ItUtils.txt")); - return testResources // ${home}/it/it-tests/src/test/resources - .getParentFile() // ${home}/it/it-tests/src/test - .getParentFile() // ${home}/it/it-tests/src - .getParentFile() // ${home}/it/it-tests - .getParentFile() // ${home}/it - .getParentFile(); // ${home} - } - }); - public static FileLocation xooPlugin() { - File target = new File(HOME_DIR.get(), "plugins/sonar-xoo-plugin/target"); - if (target.exists()) { - for (File jar : FileUtils.listFiles(target, new String[] {"jar"}, false)) { - if (jar.getName().startsWith("sonar-xoo-plugin-") && !jar.getName().contains("-sources")) { - return FileLocation.of(jar); - } - } - } - throw new IllegalStateException("XOO plugin is not built"); + return FileLocation.byWildcardMavenFilename(new File("../../plugins/sonar-xoo-plugin/target"), "sonar-xoo-plugin-*.jar"); } public static List getAllServerIssues(Orchestrator orchestrator) { @@ -118,7 +91,7 @@ public class ItUtils { * @param relativePath path related to the directory it/it-projects, for example "qualitygate/xoo-sample" */ public static File projectDir(String relativePath) { - File dir = new File(HOME_DIR.get(), "it/it-projects/" + relativePath); + File dir = new File("../it-projects/" + relativePath); if (!dir.exists() || !dir.isDirectory()) { throw new IllegalStateException("Directory does not exist: " + dir.getAbsolutePath()); } @@ -132,11 +105,7 @@ public class ItUtils { * It assumes that version is 1.0-SNAPSHOT */ public static FileLocation pluginArtifact(String dirName) { - File file = new File(HOME_DIR.get(), "it/it-plugins/" + dirName + "/target/" + dirName + "-1.0-SNAPSHOT.jar"); - if (!file.exists()) { - throw new IllegalStateException(String.format("Plugin [%s]for integration tests is not built. File not found:%s", dirName, file)); - } - return FileLocation.of(file); + return FileLocation.byWildcardMavenFilename(new File("../it-plugins/" + dirName + "/target"), dirName + "-*.jar"); } /** diff --git a/server/sonar-process-monitor/src/test/resources/org/sonar/process/ProcessTest/sonar.properties b/server/sonar-process-monitor/src/test/resources/org/sonar/process/ProcessTest/sonar.properties index 4c4ddb2f130..dd7a73de8ad 100644 --- a/server/sonar-process-monitor/src/test/resources/org/sonar/process/ProcessTest/sonar.properties +++ b/server/sonar-process-monitor/src/test/resources/org/sonar/process/ProcessTest/sonar.properties @@ -80,10 +80,6 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # By default, ports will be used on all IP addresses associated with the server. #sonar.web.host=0.0.0.0 -# Web context. When set, it must start with forward slash (for example /sonarqube). -# The default value is root context (empty value). -#sonar.web.context= - # TCP port for incoming HTTP connections. Disabled when value is -1. #sonar.web.port=9000 diff --git a/server/sonar-process/src/test/resources/org/sonar/process/ProcessTest/sonar.properties b/server/sonar-process/src/test/resources/org/sonar/process/ProcessTest/sonar.properties index 4c4ddb2f130..dd7a73de8ad 100644 --- a/server/sonar-process/src/test/resources/org/sonar/process/ProcessTest/sonar.properties +++ b/server/sonar-process/src/test/resources/org/sonar/process/ProcessTest/sonar.properties @@ -80,10 +80,6 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # By default, ports will be used on all IP addresses associated with the server. #sonar.web.host=0.0.0.0 -# Web context. When set, it must start with forward slash (for example /sonarqube). -# The default value is root context (empty value). -#sonar.web.context= - # TCP port for incoming HTTP connections. Disabled when value is -1. #sonar.web.port=9000 diff --git a/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java b/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java index 52659a2afcd..f0a128c04d2 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java +++ b/server/sonar-server/src/main/java/org/sonar/server/app/Webapp.java @@ -37,14 +37,14 @@ class Webapp { private static final String JRUBY_MAX_RUNTIMES = "jruby.max.runtimes"; private static final String RAILS_ENV = "rails.env"; - private static final String PROPERTY_CONTEXT = "sonar.web.context"; + private static final String ROOT_CONTEXT_PATH = ""; private Webapp() { } static StandardContext configure(Tomcat tomcat, Props props) { try { - StandardContext context = (StandardContext) tomcat.addWebapp(getContextPath(props), webappPath(props)); + StandardContext context = (StandardContext) tomcat.addWebapp(ROOT_CONTEXT_PATH, webappPath(props)); context.setClearReferencesHttpClientKeepAliveThread(false); context.setClearReferencesStatic(false); context.setClearReferencesStopThreads(false); @@ -72,16 +72,6 @@ class Webapp { } } - static String getContextPath(Props props) { - String context = props.value(PROPERTY_CONTEXT, ""); - if ("/".equals(context)) { - context = ""; - } else if (!"".equals(context) && !context.startsWith("/")) { - throw new IllegalStateException(String.format("Value of '%s' must start with a forward slash: '%s'", PROPERTY_CONTEXT, context)); - } - return context; - } - static void configureRails(Props props, Context context) { // sonar.dev is kept for backward-compatibility if (props.valueAsBoolean("sonar.dev", false)) { diff --git a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerImpl.java b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerImpl.java index 7ab16e8d70d..444dcd6d61c 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/platform/ServerImpl.java +++ b/server/sonar-server/src/main/java/org/sonar/server/platform/ServerImpl.java @@ -55,7 +55,6 @@ public final class ServerImpl extends Server implements Startable { private String id; private String version; private String implementationBuild; - private String contextPath; private File sonarHome; private File deployDir; @@ -78,9 +77,6 @@ public final class ServerImpl extends Server implements Startable { version = readVersion(versionPath); implementationBuild = read(buildProperties).getProperty("Implementation-Build"); - contextPath = StringUtils.defaultIfBlank(settings.getString("sonar.web.context"), "") - // Remove trailing slashes - .replaceFirst("(\\/+)$", ""); sonarHome = new File(settings.getString(ProcessProperties.PATH_HOME)); if (!sonarHome.isDirectory()) { @@ -138,7 +134,7 @@ public final class ServerImpl extends Server implements Startable { @Override public String getContextPath() { - return contextPath; + return ""; } @Override diff --git a/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java b/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java index 234ee29042c..197ed81f387 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/app/WebappTest.java @@ -19,6 +19,8 @@ */ package org.sonar.server.app; +import java.io.File; +import java.util.Properties; import org.apache.catalina.Context; import org.apache.catalina.core.StandardContext; import org.apache.catalina.startup.Tomcat; @@ -27,9 +29,6 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.sonar.process.Props; -import java.io.File; -import java.util.Properties; - import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.fail; import static org.mockito.Matchers.anyString; @@ -94,31 +93,4 @@ public class WebappTest { verify(context).addParameter("jruby.max.runtimes", "1"); verify(context).addParameter("rails.env", "production"); } - - @Test - public void context_path_must_start_with_slash() { - Properties p = new Properties(); - p.setProperty("sonar.web.context", "foo"); - - try { - Webapp.getContextPath(new Props(p)); - fail(); - } catch (IllegalStateException e) { - assertThat(e.getMessage()).isEqualTo("Value of 'sonar.web.context' must start with a forward slash: 'foo'"); - } - } - - @Test - public void root_context_path_must_be_blank() { - Properties p = new Properties(); - p.setProperty("sonar.web.context", "/"); - - assertThat(Webapp.getContextPath(new Props(p))).isEqualTo(""); - } - - @Test - public void default_context_path_is_root() { - String context = Webapp.getContextPath(new Props(new Properties())); - assertThat(context).isEqualTo(""); - } } diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java index 6dd519dfe40..052a1fbd8e4 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerImplTest.java @@ -124,20 +124,6 @@ public class ServerImplTest { assertThat(server.getContextPath()).isEqualTo(""); } - @Test - public void get_context_path_from_settings() { - settings.setProperty("sonar.web.context", "/my_path"); - server.start(); - assertThat(server.getContextPath()).isEqualTo("/my_path"); - } - - @Test - public void sanitize_context_path_from_settings() { - settings.setProperty("sonar.web.context", "/my_path///"); - server.start(); - assertThat(server.getContextPath()).isEqualTo("/my_path"); - } - @Test public void is_dev() throws Exception { settings.setProperty("sonar.web.dev", true); diff --git a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLifecycleNotifierTest.java b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLifecycleNotifierTest.java index d91368da8b4..275ef0edf42 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLifecycleNotifierTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/platform/ServerLifecycleNotifierTest.java @@ -115,7 +115,7 @@ class FakeServer extends Server { @Override public String getContextPath() { - return null; + return ""; } @Override diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb index 508c5ac7ae1..99d3093545d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/account_controller.rb @@ -80,7 +80,7 @@ class AccountController < ApplicationController end end - redirect_to "#{ApplicationController.root_context}/account/notifications" + redirect_to "/account/notifications" end private diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb index d1c1682b30e..55959e331d1 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/application_controller.rb @@ -43,7 +43,7 @@ class ApplicationController < ActionController::Base rescue_from Errors::AccessDenied, :with => :render_access_denied # See lib/authenticated_system.rb#access_denied() def self.root_context - ActionController::Base.relative_url_root || '' + '' end def java_facade diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb index 982956acd76..262665471b9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/helpers/application_helper.rb @@ -167,9 +167,9 @@ module ApplicationHelper # url_for_static(:plugin => 'myplugin', :path => 'image.png') def url_for_static(options={}) if options[:plugin] - "#{ApplicationController.root_context}/static/#{options[:plugin]}/#{options[:path]}" + "/static/#{options[:plugin]}/#{options[:path]}" else - "#{ApplicationController.root_context}/#{options[:path]}" + "/#{options[:path]}" end end @@ -329,10 +329,10 @@ module ApplicationHelper period_index=nil if period_index && period_index<=0 if resource.display_dashboard? if options[:dashboard] - root = "#{ApplicationController.root_context}/dashboard/index?" + root = "/dashboard/index?" else # stay on the same page (for example components) - root = "#{ApplicationController.root_context}/#{u params[:controller]}/#{u params[:action]}?" + root = "/#{u params[:controller]}/#{u params[:action]}?" end path = '' query = request.query_parameters @@ -345,7 +345,7 @@ module ApplicationHelper end "#{name || resource.name}" else - url = "#{ApplicationController.root_context}/dashboard/index?id=#{u resource.key}" + url = "/dashboard/index?id=#{u resource.key}" url += "&period=#{u period_index}" if period_index url += "&metric=#{u options[:metric]}" if options[:metric] ":select2_options - hash of select2 options # def user_select_tag(name, options={}) - ws_url="#{ApplicationController::root_context}/api/users/search" + ws_url="/api/users/search" options[:min_length]=2 options[:select2_ajax_options]={ 'data' => 'function (term, page) { return { q: term, p: page } }', @@ -851,7 +851,7 @@ module ApplicationHelper message_params = options[:confirm_msg_params] width = options[:confirm_width]||500 - url = "#{ApplicationController.root_context}/confirm?url=#{u post_url}" + url = "/confirm?url=#{u post_url}" url += "&tk=#{u title_key}" if title_key if message_key url += "&mk=#{u message_key}&" @@ -877,7 +877,7 @@ module ApplicationHelper html += " colspan='#{options[:colspan]}'" if options[:colspan] html += '>' if options[:include_loading_icon] && options[:id] - html += "" + html += "" end html += ' diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb index e0f6c2f658f..434c160613a 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/_favorites.html.erb @@ -7,7 +7,7 @@ <%= link_to_favourite f -%> <% - url = ApplicationController.root_context + '/dashboard?id=' + url_encode(f.key) + url = '/dashboard?id=' + url_encode(f.key) %> <%= qualifier_icon f %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb index 5cb4f630c87..edab056abc5 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/index.html.erb @@ -93,5 +93,5 @@ ] }; - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/notifications.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/notifications.html.erb index 29ac2b1ce1d..728550b5a3e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/notifications.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/account/notifications.html.erb @@ -48,7 +48,7 @@ <% end %> -
+ <% unless @global_dispatchers.empty? -%>
<%= render "account/global_notifications" -%> @@ -71,5 +71,5 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb index e7be4603928..6c384f37d06 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/action_plans/index.html.erb @@ -4,7 +4,7 @@ <% if is_admin?(@resource.id) %> <% end %> @@ -35,7 +35,7 @@ %> - "/> + "/> <%= h(plan.name()) -%> <%= format_date(plan.deadLine()) -%> <% if plan.totalIssues()==0 %> @@ -61,7 +61,7 @@ <%= link_to message('close'), {:action => 'change_status', :id => @resource.id, :plan_key => plan.key()}, {:method => 'POST', :class => 'link-action'}.merge(close_confirmation_message) -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}", + <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}", :class => 'link-action link-red', :id => "delete_#{h(plan.key)}", :confirm_button => message('delete'), @@ -98,7 +98,7 @@ @closed_action_plans.each do |plan| %> - "/> + "/> <%= h(plan.name) -%> <%= format_date(plan.deadLine()) -%> @@ -118,7 +118,7 @@ <%= link_to message('action_plans.reopen'), {:action => 'change_status', :id => @resource.id, :plan_key => plan.key}, {:method => 'POST', :class => 'link-action'} -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}", + <%= link_to_action message('delete'), "/action_plans/delete/#{h(@resource.id)}?plan_key=#{h(plan.key)}", :class => 'link-action link-red', :id => "delete_#{h(plan.key)}", :confirm_button => message('delete'), diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb index 62aedd51b29..4d8d2500e2d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/api_documentation/index.html.erb @@ -2,5 +2,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb index 18cce998a6f..8b7563b9081 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/background_tasks/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb index f5600f6ca03..a805ff002fd 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/code/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb index 7d421c9d66d..21b70621c4e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/coding_rules/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb index c0058d15a58..b94f313faca 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/comparison/index.html.erb @@ -69,7 +69,7 @@ - + @@ -112,7 +112,7 @@ $j('#version_loading').show(); $j.ajax({ type:'GET', - url:'<%= ApplicationController.root_context -%>/comparison/versions?resource=' + url:'/comparison/versions?resource=' + id + '&sids=' + $j('#sids').val(), success:function (data) { @@ -169,7 +169,7 @@ <% if index > 0 %> <% else %> - + <% end %> @@ -181,7 +181,7 @@ <% if index < last_index %> <% else %> - + <% end %> @@ -199,7 +199,7 @@ %> - <%= h s.resource.name(true) -%> + <%= h s.resource.name(true) -%>
<%= event ? event.name : message('comparison.version.latest') -%>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb index 27fe285b3d7..39ca697ed6e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component/index.html.erb @@ -9,7 +9,7 @@ }; })(); - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb index b2b853e610b..53629f56020 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/component_issues/index.html.erb @@ -9,5 +9,5 @@ }; })(); - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb index 64f47c4f522..bfecce9911e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/confirm/_confirm.html.erb @@ -11,7 +11,7 @@ diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb index 8a7e139e257..cff02fb111d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/custom_measures/index.html.erb @@ -2,5 +2,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb index a7492f091c9..319694faee3 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb @@ -1,4 +1,4 @@ - + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb index 48b2288e5fa..296fe1e3e00 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb @@ -1,6 +1,6 @@ <% content_for :script do %> - - + + <% end %>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb index 132fe9ded98..6603843b870 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/index.html.erb @@ -1,6 +1,6 @@ <% content_for :script do %> - - + + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb index 72416ed82eb..05f0f5bfb27 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboard/no_dashboard.html.erb @@ -14,7 +14,7 @@ }; })(); - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb index 669f955d295..298a8073f34 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb @@ -1,4 +1,4 @@ - + <% if @global %> <% else %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb index 2f369216ac8..9b44f6643a1 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb @@ -1,4 +1,4 @@ - + <% if @dashboard.global %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb index c96cb3feb0c..9309a22c5ff 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb @@ -1,4 +1,4 @@ - + <% if @dashboard.global %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb index 3e1a68f269f..56d086e1fa9 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/drilldown/measures.html.erb @@ -2,7 +2,7 @@ <% if params[:period] && @snapshot.project_snapshot.periods? %>

- + <% if params[:highlight] %> @@ -141,5 +141,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb index 76265ab1097..0de15fd9ff5 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/email_configuration/index.html.erb @@ -1,4 +1,4 @@ - +

@@ -62,7 +62,7 @@
-
+ diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/generate_secret_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/generate_secret_form.html.erb index e2624527d17..572d1ea6ea5 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/generate_secret_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/generate_secret_form.html.erb @@ -17,7 +17,7 @@ type="button" value="Generate secret key" onclick="$j.ajax({ - url:'<%=ApplicationController.root_context-%>/encryption_configuration/generate_secret', + url:'/encryption_configuration/generate_secret', type:'post', success:function(response){$j('#secret_content').html(response);}, error:function(response){$j('#secret_error').html(response.responseText); $j('#secret_error').show();} diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/index.html.erb index 4b0cb7c2d47..a2126b5bfcb 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/encryption_configuration/index.html.erb @@ -13,7 +13,7 @@ + action="/encryption_configuration/encrypt" > diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb index e3bee63260c..747f7383293 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/groups/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb index e047918ee81..1685b1e3f8a 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb @@ -25,7 +25,7 @@ all_issues_are_assigned_to_current_user &&= issue.assignee() == current_user.login end %> - +
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb index ad34992b288..51551254393 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_filter_copy_form.html.erb @@ -1,4 +1,4 @@ - +
- <%= h filter.name -%> + <%= h filter.name -%> <% if filter.description %>
<%= h filter.description -%>
<% end %> @@ -72,13 +72,13 @@ <% end %>
- <%= message('copy') -%>   - <%= message('edit') -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}", + <%= link_to_action message('delete'), "/issues/delete/#{filter.id}", :class => 'link-action link-red', :id => "delete_#{filter.name.parameterize}", :confirm_button => message('delete'), @@ -116,7 +116,7 @@ <%= issue_filter_star(filter, @favourite_filter_ids.include?(filter.id)) -%> - <%= h filter.name -%> + <%= h filter.name -%> <% if filter.description %>
<%= h filter.description -%>
<% end %> @@ -125,12 +125,12 @@ <%= filter.userLogin ? h(Api.users.findByLogin(filter.userLogin).name) : '[SonarQube]' -%>
- <%= message('copy') -%> + <%= message('copy') -%> <% if has_role?(:admin) %>   - <%= message('edit') -%> + <%= message('edit') -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/issues/delete/#{filter.id}", + <%= link_to_action message('delete'), "/issues/delete/#{filter.id}", :class => 'link-action link-red', :id => "delete_system_#{filter.name.parameterize}", :confirm_button => message('delete'), diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb index b1baf27f96c..48b7b4b268d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/search.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb index c5dbab53411..409489b0094 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_footer.html.erb @@ -16,7 +16,7 @@ <% end %> - + <%= yield :extra_script -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb index 66c5645c688..ec1b9db64c7 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_head.html.erb @@ -18,7 +18,7 @@ %> <%= title -%> - + <%= yield :style -%> - - + + <%= yield :script -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb index b793d31198e..94e2eb4f7eb 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb @@ -56,7 +56,7 @@ Documentation - Get Support - Plugins - - Web Service API + Web Service API diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb index 6ff414fd657..52ddb591760 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/layouts/nonav.html.erb @@ -2,8 +2,8 @@ - <%= message('copy') -%> + <%= message('copy') -%>   - <%= message('edit') -%> + <%= message('edit') -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}", + <%= link_to_action message('delete'), "/measures/delete/#{filter.id}", :class => 'link-action link-red', :id => "delete_#{filter.name.parameterize}", :confirm_button => message('delete'), @@ -111,12 +111,12 @@ <%= filter.user ? h(filter.user.name) : '[SonarQube]' -%> - <%= message('copy') -%> + <%= message('copy') -%> <% if has_role?(:admin) %>   - <%= message('edit') -%> + <%= message('edit') -%>   - <%= link_to_action message('delete'), "#{ApplicationController.root_context}/measures/delete/#{filter.id}", + <%= link_to_action message('delete'), "/measures/delete/#{filter.id}", :class => 'link-action link-red', :id => "delete_system_#{filter.name.parameterize}", :confirm_button => message('delete'), diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb index fff811989ea..5d0bd1c595b 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/measures/search.html.erb @@ -16,7 +16,7 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb index 5a8e0641d97..e8879ceb432 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/metrics/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb index 43d4cedebee..b3823ee05e0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb @@ -130,5 +130,5 @@ }; })(); - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb index fb97f387c59..7597579ae76 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/permission_templates/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb index 3c52faf87d9..898ed10342f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/profiles/index.html.erb @@ -2,5 +2,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_delete_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_delete_form.html.erb index 79c73cd6f82..f4fddfc4391 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_delete_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/_delete_form.html.erb @@ -1,5 +1,5 @@ <% resource_qualifier = message('qualifier.' + @project.qualifier) %> - +
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb index d24f845572e..399e50a65c2 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/profile.html.erb @@ -19,7 +19,7 @@
<%= h language.getName() -%> - + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/qualitygate.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/qualitygate.html.erb index cd6e5a57567..d14507675a0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/qualitygate.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/qualitygate.html.erb @@ -4,7 +4,7 @@

<%= message('project_quality_gate.page.description') -%>

- + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb index 02610e495e4..70938e7cad1 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb @@ -56,7 +56,7 @@ <%= h truncate(issue.message, :length => 100) -%> <% if last_comment && last_comment.userLogin() %>
- + <% commentAuthor = users_by_login[last_comment.userLogin()] %>  <%= h( commentAuthor.nil? ? last_comment.userLogin() : commentAuthor.name() ) -%> : <%= Internal.text.markdownToHtml(last_comment.markdownText) -%> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb index 2ffe436320a..57b2c1ab069 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/project_roles/index.html.erb @@ -2,5 +2,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb index e9c8ffd9ad8..290a9ac5f9f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/projects/index.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb index 54b071e6e5a..ed03db047c0 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/quality_gates/index.html.erb @@ -2,5 +2,5 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb index 3c79bb2feca..1b84a1069de 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/global.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb index df0126ffd09..b37e4b37e92 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/roles/projects.html.erb @@ -1,3 +1,3 @@ <% content_for :extra_script do %> - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/server_id_configuration/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/server_id_configuration/index.html.erb index 6e7bb79fa36..feede78b06e 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/server_id_configuration/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/server_id_configuration/index.html.erb @@ -1,4 +1,4 @@ - + diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb index adeb267fbf4..556822c9e87 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/_form.html.erb @@ -49,9 +49,26 @@

-
- - <%= message('cancel') -%> +
+
+ <% auth_providers = Api::Utils.java_facade.getIdentityProviders().to_a %> +
    + <% auth_providers.each do |provider| %> +
  • + + <%= provider.getName().to_s -%> + +
  • + <% end %> +
+
+
+ + <%= message('cancel') -%> +
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb index 9ef0f8ba55d..7d87eabaa49 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_properties.html.erb @@ -85,7 +85,7 @@
<%= hidden_field_tag('page_version', (params[:page_version] || 0).to_i + 1) -%> <%= submit_tag(message('settings.save_category', :params => [subcategory_name(@category, @subcategory)]), :id => 'submit_settings') -%> - +
<% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb index a06263ce445..2d20d38d06f 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/setup/index.html.erb @@ -2,6 +2,6 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb index 1cb19867388..cd47108111d 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/system/index.html.erb @@ -1,4 +1,4 @@ <% content_for :extra_script do %> - + <% end %> 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 21e4db24e3a..d98e537dcfb 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 @@ -2,6 +2,6 @@ - + <% end %> diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_edit_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_edit_form.html.erb index 17fc622e600..8e36411a411 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_edit_form.html.erb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_edit_form.html.erb @@ -1,4 +1,4 @@ -
+
\ No newline at end of file +
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index ae9b419daf3..b0093dda0f9 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -100,10 +100,6 @@ # By default, ports will be used on all IP addresses associated with the server. #sonar.web.host=0.0.0.0 -# Web context. When set, it must start with forward slash (for example /sonarqube). -# The default value is root context (empty value). -#sonar.web.context= - # TCP port for incoming HTTP connections. Disabled when value is -1. #sonar.web.port=9000 diff --git a/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java b/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java index b747438a9f5..3136f4a3112 100644 --- a/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java +++ b/sonar-batch/src/main/java/org/sonar/batch/platform/DefaultServer.java @@ -80,7 +80,7 @@ public class DefaultServer extends Server { @Override public String getContextPath() { - return null; + return ""; } @Override diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java index 4fa6a3a5d1a..c68cbd2370b 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/platform/Server.java @@ -43,6 +43,10 @@ public abstract class Server { @CheckForNull public abstract File getDeployDir(); + /** + * @deprecated in 5.4. Web context path can not be configured. It's always {@code ""}. See https://jira.sonarsource.com/browse/SONAR-7122 + */ + @Deprecated public abstract String getContextPath(); /** -- 2.39.5