]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3223 Err. in review search if result ties to a deleted resource
authorFabrice Bellingard <bellingard@gmail.com>
Mon, 6 Feb 2012 17:04:39 +0000 (18:04 +0100)
committerFabrice Bellingard <bellingard@gmail.com>
Mon, 6 Feb 2012 17:04:39 +0000 (18:04 +0100)
sonar-server/src/main/webapp/WEB-INF/app/views/project_reviews/_review.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/reviews/_list.html.erb

index 2b4e3edd6583f551279da58f3c252b0875d7442d..14e22c06400649cefa5be6ff548e8503ecd40ec3 100644 (file)
         <%= qualifier_icon(review.resource) -%>
         <% if !review.on_project? %> <%= review.project.long_name -%> <%= image_tag 'sep12.png' -%>
         <% end %>
-        <%= link_to_resource(review.resource, review.resource.long_name, {:tab => :violations, :rule => review.false_positive ? "false_positive_reviews" : ""}) %>
+        <% if review.rule_failure && review.rule_failure.snapshot %>
+          <%= link_to_resource(review.resource, review.resource.long_name, {:tab => :violations, :rule => review.false_positive ? "false_positive_reviews" : ""}) %>
+        <% else %>
+          <%= review.resource.long_name -%>
+        <% end %>
       </td>
     </tr>
   </table>
     </div>
   <% end %>
 
+  <% if review.rule_failure || !review.comments.empty? %>
   <div class="discussion marginbottom10">
     <% if review.rule_failure %>
       <div class="discussionComment first">
       </div>
     <% end %>
   </div>
+  <% end %>
 
-  <% if current_user %>
+  <% if current_user && !review.closed? %>
     <%= button_to_remote message('reviews.comment'),
                          {
                            :url => {:controller => "project_reviews", :action => "comment_form", :id => review.id},
index d41b13667bf59f93d01d0af4562711c341dd470a..11d75bcb534454a972c8daeb6f7c726c38bd02ff 100644 (file)
@@ -59,7 +59,7 @@
           <td>
             <span class="nowrap"><%= review.project.name -%></span>
             <br/>
-            <span class="note"><%= review.resource.name -%></span></td>
+            <span class="note"><%= review.resource.name if review.resource -%></span></td>
           <td><%= review.assignee ? h(review.assignee.name) : '-' -%></td>
           <td><%= distance_of_time_in_words_to_now(review.updated_at) -%></td>
         </tr>