[ARVADOS] updated: 5a625a53394fa99ef7fb44ab63104b8195d963df

Git user git at public.curoverse.com
Wed May 31 17:17:30 EDT 2017


Summary of changes:
 .../app/controllers/trash_items_controller.rb      | 35 +++-------------------
 .../app/views/trash_items/_untrash_item.html.erb   |  4 ++-
 2 files changed, 7 insertions(+), 32 deletions(-)

       via  5a625a53394fa99ef7fb44ab63104b8195d963df (commit)
      from  9ff2df8cfa1f0798c22e4b3c6ef91d4677961295 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5a625a53394fa99ef7fb44ab63104b8195d963df
Author: radhika <radhika at curoverse.com>
Date:   Wed May 31 17:16:48 2017 -0400

    9587: cleanup trashed_items method

diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb
index 7271fc1..bbc0b26 100644
--- a/apps/workbench/app/controllers/trash_items_controller.rb
+++ b/apps/workbench/app/controllers/trash_items_controller.rb
@@ -15,7 +15,6 @@ class TrashItemsController < ApplicationController
       @next_page_filters = next_page_filters('<=')
       @next_page_href = url_for(partial: :trash_rows,
                                 filters: @next_page_filters.to_json)
-      preload_links_for_objects(@objects.to_a)
     else
       @next_page_href = nil
     end
@@ -37,39 +36,13 @@ class TrashItemsController < ApplicationController
 
     if params[:search].andand.length.andand > 0
       tags = Link.where(any: ['contains', params[:search]])
-      @objects = (base_search.limit(limit).offset(offset).where(uuid: tags.collect(&:head_uuid)) |
-                      base_search.where(any: ['contains', params[:search]])).
-        uniq { |c| c.uuid }
+      base_search = base_search.limit(limit).offset(offset)
+      @objects = (base_search.where(uuid: tags.collect(&:head_uuid)) |
+                  base_search.where(any: ['contains', params[:search]])).
+                  uniq { |c| c.uuid }
     else
       @objects = base_search.limit(limit).offset(offset)
     end
-
-    @links = Link.where(head_uuid: @objects.collect(&:uuid))
-    @collection_info = {}
-    @objects.each do |c|
-      @collection_info[c.uuid] = {
-        tag_links: [],
-        wanted: false,
-        wanted_by_me: false,
-        provenance: [],
-        links: []
-      }
-    end
-    @links.each do |link|
-      @collection_info[link.head_uuid] ||= {}
-      info = @collection_info[link.head_uuid]
-      case link.link_class
-      when 'tag'
-        info[:tag_links] << link
-      when 'resources'
-        info[:wanted] = true
-        info[:wanted_by_me] ||= link.tail_uuid == current_user.uuid
-      when 'provenance'
-        info[:provenance] << link.name
-      end
-      info[:links] << link
-    end
-    @request_url = request.url
   end
 
   def untrash_items
diff --git a/apps/workbench/app/views/trash_items/_untrash_item.html.erb b/apps/workbench/app/views/trash_items/_untrash_item.html.erb
index a40a4be..2ba9dc9 100644
--- a/apps/workbench/app/views/trash_items/_untrash_item.html.erb
+++ b/apps/workbench/app/views/trash_items/_untrash_item.html.erb
@@ -1,5 +1,7 @@
 <% if object.editable? %>
-  <%= link_to({action: 'untrash_items', selection: [object.uuid]}, remote: true, method: :post, data: {confirm: "Un-trash #{object.class_for_display.downcase} '#{object.friendly_link_name}'?"}) do %>
+  <% msg = "Un-trash '" + if !object.name.blank? then object.name else object.uuid end + "'?" %>
+  <%= link_to({action: 'untrash_items', selection: [object.uuid]}, remote: true, method: :post,
+      data: {confirm: msg}) do %>
     <i class="fa fa-fw fa-recycle"></i>
   <% end %>
 <% end %>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list