]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7915 Drop project level dashboards
authorStas Vilchik <vilchiks@gmail.com>
Fri, 22 Jul 2016 14:00:24 +0000 (16:00 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 25 Jul 2016 11:47:25 +0000 (13:47 +0200)
14 files changed:
it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java
it/it-tests/src/test/java/it/measureHistory/DifferentialPeriodsTest.java
it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/filter_widgets.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/keep_filter_after_adding_widget.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/main_dashboard.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_widget/add_project_widget_with_mandatory_properties.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/dashboard-should-be-registered.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/display-widgets-according-to-required-measures.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/test-location-of-widgets.html [deleted file]
it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/display-periods-selection-dropdown-on-dashboard.html [deleted file]
it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/not-display-periods-selection-dropdown-on-dashboard.html [deleted file]
it/it-tests/src/test/resources/measureHistory/TimeMachineUiTest/should-display-timemachine-dashboard.html [deleted file]
server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb

index cb952347126a52fe83175571fc04b81677021f79..8c2d3bf345e6835aeda3775ea90a0788b28b0d6c 100644 (file)
@@ -45,27 +45,10 @@ public class DashboardTest {
   @Test
   public void dashboard_extension() {
     seleniumSuite("dashboard_extension",
-      "/componentDashboard/DashboardTest/dashboard_extension/dashboard-should-be-registered.html",
-      "/componentDashboard/DashboardTest/dashboard_extension/test-location-of-widgets.html",
-
       // SSF-19
       "/componentDashboard/DashboardTest/dashboard_extension/xss.html");
   }
 
-  @Test
-  public void configure_dashboard() {
-    seleniumSuite("configure_dashboard",
-      "/componentDashboard/DashboardTest/configure_dashboard/main_dashboard.html",
-      "/componentDashboard/DashboardTest/configure_dashboard/filter_widgets.html",
-      "/componentDashboard/DashboardTest/configure_dashboard/keep_filter_after_adding_widget.html");
-  }
-
-  @Test
-  public void configure_widget() {
-    seleniumSuite("configure_widget",
-      "/componentDashboard/DashboardTest/configure_widget/add_project_widget_with_mandatory_properties.html");
-  }
-
   @Test
   public void global_dashboard() {
     seleniumSuite("global_dashboard",
index 7806016a0b59ebaaca6639c8abe6e64a4b632f2e..0cd559954181ce84e81e5d2c92422c353e26dfb6 100644 (file)
@@ -138,26 +138,6 @@ public class DifferentialPeriodsTest {
     ).build()).runOn(orchestrator);
   }
 
-  /**
-   * SONAR-4700
-   */
-  @Test
-  public void not_display_periods_selection_dropdown_on_first_analysis() {
-    orchestrator.getServer().provisionProject(PROJECT_KEY, PROJECT_KEY);
-    orchestrator.getServer().associateProjectToQualityProfile(PROJECT_KEY, "xoo", "empty");
-    runProjectAnalysis(orchestrator, "shared/xoo-sample");
-
-    // Use old way to execute Selenium because 'assertSelectOptions' action is not supported by SeleneseTest
-    orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("not-display-periods-selection-dropdown-on-first-analysis",
-      "/measureHistory/DifferentialPeriodsTest/not-display-periods-selection-dropdown-on-dashboard.html"
-      ).build());
-
-    runProjectAnalysis(orchestrator, "shared/xoo-sample");
-    orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("display-periods-selection-dropdown-after-first-analysis",
-      "/measureHistory/DifferentialPeriodsTest/display-periods-selection-dropdown-on-dashboard.html"
-      ).build());
-  }
-
   /**
    * SONAR-7237
    */
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/filter_widgets.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/filter_widgets.html
deleted file mode 100644 (file)
index d8fd819..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sessions/login</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>login</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>password</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>link=Configure widgets</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=#widget-filters li.selected</td>
-       <td>Any</td>
-</tr>
-<tr>
-       <td>assertVisible</td>
-       <td>def_hotspotmetric</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertVisible</td>
-       <td>def_complexity</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=widget-filter-Hotspots</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertVisible</td>
-       <td>def_hotspotmetric</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementNotPresent</td>
-       <td>def_complexity</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/keep_filter_after_adding_widget.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/keep_filter_after_adding_widget.html
deleted file mode 100644 (file)
index 50dffd0..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sessions/login</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>login</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>password</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>link=Configure widgets</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>id=add-widget-complexity</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=widget-filter-Hotspots</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementNotPresent</td>
-       <td>id=add-widget-complexity</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>add-widget-hotspot_metric</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=#widget-filters li.selected</td>
-       <td>glob:*Hotspots*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/main_dashboard.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_dashboard/main_dashboard.html
deleted file mode 100644 (file)
index aedb567..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>dashboard-column-1</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>dashboard-column-2</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_widget/add_project_widget_with_mandatory_properties.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/configure_widget/add_project_widget_with_mandatory_properties.html
deleted file mode 100644 (file)
index 4114715..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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>add_project_widget_with_mandatory_properties</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-  <thead>
-  <tr>
-    <td rowspan="1" colspan="3">add_project_widget_with_mandatory_properties</td>
-  </tr>
-  </thead>
-  <tbody>
-  <tr>
-       <td>open</td>
-       <td>/sessions/new</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>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>link=Configure widgets</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=add-widget-widget-with-mandatory-properties</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard-column-1</td>
-       <td>*Widget with Mandatory Properties*</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=mandatoryString</td>
-       <td>hello</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=mandatoryInt</td>
-       <td>123</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>name=commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard-column-1</td>
-       <td>*Widget with Mandatory Properties*</td>
-</tr>
-<tr>
-       <td>assertNotVisible</td>
-       <td>name=commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard-column-1</td>
-       <td>*mandatoryString*hello*mandatoryInt*123*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/dashboard-should-be-registered.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/dashboard-should-be-registered.html
deleted file mode 100644 (file)
index b681996..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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>dashboard-should-be-registered</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">dashboard-should-be-registered</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/dashboard/index/sample?name=Fake</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementPresent</td>
-       <td>link=Fake</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/display-widgets-according-to-required-measures.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/display-widgets-according-to-required-measures.html
deleted file mode 100644 (file)
index 161dba0..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-  <thead>
-  <tr>
-    <td rowspan="1" colspan="3">should-display-widgets-according-to-required-measures</td>
-  </tr>
-  </thead>
-  <tbody>
-  <tr>
-    <td>open</td>
-    <td>
-      /dashboard/index/sample:src/main/xoo/sample?name=RequiredMeasuresWidgetsDashboard
-    </td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForText</td>
-    <td>dashboard</td>
-    <td>*WidgetMandatoryAndOneOfSatisfied*WidgetMandatorySatisfied*WidgetNoConstraints*WidgetOneOfSatisfied*</td>
-  </tr>
-  </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/test-location-of-widgets.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/dashboard_extension/test-location-of-widgets.html
deleted file mode 100644 (file)
index dda0b27..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/dashboard/index/sample?name=Fake</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>dashboard-column-1</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>dashboard-column-2</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementNotPresent</td>
-        <td>dashboard-column-3</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>css=#dashboard-column-1 .description</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>css=#dashboard-column-2 .documentation_comments</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementNotPresent</td>
-        <td>css=.complexity</td>
-        <td></td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/display-periods-selection-dropdown-on-dashboard.html b/it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/display-periods-selection-dropdown-on-dashboard.html
deleted file mode 100644 (file)
index 56969d8..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<!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>display-added-files</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-  <thead>
-  <tr>
-    <td rowspan="1" colspan="3">should_display_added_files_in_differential_drilldown</td>
-  </tr>
-  </thead>
-  <tbody>
-  <tr>
-       <td>open</td>
-       <td>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Time changes*</td>
-</tr>
-<tr>
-       <td>assertSelectOptions</td>
-       <td>select-comparison</td>
-       <td>*since previous analysis*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/not-display-periods-selection-dropdown-on-dashboard.html b/it/it-tests/src/test/resources/measureHistory/DifferentialPeriodsTest/not-display-periods-selection-dropdown-on-dashboard.html
deleted file mode 100644 (file)
index 9209080..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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>display-added-files</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-  <thead>
-  <tr>
-    <td rowspan="1" colspan="3">should_display_added_files_in_differential_drilldown</td>
-  </tr>
-  </thead>
-  <tbody>
-  <tr>
-       <td>open</td>
-       <td>/dashboard/index?id=sample&name=Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertNotText</td>
-       <td>dashboard</td>
-       <td>*Time changes*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/measureHistory/TimeMachineUiTest/should-display-timemachine-dashboard.html b/it/it-tests/src/test/resources/measureHistory/TimeMachineUiTest/should-display-timemachine-dashboard.html
deleted file mode 100644 (file)
index 9d6894b..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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.
-  -->
-
-<!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>should-display-timemachine-dashboard</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">should-display-timemachine-dashboard</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/dashboard/index/sample?name=TimeMachine</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Complexity: 3*Technical Debt: 0*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Sep 01 2012*0.7*Nov 30 2012*0.9*Dec 31 2012*1.0-SNAPSHOT*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Lines of Code*Lines*Statements*Files*Classes*Functions*Accessors*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Comments*Comment lines*Public documented API*Public undocumented API*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Duplicated lines (%)*Duplicated lines*Duplicated blocks*Duplicated files*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Issues*Blocker issues*Critical issues*Major issues*Minor issues*Technical Debt*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Complexity*Complexity /function*Complexity /class*Complexity /file*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboard</td>
-       <td>*Coverage*Line coverage*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
index 3028759fe088976adda6487ef03157f602a6f6db..185b5a6ef63236176d3e3726bcb35d4b8b03b751 100644 (file)
@@ -22,11 +22,8 @@ import _ from 'underscore';
 import classNames from 'classnames';
 import React from 'react';
 import LinksMixin from '../links-mixin';
