summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@gmail.com>2013-04-24 10:57:59 +0200
committerJulien Lancelot <julien.lancelot@gmail.com>2013-04-24 10:57:59 +0200
commit2cd90f30de91738db495a3336e31e5f250322848 (patch)
tree408bc2c247599f204df8e1cf6b3318b91f48bbc9
parent31ef838734bfb0bfa6dd9cd7449a37af3851a6e1 (diff)
downloadsonarqube-2cd90f30de91738db495a3336e31e5f250322848.tar.gz
sonarqube-2cd90f30de91738db495a3336e31e5f250322848.zip
SONAR-3755 Moved view issues action to view issue controller
-rw-r--r--sonar-application/pom.xml2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb45
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb17
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/issues/_issue.html.erb)0
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issue/_view.html.erb (renamed from sonar-server/src/main/webapp/WEB-INF/app/views/issues/_view.html.erb)2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb2
7 files changed, 49 insertions, 25 deletions
diff --git a/sonar-application/pom.xml b/sonar-application/pom.xml
index 9f0ef37ecfa..ec958e9b814 100644
--- a/sonar-application/pom.xml
+++ b/sonar-application/pom.xml
@@ -206,7 +206,7 @@
<configuration>
<rules>
<requireFilesSize>
- <maxsize>58000000</maxsize>
+ <maxsize>58100000</maxsize>
<minsize>54000000</minsize>
<files>
<file>${project.build.directory}/sonar-${project.version}.zip</file>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
new file mode 100644
index 00000000000..fd7122e0e6c
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
@@ -0,0 +1,45 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2013 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.
+#
+
+class IssueController < ApplicationController
+
+ SECTION=Navigation::SECTION_RESOURCE
+
+ # Used for the permalink, e.g. http://localhost:9000/issue/view/1
+ def view
+ issue_result = find_issues({'keys' => params[:id]})
+ if issue_result.issues.length == 1
+ @issue = issue_result.issues[0]
+ @rule = issue_result.rule(@issue)
+ @resource = Project.by_key(@issue.component_key)
+ render 'issue/_view', :locals => {:issue => @issue, :rule => @rule, :resource => @resource}
+ else
+ render :text => "<b>Cannot access this issue</b> : not found."
+ end
+ end
+
+ protected
+
+ def find_issues(map)
+ user = current_user ? current_user.id : nil
+ Api.issues.find(map, user)
+ end
+
+end \ No newline at end of file
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 31421e48d46..3d1a1acb1a2 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
@@ -20,23 +20,8 @@
class IssuesController < ApplicationController
- SECTION=Navigation::SECTION_RESOURCE
-
def index
- @issues = find_issues({})
- end
-
- # Used for the permalink, e.g. http://localhost:9000/issues/view/1
- def view
- issue_result = find_issues({'keys' => params[:id]})
- if issue_result.issues.length == 1
- @issue = issue_result.issues[0]
- @rule = issue_result.rule(@issue)
- @resource = Project.by_key(@issue.component_key)
- render 'issues/_view', :locals => {:issue => @issue, :rule => @rule, :resource => @resource}
- else
- render :text => "<b>Cannot access this issue</b> : not found."
- end
+ @issues = find_issues({}).issues
end
protected
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_issue.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
index 859714b9f85..859714b9f85 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_issue.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_view.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_view.html.erb
index 048a5dbc067..d1448cf5aa3 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_view.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issue/_view.html.erb
@@ -3,5 +3,5 @@
# hack in case 'error_message' is nil (this should disappear when refactoring the '_view' and '_issue' partials)
error_message = error_message
%>
- <%= render :partial => 'issues/issue', :locals => {:issue => @issue, :rule => @rule, :resource => @resource, :workflow => @issue, :error_message => error_message} -%>
+ <%= render :partial => 'issue/issue', :locals => {:issue => @issue, :rule => @rule, :resource => @resource, :workflow => @issue, :error_message => error_message} -%>
</div>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
index 7f2034775f8..9b5b4bd257d 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/issues/_list.html.erb
@@ -17,9 +17,6 @@
Resolution
</th>
<th>
- <%= message('title') -%>
- </th>
- <th>
Message
</th>
<th width="1%">
@@ -74,9 +71,6 @@
<%= h(issue.resolution) %>
</td>
<td>
- <%= h(issue.title) %>
- </td>
- <td>
<%= h(issue.description) %>
</td>
<td>
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb
index 7ce774c2b8e..89210ae68df 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/project/widgets/issues/_issues_list.html.erb
@@ -92,7 +92,7 @@
<tr class="<%= cycle 'even', 'odd', :name => ('issues-widget-list-' + widget_id) -%>">
<td><img src="<%= ApplicationController.root_context -%>/images/priority/<%= issue.severity -%>.png" title="<%= message(issue.severity.downcase).capitalize -%>"/></td>
<td>
- <%= link_to h(issue.description), :controller => "issues", :action => "view", :id => issue.key -%>
+ <%= link_to h(issue.description), :controller => "issue", :action => "view", :id => issue.key -%>
</td>
<td class="nowrap">
<%= distance_of_time_in_words_to_now(to_date(issue.updated_at || issue.created_at)) -%>