]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7914 Drop project level "Manage Dashboards" page and actions
authorStas Vilchik <vilchiks@gmail.com>
Fri, 22 Jul 2016 11:32:00 +0000 (13:32 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 25 Jul 2016 11:47:25 +0000 (13:47 +0200)
20 files changed:
it/it-tests/src/test/java/it/authorisation/DashboardSharingPermissionTest.java
it/it-tests/src/test/java/it/authorisation/SystemAdminPermissionTest.java
it/it-tests/src/test/java/it/componentDashboard/DashboardTest.java
it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-allowed.html [deleted file]
it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-denied.html [deleted file]
it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner-failure.html [deleted file]
it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-project-dashboards.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/follow-unfollow.html [deleted file]
it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/should-not-unshare-default-dashboard.html [deleted file]
server/sonar-web/src/main/js/helpers/urls.js
server/sonar-web/src/main/js/main/nav/component/component-nav-menu.js
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboards_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_available_dashboards.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_create_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_dashboard_operations.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_delete_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_edit_form.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/_my_dashboards.html.erb
server/sonar-web/src/main/webapp/WEB-INF/app/views/dashboards/index.html.erb

index 3236b69ccfc14acfa0b1be270a8ca1f9a7d0c471..63a8146615b058afb12ec278ea3ac1a8112cd09e 100644 (file)
@@ -32,7 +32,6 @@ import org.sonarqube.ws.client.permission.PermissionsService;
 import util.user.UserRule;
 
 import static util.ItUtils.newAdminWsClient;
-import static util.ItUtils.runProjectAnalysis;
 
 public class DashboardSharingPermissionTest {
 
@@ -85,18 +84,4 @@ public class DashboardSharingPermissionTest {
       .build();
     orchestrator.executeSelenese(selenese);
   }
-
-  /**
-   * SONAR-4136
-   */
-  @Test
-  public void share_project_dashboard() throws Exception {
-    runProjectAnalysis(orchestrator, "shared/xoo-sample");
-
-    Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-dashboard-sharing-permission",
-      "/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-allowed.html",
-      "/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-denied.html")
-      .build();
-    orchestrator.executeSelenese(selenese);
-  }
 }
index cb893b6a49bc94449b216c3564208a4ba500238e..af310ada96f1e177646c0be81e609fa8b6a5feb0 100644 (file)
@@ -31,7 +31,6 @@ import org.sonarqube.ws.client.permission.PermissionsService;
 import util.user.UserRule;
 
 import static util.ItUtils.newAdminWsClient;
-import static util.ItUtils.runProjectAnalysis;
 
 public class SystemAdminPermissionTest {
 
@@ -82,18 +81,6 @@ public class SystemAdminPermissionTest {
       "/authorisation/SystemAdminPermissionTest/change-shared-global-dashboard-owner-failure.html");
   }
 
-  /**
-   * SONAR-4136
-   */
-  @Test
-  public void should_change_ownership_of_shared_project_dashboard() throws Exception {
-    runProjectAnalysis(orchestrator, "shared/xoo-sample");
-
-    seleniumSuite("change-project-dashboard-ownership",
-      "/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner.html",
-      "/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner-failure.html");
-  }
-
   private void seleniumSuite(String suiteName, String... tests) {
     Selenese selenese = Selenese.builder().setHtmlTestsInClasspath(suiteName, tests).build();
     orchestrator.executeSelenese(selenese);
index b4e57a57af93298ab6e00904e5b168d855337c79..cb952347126a52fe83175571fc04b81677021f79 100644 (file)
@@ -52,16 +52,6 @@ public class DashboardTest {
       "/componentDashboard/DashboardTest/dashboard_extension/xss.html");
   }
 
