From 922b1deb97a1bdb13d4c14598b7a8508f4f508a2 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Fri, 21 Jun 2013 17:38:26 +0200 Subject: [PATCH] SONAR-3714 add first screen of bulk change --- .../resources/org/sonar/l10n/core.properties | 1 + .../server/issue/InternalRubyIssueService.java | 2 +- .../app/controllers/issues_controller.rb | 6 ++++++ .../app/views/issues/_bulk_change_form.html.erb | 17 +++++++++++++++++ .../WEB-INF/app/views/issues/search.html.erb | 3 +++ .../issue/InternalRubyIssueServiceTest.java | 4 ++-- 6 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb diff --git a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties index 7528990291e..53f55b00162 100644 --- a/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties +++ b/plugins/sonar-core-plugin/src/main/resources/org/sonar/l10n/core.properties @@ -547,6 +547,7 @@ issue_filter.private=Private issue_filter.shared_with_all_users=Shared with all users issue_filter.sharing=Sharing issue_filter.manage.shared_filters=Shared Filters +issue_filter.bulk_change=Bulk change #------------------------------------------------------------------------------ # diff --git a/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java b/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java index d3b9ca5d0cb..72c6a60ea33 100644 --- a/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java +++ b/sonar-server/src/main/java/org/sonar/server/issue/InternalRubyIssueService.java @@ -588,7 +588,7 @@ public class InternalRubyIssueService implements ServerComponent { /** * Execute a bulk change */ - public Result> executebulkChange(Map props) { + public Result> executeBulkChange(Map props) { Result> result = Result.of(); try { IssueBulkChangeQuery issueBulkChangeQuery = toIssueBulkChangeQuery(props); diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb index f5a0ee450d3..a40844c6583 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb +++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb @@ -178,6 +178,12 @@ class IssuesController < ApplicationController end end + # GET /issues/bulk_change_form?[&criteria] + def bulk_change_form + + render :partial => 'issues/bulk_change_form' + end + private diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb new file mode 100644 index 00000000000..0f23790e641 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb @@ -0,0 +1,17 @@ +
+ +
+ + +
+
+ \ No newline at end of file diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb index 4b49d74a11c..21b9303d8e8 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/search.html.erb @@ -23,6 +23,9 @@ <%= message('save_as') -%> <% end %> + + +
diff --git a/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java b/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java index bd53b68fce5..47c70fb9076 100644 --- a/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java +++ b/sonar-server/src/test/java/org/sonar/server/issue/InternalRubyIssueServiceTest.java @@ -534,7 +534,7 @@ public class InternalRubyIssueServiceTest { @Test public void should_execute_bulk_change() { - service.executebulkChange(Maps.newHashMap()); + service.executeBulkChange(Maps.newHashMap()); verify(issueBulkChangeService).execute(any(IssueBulkChangeQuery.class), any(UserSession.class)); } @@ -542,7 +542,7 @@ public class InternalRubyIssueServiceTest { public void should_no_execute_bulk_change_if_unexpected_error() { doThrow(new RuntimeException("Error")).when(issueBulkChangeService).execute(any(IssueBulkChangeQuery.class), any(UserSession.class)); - Result result = service.executebulkChange(Maps.newHashMap()); + Result result = service.executeBulkChange(Maps.newHashMap()); assertThat(result.ok()).isFalse(); assertThat(((Result.Message) result.errors().get(0)).text()).contains("Error"); } -- 2.39.5