Merge branch '9804-drop-activity-pane'
authorLucas Di Pentima <lucas@curoverse.com>
Tue, 23 Aug 2016 22:41:05 +0000 (19:41 -0300)
committerLucas Di Pentima <lucas@curoverse.com>
Tue, 23 Aug 2016 22:41:05 +0000 (19:41 -0300)
9804: Deleted activity pane from Workbench's collection view, a couple of queries that became unused on collection controller and updated the related tests. Closes #9804.

apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/views/collections/show.html.erb
apps/workbench/test/controllers/collections_controller_test.rb
apps/workbench/test/integration_performance/collections_perf_test.rb

index 7a002427cfe97b0418b6f8cda2a671dd0148c10f..20b227c3c7277d491c74b96c0f5de7bc415c0f4c 100644 (file)
@@ -253,13 +253,6 @@ class CollectionsController < ApplicationController
         @permissions = Link.limit(RELATION_LIMIT).order("modified_at DESC")
           .where(head_uuid: @object.uuid, link_class: 'permission',
                  name: 'can_read').results
-        @logs = Log.limit(RELATION_LIMIT).order("created_at DESC")
-          .select(%w(uuid event_type object_uuid event_at summary))
-          .where(object_uuid: @object.uuid).results
-        @is_persistent = Link.limit(1)
-          .where(head_uuid: @object.uuid, tail_uuid: current_user.uuid,
-                 link_class: 'resources', name: 'wants')
-          .results.any?
         @search_sharing = search_scopes
 
         if params["tab_pane"] == "Used_by"
index c6bad7d3aa3d865d576c98f9bb4b360aaafe0882..f0af963c2a270ee89b2eaa160223f0640c902088 100644 (file)
@@ -1,5 +1,5 @@
 <div class="row row-fill-height">
-  <div class="col-md-6">
+  <div class="col-md-7">
     <div class="panel panel-info">
       <div class="panel-heading">
         <h3 class="panel-title">
       </div>
     </div>
   </div>
-  <div class="col-md-3">
-    <div class="panel panel-default">
-      <div class="panel-heading">
-        <h3 class="panel-title">
-          Activity
-        </h3>
-      </div>
-      <div class="panel-body smaller-text">
-        <!--
-        <input type="text" class="form-control" placeholder="Search"/>
-        -->
-        <div style="height:0.5em;"></div>
-        <% name_or_object = @name_link.andand.uuid ? @name_link : @object %>
-        <% if name_or_object.created_at and not @logs.andand.any? %>
-          <p>
-            Created: <%= name_or_object.created_at.to_s(:long) if name_or_object.created_at %>
-          </p>
-          <p>
-            Last modified: <%= name_or_object.modified_at.to_s(:long) if name_or_object.modified_at %> by <%= link_to_if_arvados_object name_or_object.modified_by_user_uuid, friendly_name: true %>
-          </p>
-        <% else %>
-          <%= render_arvados_object_list_start(@logs, 'Show all activity',
-                logs_path(filters: [['object_uuid','=',name_or_object.uuid]].to_json)) do |log| %>
-          <p>
-          <%= time_ago_in_words(log.event_at) rescue 'unknown time' %> ago: <%= log.summary %>
-            <% if log.object_uuid %>
-            <%= link_to_if_arvados_object log.object_uuid, link_text: raw('<i class="fa fa-hand-o-right"></i>') %>
-            <% end %>
-          </p>
-          <% end %>
-        <% end %>
-      </div>
-    </div>
-  </div>
   <% if current_user %>
-  <div class="col-md-3">
+  <div class="col-md-5">
     <div class="panel panel-default">
       <div class="panel-heading">
         <h3 class="panel-title">
     </div>
   </div>
   <% else %>
-  <div class="col-md-3">
+  <div class="col-md-5">
     <div class="panel panel-default">
       <div class="panel-heading">
         <h3 class="panel-title">
index 45aab3c8575dd94f801536a25cfe6dbb18f2f43c..1bf967ccfd8c1e8e2da60a10db81b7e241d70fa9 100644 (file)
@@ -112,13 +112,6 @@ class CollectionsControllerTest < ActionController::TestCase
                     "controller did not find logger job")
   end
 
-  test "viewing a collection fetches logs about it" do
-    show_collection(:foo_file, :active)
-    assert_includes(assigns(:logs).map(&:uuid),
-                    api_fixture('logs')['system_adds_foo_file']['uuid'],
-                    "controller did not find related log")
-  end
-
   test "sharing auths available to admin" do
     show_collection("collection_owned_by_active", "admin_trustedclient")
     assert_not_nil assigns(:search_sharing)
index 3adece15c53b8f9fc134fda2e53d1d8d2ae02083..8b51b3fa7de791a23e129005ad51de01c597b769 100644 (file)
@@ -42,7 +42,7 @@ class CollectionsPerfTest < ActionDispatch::IntegrationTest
       visit page_with_token('active', "/collections/#{new_collection.uuid}")
       Rails.logger.info "Done visiting collection at #{Time.now.to_f}"
 
-      assert_text new_collection.uuid
+      assert_selector "input[value=\"#{new_collection.uuid}\"]"
       assert(page.has_link?('collection_file_name_with_prefix_0'), "Collection page did not include file link")
     end
   end
@@ -62,7 +62,7 @@ class CollectionsPerfTest < ActionDispatch::IntegrationTest
       visit page_with_token('active', "/collections/#{new_collection.uuid}")
       Rails.logger.info "Done visiting collection at #{Time.now.to_f}"
 
-      assert_text new_collection.uuid
+      assert_selector "input[value=\"#{new_collection.uuid}\"]"
       assert(page.has_link?('collection_file_name_with_prefix_0'), "Collection page did not include file link")
 
       # edit description