jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-2766

Support ResourceTabs implemented as Ruby on Rails pages

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.10
  • Fix Version/s: 2.11
  • Component/s: Web
  • Labels:
    • rails
  • Patch Submitted:
    Yes

Description

Please support resource tabs (similar to Coverage, Violations, etc) implemented as Ruby on Rails pages.

I've attached a one line patch that enables this:

--- a/sonar-server/src/main/webapp/WEB-INF/app/views/resource/extension.html.erb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/views/resource/extension.html.erb
@@ -21,3 +21,3 @@
 <% else # ruby on rails page %>
-  <%= render :inline => @page.getTemplate() %>
+  <%= render :inline => @extension.getTarget().getTemplate() %>

I've also attached a test project with a resource tab implemented in Rails, with an example resource tab implemented in Ruby.

I've filed this as a bug because the reference to rails in resource/extension.html.erb suggests it's supposed to be implemented already.

The test plugin works with the supplied patch. Without the patch, the following error is seen when trying to access the tab:

NoMethodError in Resource#index

Showing app/views/resource/extension.html.erb where line #14 raised:

undefined method `getTemplate' for nil:NilClass
Extracted source (around line #14):

11: <script src="<%= ApplicationController.root_context
-%>/deploy/gwt/<%= @extension.getId() -%>/<%= @extension.getId()
-%>.nocache.js?<%= sonar_version -%>"></script>
12: <% end %>
13: <% else # ruby on rails page %>
14: <%= render :inline => @page.getTemplate() %>
15: <% end %>
  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    ruby-resource.diff
    02/Sep/11 5:36 AM
    0.6 kB
    Martin Ellis
  2. Hide
    Zip Archive
    test-plugin.zip
    02/Sep/11 5:36 AM
    4 kB
    Martin Ellis
    1. XML File
      test-plugin/pom.xml 3 kB
    2. File
      test-plugin/src/.../resourcetab/test.erb 0.2 kB
    3. Java Source File
      test-plugin/src/.../RubyResourceTab.java 0.9 kB
    4. Java Source File
      test-plugin/.../RubyResourceTabPlugin.java 0.9 kB
    Download Zip
    Show
    Zip Archive
    test-plugin.zip
    02/Sep/11 5:36 AM
    4 kB
    Martin Ellis

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Simon Brandhof
    Reporter:
    Martin Ellis
Vote (0)
Watch (0)

Dates

  • Created:
    02/Sep/11 5:36 AM
    Updated:
    08/Sep/11 5:27 AM
    Resolved:
    07/Sep/11 3:04 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.