aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2016-11-10 09:39:43 +0100
committerStas Vilchik <vilchiks@gmail.com>2016-11-10 09:39:43 +0100
commit36127595a7f3247ac92677da77c5d0383a539f54 (patch)
treec37f1f47571f4e87e285301ddf6056a85f28eabc
parent7231cb649072d9396e2f89207503c265f15e06ab (diff)
downloadsonarqube-36127595a7f3247ac92677da77c5d0383a539f54.tar.gz
sonarqube-36127595a7f3247ac92677da77c5d0383a539f54.zip
fix issues bulk change
-rw-r--r--it/it-tests/src/test/java/it/issue/IssueSearchTest.java7
-rw-r--r--it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html98
-rw-r--r--server/sonar-web/src/main/js/apps/component-issues/app.js1
-rw-r--r--server/sonar-web/src/main/js/apps/issues/app.js2
4 files changed, 107 insertions, 1 deletions
diff --git a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
index 12ceaa1ac3b..a18d05fdf44 100644
--- a/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
+++ b/it/it-tests/src/test/java/it/issue/IssueSearchTest.java
@@ -310,6 +310,13 @@ public class IssueSearchTest extends AbstractIssueTest {
assertThat(searchIssues(new SearchWsRequest().setTypes(singletonList("VULNERABILITY"))).getPaging().getTotal()).isEqualTo(8);
}
+ @Test
+ public void bulk_change() {
+ ORCHESTRATOR.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("bulk_change",
+ "/issue/IssueSearchTest/bulk_change.html"
+ ).build());
+ }
+
private List<org.sonarqube.ws.Issues.Issue> searchByRuleKey(String... ruleKey) throws IOException {
return searchIssues(new SearchWsRequest().setRules(asList(ruleKey))).getIssuesList();
}
diff --git a/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html b/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html
new file mode 100644
index 00000000000..95dd44fbe68
--- /dev/null
+++ b/it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html
@@ -0,0 +1,98 @@
+<?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/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>commit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/issues</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>css=.js-issue-transition</td>
+ <td>*Open*</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>id=issues-bulk-change</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=issues-bulk-change</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>css=#issues-bulk-change + .dropdown-menu .js-bulk-change</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>id=bulk-change-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>id=transition-confirm</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=transition-confirm</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=bulk-change-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementNotPresent</td>
+ <td>id=bulk-change-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>css=.js-issue-transition</td>
+ <td>*Confirmed*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/server/sonar-web/src/main/js/apps/component-issues/app.js b/server/sonar-web/src/main/js/apps/component-issues/app.js
index a2f24c52aaf..7768330dd43 100644
--- a/server/sonar-web/src/main/js/apps/component-issues/app.js
+++ b/server/sonar-web/src/main/js/apps/component-issues/app.js
@@ -37,6 +37,7 @@ const init = function () {
this.config = options.config;
this.state = new State({
+ canBulkChange: !!window.SS.user,
isContext: true,
contextQuery: { componentUuids: options.config.resource },
contextComponentUuid: options.config.resource,
diff --git a/server/sonar-web/src/main/js/apps/issues/app.js b/server/sonar-web/src/main/js/apps/issues/app.js
index 4c15e33a8c2..bc083906618 100644
--- a/server/sonar-web/src/main/js/apps/issues/app.js
+++ b/server/sonar-web/src/main/js/apps/issues/app.js
@@ -34,7 +34,7 @@ const App = new Marionette.Application();
const init = function () {
const options = window.sonarqube;
- this.state = new State();
+ this.state = new State({ canBulkChange: !!window.SS.user });
this.list = new Issues();
this.facets = new Facets();