From 36127595a7f3247ac92677da77c5d0383a539f54 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Thu, 10 Nov 2016 09:39:43 +0100 Subject: [PATCH] fix issues bulk change --- .../test/java/it/issue/IssueSearchTest.java | 7 ++ .../issue/IssueSearchTest/bulk_change.html | 98 +++++++++++++++++++ .../src/main/js/apps/component-issues/app.js | 1 + .../sonar-web/src/main/js/apps/issues/app.js | 2 +- 4 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 it/it-tests/src/test/resources/issue/IssueSearchTest/bulk_change.html 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 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sessions/logout
open/sessions/new
typeid=loginadmin
typeid=passwordadmin
clickAndWaitcommit
open/issues
waitForTextcss=.js-issue-transition*Open*
waitForElementPresentid=issues-bulk-change
clickid=issues-bulk-change
waitForElementPresentcss=#issues-bulk-change + .dropdown-menu .js-bulk-change
clickcss=#issues-bulk-change + .dropdown-menu .js-bulk-change
waitForElementPresentid=bulk-change-form
waitForElementPresentid=transition-confirm
clickid=transition-confirm
clickid=bulk-change-submit
waitForElementNotPresentid=bulk-change-form
waitForTextcss=.js-issue-transition*Confirmed*
+ + 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(); -- 2.39.5