-import { translate, getLocalizedDashboardName } from '../../../helpers/l10n';
-import {
-    getComponentDashboardUrl,
-    getComponentFixedDashboardUrl
-} from '../../../helpers/urls';
+import { translate } from '../../../helpers/l10n';
+import { getComponentFixedDashboardUrl } from '../../../helpers/urls';
 
 const SETTINGS_URLS = [
   '/project/settings',
@@ -69,23 +66,6 @@ export default React.createClass({
     return path.indexOf(window.baseUrl + '/overview') === 0 || path.indexOf(window.baseUrl + '/governance') === 0;
   },
 
-  isCustomDashboardActive(customDashboard) {
-    const path = window.location.pathname;
-    const params = qs.parse(window.location.search.substr(1));
-    return path.indexOf(window.baseUrl + '/dashboard') === 0 && params.did === `${customDashboard.key}`;
-  },
-
-  isCustomDashboardsActive () {
-    const dashboards = this.props.component.dashboards;
-    return _.any(dashboards, this.isCustomDashboardActive) ||
-        this.isDefaultDeveloperDashboardActive();
-  },
-
-  isDefaultDeveloperDashboardActive() {
-    const path = window.location.pathname;
-    return this.isDeveloper() && path.indexOf(window.baseUrl + '/dashboard') === 0;
-  },
-
   renderOverviewLink() {
     const url = getComponentFixedDashboardUrl(this.props.component.key, '');
     const name = <i className="icon-home"/>;
@@ -97,30 +77,6 @@ export default React.createClass({
     );
   },
 
-  renderCustomDashboard(customDashboard) {
-    const key = 'custom-dashboard-' + customDashboard.key;
-    const url = getComponentDashboardUrl(this.props.component.key, customDashboard.key, this.getPeriod());
-    const name = getLocalizedDashboardName(customDashboard.name);
-    const className = classNames({ active: this.isCustomDashboardActive(customDashboard) });
-    return <li key={key} className={className}>
-      <a href={url}>{name}</a>
-    </li>;
-  },
-
-  renderCustomDashboards() {
-    const dashboards = this.props.component.dashboards.map(this.renderCustomDashboard);
-    const className = classNames('dropdown', { active: this.isCustomDashboardsActive() });
-    return <li className={className}>
-      <a className="dropdown-toggle" data-toggle="dropdown" href="#">
-        {translate('layout.dashboards')}&nbsp;
-        <i className="icon-dropdown"/>
-      </a>
-      <ul className="dropdown-menu">
-        {dashboards}
-      </ul>
-    </li>;
-  },
-
   renderCodeLink() {
     if (this.isDeveloper()) {
       return null;
@@ -265,17 +221,14 @@ export default React.createClass({
 
   renderExtensions() {
     const extensions = this.props.conf.extensions || [];
-    return extensions.map(e => {
-      return this.renderLink(e.url, e.name, e.url);
-    });
+    return extensions.map(e => this.renderLink(e.url, e.name, e.url));
   },
 
   renderTools() {
     const extensions = this.props.component.extensions || [];
     const withoutGovernance = extensions.filter(ext => ext.name !== 'Governance');
-    const tools = withoutGovernance.map(extension => {
-      return this.renderLink(extension.url, extension.name);
-    });
+    const tools = withoutGovernance
+        .map(extension => this.renderLink(extension.url, extension.name));
 
     if (!tools.length) {
       return null;
@@ -295,29 +248,15 @@ export default React.createClass({
   },
 
   render() {
-    if (this.isDeveloper()) {
-      return (
-          <ul className="nav navbar-nav nav-tabs">
-            {this.renderCustomDashboards()}
-            {this.renderComponentIssuesLink()}
-            {this.renderComponentMeasuresLink()}
-            {this.renderCodeLink()}
-            {this.renderTools()}
-            {this.renderAdministration()}
-          </ul>
-      );
-    } else {
-      return (
-          <ul className="nav navbar-nav nav-tabs">
-            {this.renderOverviewLink()}
-            {this.renderComponentIssuesLink()}
-            {this.renderComponentMeasuresLink()}
-            {this.renderCodeLink()}
-            {this.renderCustomDashboards()}
-            {this.renderTools()}
-            {this.renderAdministration()}
-          </ul>
-      );
-    }
+    return (
+        <ul className="nav navbar-nav nav-tabs">
+          {this.renderOverviewLink()}
+          {this.renderComponentIssuesLink()}
+          {this.renderComponentMeasuresLink()}
+          {this.renderCodeLink()}
+          {this.renderTools()}
+          {this.renderAdministration()}
+        </ul>
+    );
   }
 });
index b33e5c9ecd6455628f7418289a51bd1c9e9d7686..8a4f8635fb4575d140d9ee312820db31d8786667 100644 (file)
@@ -25,46 +25,41 @@ class DashboardController < ApplicationController
   before_filter :login_required, :except => [:index]
 
   def index
-    load_resource()
-      if !@resource || @resource.display_dashboard?
-        if params[:id]
-          unless @resource
-            return project_not_found
-          end
-          unless @snapshot
-            return project_not_analyzed
-          end
-        end
+    if params[:id]
+      @resource = Project.by_key(params[:id])
+      return project_not_found unless @resource
+      @resource = @resource.permanent_resource
 
-        # redirect to the project overview
-        if params[:id] && !params[:did] && !params[:name] && @resource.qualifier != 'DEV'
-          # if governance plugin is installed and we are opening a view
-          if Project.root_qualifiers.include?('VW') && (@resource.qualifier == 'VW' || @resource.qualifier == 'SVW')
-            return redirect_to(url_for({:controller => 'governance'}) + '?id=' + url_encode(params[:id]))
-          else
-            return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
-          end
-        end
+      access_denied unless has_role?(:user, @resource)
 
-        load_dashboard()
-        load_authorized_widget_definitions()
+      # for backward compatibility with old widgets
+      @project = @resource
+
+      # if file
+      if !@resource.display_dashboard?
+        @snapshot = @resource.last_snapshot
+        return project_not_analyzed unless @snapshot
+        @hide_sidebar = true
+        @file = @resource
+        @project = @resource.root_project
+        @metric=params[:metric]
+        render :action => 'no_dashboard'
       else
-        if !@resource || !@snapshot
-          redirect_if_bad_component()
+        # it is a project dashboard
+        # if governance plugin is installed and we are opening a view
+        if Project.root_qualifiers.include?('VW') && (@resource.qualifier == 'VW' || @resource.qualifier == 'SVW')
+          return redirect_to(url_for({:controller => 'governance'}) + '?id=' + url_encode(params[:id]))
         else
-          # display the layout of the parent without the sidebar, usually the directory, but display the file viewers
-          @hide_sidebar = true
-          @file = @resource
-          @project = @resource.root_project
-          @metric=params[:metric]
-          render :action => 'no_dashboard'
+          return redirect_to(url_for({:controller => 'overview'}) + '?id=' + url_encode(params[:id]))
+        end
       end
+    else
+      load_dashboard()
+      load_authorized_widget_definitions()
     end
   end
 
   def configure
-    load_resource()
-    redirect_if_bad_component()
     load_dashboard()
 
     @category=params[:category]
@@ -159,8 +154,6 @@ class DashboardController < ApplicationController
 
   def widget_definitions
     @category=params[:category]
-    load_resource()
-    # redirect_if_bad_component()
     load_dashboard()
     load_widget_definitions(@category)
     render :partial => 'widget_definitions', :locals => {:category => @category}
@@ -177,8 +170,6 @@ class DashboardController < ApplicationController
         @dashboard=Dashboard.first(:conditions => ['id=? AND user_id=?', params[:did].to_i, current_user.id])
       elsif params[:name]
         @dashboard=Dashboard.first(:conditions => ['name=? AND user_id=?', params[:name], current_user.id])
-      elsif params[:id]
-        active=ActiveDashboard.user_dashboards(current_user, false).first
       else
         active=ActiveDashboard.user_dashboards(current_user, true).first
       end
@@ -190,8 +181,6 @@ class DashboardController < ApplicationController
         @dashboard=Dashboard.first(:conditions => ['id=? AND shared=?', params[:did].to_i, true])
       elsif params[:name]
         @dashboard=Dashboard.first(:conditions => ['name=? AND shared=?', params[:name], true])
-      elsif params[:id]
-        active=ActiveDashboard.user_dashboards(nil, false).first
       else
         active=ActiveDashboard.user_dashboards(nil, true).first
       end
@@ -206,32 +195,6 @@ class DashboardController < ApplicationController
     @dashboard_configuration=Api::DashboardConfiguration.new(@dashboard, :period_index => params[:period], :snapshot => @snapshot) if @dashboard && @snapshot
   end
 
-  def load_resource
-    if params[:id]
-      @resource = Project.by_key(params[:id])
-      return unless @resource
-      @resource=@resource.permanent_resource
-
-      @snapshot=@resource.last_snapshot
-      return unless @snapshot
-
-      access_denied unless has_role?(:user, @resource)
-
-      @project=@resource # for backward compatibility with old widgets
-    end
-  end
-
-  def redirect_if_bad_component
-    if params[:id]
-      unless @resource
-        return project_not_found
-      end
-      unless @snapshot
-        project_not_analyzed
-      end
-    end
-  end
-
   def project_not_found
     flash[:error] = message('dashboard.project_not_found')
     redirect_to :action => :index