-  /**
-   * SONAR-3103
-   */
-  @Test
-  public void share_dashboard() {
-    seleniumSuite("share_dashboard",
-      "/componentDashboard/DashboardTest/share_dashboard/follow-unfollow.html",
-      "/componentDashboard/DashboardTest/share_dashboard/should-not-unshare-default-dashboard.html");
-  }
-
   @Test
   public void configure_dashboard() {
     seleniumSuite("configure_dashboard",
@@ -85,9 +75,6 @@ public class DashboardTest {
       // SONAR-4630
       "/componentDashboard/DashboardTest/global_dashboard/create-global-dashboards-error.html",
 
-      // SONAR-3462
-      "/componentDashboard/DashboardTest/global_dashboard/edit-project-dashboards.html",
-
       // SONAR-3461
       "/componentDashboard/DashboardTest/global_dashboard/order-project-default-dashboards.html",
 
diff --git a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-allowed.html b/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-allowed.html
deleted file mode 100644 (file)
index 3b23dc8..0000000
+++ /dev/null
@@ -1,84 +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>project-dashboard-sharing-permission</title>
-</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/new</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=login</td>
-       <td>can_share_dashboards</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=password</td>
-       <td>password</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>name=commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboards?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>create-link-dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-body</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name</td>
-       <td>My shared project dashboard</td>
-</tr>
-<tr>
-       <td>storeValue</td>
-       <td>name</td>
-       <td>DASHBOARD_NAME</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>name=shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertTable</td>
-       <td>css=table.data.2.0</td>
-       <td>exact:${DASHBOARD_NAME}</td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>dashboard-1-shared</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-denied.html b/it/it-tests/src/test/resources/authorisation/DashboardSharingPermissionTest/project-dashboard-sharing-denied.html
deleted file mode 100644 (file)
index d8bfbd9..0000000
+++ /dev/null
@@ -1,59 +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>project-dashboard-sharing-permission</title>
-</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/new</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=login</td>
-       <td>cannot_share_dashboards</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=password</td>
-       <td>password</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>name=commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboards?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>create-link-dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-body</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementNotPresent</td>
-       <td>css=div.modal-body &gt; div.modal.field &gt; input#shared</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner-failure.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner-failure.html
deleted file mode 100644 (file)
index c82ad4b..0000000
+++ /dev/null
@@ -1,109 +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>change-shared-project-dashboard-owner</title>
-</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/new</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>/dashboards?resource=sample</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>create-link-dashboard</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>css=div.modal-body</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>type</td>
-    <td>name</td>
-    <td>shared-project-dashboard-fail</td>
-  </tr>
-  <tr>
-    <td>storeValue</td>
-    <td>name</td>
-    <td>DASHBOARD_NAME</td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>name=shared</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>clickAndWait</td>
-    <td>save-submit</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>edit-${DASHBOARD_NAME}</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>edit-${DASHBOARD_NAME}</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>css=div.modal-body</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>type</td>
-    <td>select-dashboard-owner</td>
-    <td>cannot_share</td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>save-submit</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>css=div.modal-body > p.error</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForText</td>
-    <td>css=div.modal-body > p.error</td>
-    <td>glob:*User cannot own this dashboard because of insufficient rights*</td>
-  </tr>
-  </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner.html b/it/it-tests/src/test/resources/authorisation/SystemAdminPermissionTest/change-shared-project-dashboard-owner.html
deleted file mode 100644 (file)
index df21b92..0000000
+++ /dev/null
@@ -1,104 +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>change-shared-project-dashboard-owner</title>
-</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/new</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>/dashboards?resource=sample</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>create-link-dashboard</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>css=div.modal-body</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>type</td>
-    <td>name</td>
-    <td>shared-project-dashboard</td>
-  </tr>
-  <tr>
-    <td>storeValue</td>
-    <td>name</td>
-    <td>DASHBOARD_NAME</td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>name=shared</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>clickAndWait</td>
-    <td>save-submit</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>edit-${DASHBOARD_NAME}</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>click</td>
-    <td>edit-${DASHBOARD_NAME}</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForVisible</td>
-    <td>css=div.modal-body</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>type</td>
-    <td>select-dashboard-owner</td>
-    <td>can_share</td>
-  </tr>
-  <tr>
-    <td>clickAndWait</td>
-    <td>save-submit</td>
-    <td></td>
-  </tr>
-  <tr>
-    <td>waitForText</td>
-    <td>dashboards</td>
-    <td>glob:*can_share*</td>
-  </tr>
-  </tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-project-dashboards.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/global_dashboard/edit-project-dashboards.html
deleted file mode 100644 (file)
index ca8e1a7..0000000
+++ /dev/null
@@ -1,229 +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>edit-project-dashboards</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">edit-project-dashboards</td>
-    </tr>
-    </thead>
-    <tbody>
-    <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>/dashboards?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>create-link-dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name=name</td>
-       <td>Project Shared</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>name=shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>create-link-dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name=name</td>
-       <td>Project Not Shared</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForTextPresent</td>
-       <td>My Project Dashboards</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=unfollow-Project%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=unfollow-Project%20Not%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertTable</td>
-       <td>id=shared-dashboards.1.0</td>
-       <td>Project Not Shared</td>
-</tr>
-<tr>
-       <td>assertTable</td>
-       <td>id=shared-dashboards.2.0</td>
-       <td>Project Shared</td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>id=follow-Project%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertElementPresent</td>
-       <td>id=follow-Project%20Not%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=edit-Project%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name=description</td>
-       <td>Description Shared</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForTextPresent</td>
-       <td>Description Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=edit-Project%20Not%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name=description</td>
-       <td>Description Not Shared</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForTextPresent</td>
-       <td>Description Not Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=delete-Project%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=.modal-body</td>
-       <td>Do you want to delete this dashboard?</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementNotPresent</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>delete-Project%20Not%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>delete-Project%20Not%20Shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=.modal-body</td>
-       <td>Do you want to delete this dashboard?</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForElementNotPresent</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/follow-unfollow.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/follow-unfollow.html
deleted file mode 100644 (file)
index f0e635a..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/new</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>/dashboards/index?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboards</td>
-       <td>glob:*Custom*</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=unfollow-Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>shared-dashboards</td>
-       <td>glob:*Custom*</td>
-</tr>
-<tr>
-       <td>assertNotText</td>
-       <td>dashboards</td>
-       <td>glob:*Custom*</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=follow-Custom</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertNotText</td>
-       <td>shared-dashboards</td>
-       <td>glob:*Custom*</td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>dashboards</td>
-       <td>glob:*Custom*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
diff --git a/it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/should-not-unshare-default-dashboard.html b/it/it-tests/src/test/resources/componentDashboard/DashboardTest/share_dashboard/should-not-unshare-default-dashboard.html
deleted file mode 100644 (file)
index 8eef362..0000000
+++ /dev/null
@@ -1,188 +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/new</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>/dashboards/index?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>create-link-dashboard</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>name=name</td>
-       <td>IsDefault</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>name=shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/admin_dashboards/index</td>
-       <td></td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>id=add-IsDefault</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>activeProject</td>
-       <td>glob:*IsDefault*</td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboards/index?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>edit-IsDefault</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>name=shared</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>save-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-body &gt; p.error</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=div.modal-body &gt; p.error</td>
-       <td>glob:*This dashboard can't be unshared*</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>save-cancel</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=delete-IsDefault</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=div.modal-body</td>
-       <td>Do you want to delete this dashboard?</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-body .alert-danger</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=div.modal-body .alert-danger</td>
-       <td>glob:*This dashboard can't be deleted*</td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/admin_dashboards/index</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=remove-IsDefault</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertConfirmation</td>
-       <td>Are you sure to remove it from default dashboards?</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/dashboards/index?resource=sample</td>
-       <td></td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>id=delete-IsDefault</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForVisible</td>
-       <td>css=div.modal-head &gt; h2</td>
-       <td></td>
-</tr>
-<tr>
-       <td>waitForText</td>
-       <td>css=div.modal-body</td>
-       <td>Do you want to delete this dashboard?</td>
-</tr>
-<tr>
-       <td>click</td>
-       <td>confirm-submit</td>
-       <td></td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
index ef25fe9a9525d33c0ecf0d2f857f3cac230696af..19bd44e6add2c1f9d1556ccd12ac09d6ce3b927e 100644 (file)
@@ -75,15 +75,6 @@ export function getComponentFixedDashboardUrl (componentKey, dashboardKey) {
   return window.baseUrl + '/overview' + dashboardKey + '?id=' + encodeURIComponent(componentKey);
 }
 
-/**
- * Generate URL for a component's dashboards management page
- * @param {string} componentKey
- * @returns {string}
- */
-export function getComponentDashboardManagementUrl (componentKey) {
-  return window.baseUrl + '/dashboards?resource=' + encodeURIComponent(componentKey);
-}
-
 /**
  * Generate URL for a component's permissions page
  * @param {string} componentKey
index 6ce4822c1867767a5a179e5855f94effacb20b22..3028759fe088976adda6487ef03157f602a6f6db 100644 (file)
@@ -21,13 +21,11 @@ import qs from 'querystring';
 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,
-    getComponentDashboardManagementUrl
+    getComponentFixedDashboardUrl
 } from '../../../helpers/urls';
 
 const SETTINGS_URLS = [
@@ -80,7 +78,6 @@ export default React.createClass({
   isCustomDashboardsActive () {
     const dashboards = this.props.component.dashboards;
     return _.any(dashboards, this.isCustomDashboardActive) ||
-        this.isDashboardManagementActive() ||
         this.isDefaultDeveloperDashboardActive();
   },
 
@@ -89,11 +86,6 @@ export default React.createClass({
     return this.isDeveloper() && path.indexOf(window.baseUrl + '/dashboard') === 0;
   },
 
-  isDashboardManagementActive () {
-    const path = window.location.pathname;
-    return path.indexOf(window.baseUrl + '/dashboards') === 0;
-  },
-
   renderOverviewLink() {
     const url = getComponentFixedDashboardUrl(this.props.component.key, '');
     const name = <i className="icon-home"/>;
@@ -118,7 +110,6 @@ export default React.createClass({
   renderCustomDashboards() {
     const dashboards = this.props.component.dashboards.map(this.renderCustomDashboard);
     const className = classNames('dropdown', { active: this.isCustomDashboardsActive() });
-    const managementLink = this.renderDashboardsManagementLink();
     return <li className={className}>
       <a className="dropdown-toggle" data-toggle="dropdown" href="#">
         {translate('layout.dashboards')}&nbsp;
@@ -126,25 +117,10 @@ export default React.createClass({
       </a>
       <ul className="dropdown-menu">
         {dashboards}
-        {managementLink && <li className="divider"/>}
-        {managementLink}
       </ul>
     </li>;
   },
 
-  renderDashboardsManagementLink() {
-    if (!window.SS.user) {
-      return null;
-    }
-    const key = 'dashboard-management';
-    const url = getComponentDashboardManagementUrl(this.props.component.key);
-    const name = translate('dashboard.manage_dashboards');
-    const className = classNames('pill-right', { active: this.isDashboardManagementActive() });
-    return <li key={key} className={className}>
-      <a className="note" href={url}>{name}</a>
-    </li>;
-  },
-
   renderCodeLink() {
     if (this.isDeveloper()) {
       return null;
index 06b4e593a4fd6fa4678b61a245c4283e37d41cff..3ca18a8aa5c33aadffe16cf2804346479bb01e6f 100644 (file)
@@ -24,36 +24,24 @@ class DashboardsController < ApplicationController
   before_filter :login_required
 
   def index
-    @global = !params[:resource]
+    @global = true
 
     @actives=ActiveDashboard.user_dashboards(current_user, @global)
     @shared_dashboards=Dashboard.all(:conditions => ['(shared=? or user_id=?) and is_global=?', true, current_user.id, @global])
     active_ids=@actives.map(&:dashboard_id)
     @shared_dashboards.reject! { |d| active_ids.include?(d.id) }
     @shared_dashboards=Api::Utils.insensitive_sort(@shared_dashboards, &:name)
-
-    if params[:resource]
-      @resource=Project.by_key(params[:resource])
-      if @resource.nil?
-        # TODO display error page
-        redirect_to home_path
-        return false
-      end
-      access_denied unless has_role?(:user, @resource)
-      @snapshot = @resource.last_snapshot
-      @project=@resource # variable name used in old widgets
-    end
   end
 
   def create_form
-    @global = !params[:resource]
+    @global = true
     @dashboard = Dashboard.new
-    render :partial => 'create_form', :resource => params[:resource]
+    render :partial => 'create_form'
   end
 
   def create
     verify_post_request
-    @global = !params[:resource]
+    @global = true
     @dashboard = Dashboard.new()
     @dashboard.user_id = current_user.id
     load_dashboard_from_params(@dashboard)
@@ -61,21 +49,21 @@ class DashboardsController < ApplicationController
     active_dashboard = current_user.active_dashboards.to_a.find { |ad| ad.name==@dashboard.name }
     if active_dashboard
       @dashboard.errors.add_to_base(Api::Utils.message('dashboard.error_create_existing_name'))
-      render :partial => 'dashboards/create_form', :status => 400, :resource => params[:resource]
+      render :partial => 'dashboards/create_form', :status => 400
     elsif @dashboard.save
       add_default_dashboards_if_first_user_dashboard(@dashboard.global?)
       last_index=current_user.active_dashboards.max_by(&:order_index).order_index
       current_user.active_dashboards.create(:dashboard => @dashboard, :user => current_user, :order_index => (last_index+1))
       render :text => CGI.escapeHTML(params[:resource]), :highlight => @dashboard.id, :status => 200
     else
-      render :partial => 'dashboards/create_form', :status => 400, :resource => params[:resource]
+      render :partial => 'dashboards/create_form', :status => 400
     end
   end
 
   def edit_form
     @dashboard = Dashboard.find(params[:id])
     if @dashboard.editable_by?(current_user)
-      render :partial => 'edit_form', :resource => params[:resource]
+      render :partial => 'edit_form'
     else
       access_denied
     end
@@ -98,7 +86,7 @@ class DashboardsController < ApplicationController
         render :text => CGI.escapeHTML(params[:resource]), :status => 200
       else
         @dashboard.user = dashboard_owner
-        render :partial => 'dashboards/edit_form', :status => 400, :resource => params[:resource]
+        render :partial => 'dashboards/edit_form', :status => 400
       end
     else
       access_denied
@@ -108,7 +96,7 @@ class DashboardsController < ApplicationController
   def delete_form
     @dashboard = Dashboard.find(params[:id])
     if @dashboard.editable_by?(current_user)
-      render :partial => 'delete_form', :resource => params[:resource]
+      render :partial => 'delete_form'
     else
       access_denied
     end
@@ -125,7 +113,7 @@ class DashboardsController < ApplicationController
       render :text => CGI.escapeHTML(params[:resource]), :status => 200
     else
       @dashboard.errors.add(message('dashboard.error_delete_default'), ' ')
-      render :partial => 'dashboards/delete_form', :status => 400, :resource => params[:resource]
+      render :partial => 'dashboards/delete_form', :status => 400
     end
   end
 
@@ -152,7 +140,7 @@ class DashboardsController < ApplicationController
       current_user.active_dashboards.create(:dashboard => dashboard, :user => current_user, :order_index => (last_active_dashboard ? last_active_dashboard.order_index+1 : 1))
     end
 
-    redirect_to :action => 'index', :resource => params[:resource]
+    redirect_to :action => 'index'
   end
 
   def unfollow
@@ -166,7 +154,7 @@ class DashboardsController < ApplicationController
       flash[:notice]=Api::Utils.message('dashboard.default_restored')
     end
 
-    redirect_to :action => 'index', :resource => params[:resource]
+    redirect_to :action => 'index'
   end
 
 
@@ -188,7 +176,7 @@ class DashboardsController < ApplicationController
       end
     end
 
-    redirect_to :action => 'index', :resource => params[:resource]
+    redirect_to :action => 'index'
   end
 
   def load_dashboard_from_params(dashboard)
index 35cd88de775f4fbf7e0ed2cca6d47c6bdb8567e5..2f80d7fefdf708bdb2138234895f9bdc69660b4f 100644 (file)
     </tr>
   <% else
        @shared_dashboards.each do |dashboard| %>
-      <% resource_id = @resource.id if @resource %>
       <tr id="dashboard-<%= dashboard.id -%>" class="<%= cycle('even', 'odd', :name => 'shared') -%>">
         <td>
-          <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id, :id => (resource_id unless dashboard.global?)},
+          <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id},
                       :id => "view-#{u dashboard.name}" %>
           <div class="description"><%= h dashboard.description -%></div>
         </td>
index 6ea5082291931229b67a816153fcce48476d30e5..c79ab4b210fe08a0be4bd8c8bc96507884b0c434 100644 (file)
@@ -1,9 +1,5 @@
 <form id="create-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/create">
-  <% if @global %>
-    <input type="hidden" name="global" value="true" />
-  <% else %>
-    <input type="hidden" name="resource" value="<%= h params[:resource] %>"/>
-  <% end %>
+  <input type="hidden" name="global" value="true" />
   <fieldset>
     <div class="modal-head">
       <h2><%= message('dashboard.new_dashboard') -%></h2>
@@ -38,8 +34,6 @@
 
 <script>
   $j("#create-dashboard-form").modalForm({success: function (data) {
-    var contextParams = data.trim().length > 0 ? '?resource=' + data.trim() : '';
-    window.location = window.baseUrl + '/dashboards' + contextParams;
+    window.location = window.baseUrl + '/dashboards';
   }});
 </script>
-
index 472d7778eefe09a707ee5bba574deb1c03fa1ba6..ae66c82c2d7c5fcf4e2584b4d5c78c2fe12232dd 100644 (file)
@@ -1,18 +1,17 @@
 <td class="thin nowrap text-right">
-  <% resource_id = @resource.id if @resource %>
   <% if dashboard.editable_by?(current_user) %>
-    <%= link_to message('dashboard.configure_widgets'), {:controller => :dashboard, :action => :configure, :did => dashboard.id, :id => (resource_id unless dashboard.global?)},
+    <%= link_to message('dashboard.configure_widgets'), {:controller => :dashboard, :action => :configure, :did => dashboard.id},
                 :id => "configure-#{u dashboard.name}", :class => 'link-action' %>
-    <%= link_to message('edit'), {:action => :edit_form, :id => dashboard.id, :resource => resource_id},
+    <%= link_to message('edit'), {:action => :edit_form, :id => dashboard.id},
                 :id => "edit-#{u dashboard.name}", :class => 'open-modal' %>
 
     <% if can_be_disabled %>
-      <%= link_to message('delete'), {:action => :delete_form, :id => dashboard.id, :resource => resource_id},
+      <%= link_to message('delete'), {:action => :delete_form, :id => dashboard.id},
                   :id => "delete-#{u dashboard.name}", :class => 'open-modal text-danger' %>
     <% end %>
   <% end %>
   <% if can_be_disabled %>
-    <%= link_to message(subscription_action), {:action => subscription_action.to_sym, :id => dashboard.id, :resource => resource_id}, :method => :post,
+    <%= link_to message(subscription_action), {:action => subscription_action.to_sym, :id => dashboard.id}, :method => :post,
                 :id => "#{subscription_action}-#{u dashboard.name}" %>
   <% end %>
 </td>
index 2bbdcfa5270cba9102a4698e8383bc55eb0545a7..b5494ee17bdf6266cbfc8e05b1c1098a274198e2 100644 (file)
@@ -1,10 +1,6 @@
 <form id="delete-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/delete">
   <input type="hidden" name="id" value="<%= @dashboard.id -%>">
-  <% if @dashboard.global %>
-    <input type="hidden" name="global" value="true" />
-  <% else %>
-    <input type="hidden" name="resource" value="<%= h(params[:resource]) %>"/>
-  <% end %>
+  <input type="hidden" name="global" value="true" />
   <fieldset>
     <div class="modal-head">
       <h2><%= message 'dashboard.delete_confirm_title' -%></h2>
@@ -26,7 +22,6 @@
 
 <script>
   $j("#delete-dashboard-form").modalForm({success: function (data) {
-    var contextParams = data.trim().length > 0 ? '?resource=' + data.trim() : '';
-    window.location = window.baseUrl + '/dashboards' + contextParams;
+    window.location = window.baseUrl + '/dashboards';
   }});
 </script>
index afd283ef4ac98e747e43ec1b44e5775a9e23e593..09c82c5d924069a8557af7885a3f8d8fd0dace3c 100644 (file)
@@ -1,10 +1,6 @@
 <form id="edit-dashboard-form" method="post" action="<%= ApplicationController.root_context -%>/dashboards/update">
   <input type="hidden" name="id" value="<%= @dashboard.id -%>">
-  <% if @dashboard.global %>
-    <input type="hidden" name="global" value="true" />
-  <% else %>
-    <input type="hidden" name="resource" value="<%= h(params[:resource]) %>"/>
-  <% end %>
+  <input type="hidden" name="global" value="true" />
   <fieldset>
     <div class="modal-head">
       <h2><%= message('dashboard.edit_dashboard') -%></h2>
@@ -45,7 +41,6 @@
 
 <script>
   $j("#edit-dashboard-form").modalForm({success: function (data) {
-    var contextParams = data.trim().length > 0 ? '?resource=' + data.trim() : '';
-    window.location = window.baseUrl + '/dashboards' + contextParams;
+    window.location = window.baseUrl + '/dashboards';
   }});
 </script>
index 3c2425053b5741fbd742497ed0b4379c1e862191..5b3b526756de990bd6d6f99ff6b36641dcd9e1c7 100644 (file)
     </tr>
   <% else %>
     <% @actives.map(&:dashboard).each_with_index do |dashboard, index| %>
-      <% resource_id = @resource.id if @resource %>
       <tr id="dashboard-<%= dashboard.id -%>" class="<%= cycle('even', 'odd', :name => 'dashboard') -%>">
         <td>
-          <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id, :id => (resource_id unless dashboard.global?)},
+          <%= link_to h(dashboard.name(true)), {:controller => :dashboard, :action => :index, :did => dashboard.id},
                       :id => "view-#{u dashboard.name}" %>
           <div class="description"><%= h dashboard.description -%></div>
         </td>
         </td>
         <td class="order">
           <% if index > 0 %>
-            <%= link_to '', {:action => :up, :id => dashboard.id, :resource => resource_id}, :method => :post, :id => "up-#{u dashboard.name}", :class => "icon-move-up" %>
+            <%= link_to '', {:action => :up, :id => dashboard.id}, :method => :post, :id => "up-#{u dashboard.name}", :class => "icon-move-up" %>
           <% else %>
             <%= image_tag('transparent_16.gif') %>
           <% end %>
           <% if index < @actives.size-1 %>
-            <%= link_to '', {:action => :down, :id => dashboard.id, :resource => resource_id}, :method => :post, :id => "down-#{u dashboard.name}", :class => "icon-move-down" %>
+            <%= link_to '', {:action => :down, :id => dashboard.id}, :method => :post, :id => "down-#{u dashboard.name}", :class => "icon-move-down" %>
           <% else %>
             <%= image_tag('transparent_16.gif') %>
         <% end %>
index eca8850357d69384afc5cbbd06d51fc7cbd47341..edbc0bf98e9e0cc00e263f442cdb7079c00c07d6 100644 (file)
@@ -6,7 +6,7 @@
     </li>
   </ul>
 
-  <h1><%= message(@global ? 'dashboard.my_global_dashboards' : 'dashboard.my_project_dashboards') -%></h1>
+  <h1><%= message('dashboard.my_global_dashboards') -%></h1>
   <%= render_partial :partial => 'my_dashboards', :locals => { :is_admin => is_admin? } %>
 
   <h1><%= message('dashboard.available_dashboards') -%></h1>