projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '2753-collection-tree-view'
[arvados.git]
/
apps
/
workbench
/
app
/
controllers
/
folders_controller.rb
diff --git
a/apps/workbench/app/controllers/folders_controller.rb
b/apps/workbench/app/controllers/folders_controller.rb
index e0ac625bab8a042a483b9eb56c74837cc16590b7..86ee42b10db54ecd389254d2470c210bc30c64e1 100644
(file)
--- a/
apps/workbench/app/controllers/folders_controller.rb
+++ b/
apps/workbench/app/controllers/folders_controller.rb
@@
-9,6
+9,7
@@
class FoldersController < ApplicationController
def remove_item
@removed_uuids = []
def remove_item
@removed_uuids = []
+ links = []
item = ArvadosBase.find params[:item_uuid]
if (item.class == Link and
item.link_class == 'name' and
item = ArvadosBase.find params[:item_uuid]
if (item.class == Link and
item.link_class == 'name' and
@@
-16,8
+17,15
@@
class FoldersController < ApplicationController
# Given uuid is a name link, linking an object to this
# folder. First follow the link to find the item we're removing,
# then delete the link.
# Given uuid is a name link, linking an object to this
# folder. First follow the link to find the item we're removing,
# then delete the link.
- link = item
- item = ArvadosBase.find link.head_uuid
+ links << item
+ item = ArvadosBase.find item.head_uuid
+ else
+ # Given uuid is an object. Delete all names.
+ links += Link.where(tail_uuid: @object.uuid,
+ head_uuid: item.uuid,
+ link_class: 'name')
+ end
+ links.each do |link|
@removed_uuids << link.uuid
link.destroy
end
@removed_uuids << link.uuid
link.destroy
end
@@
-57,7
+65,6
@@
class FoldersController < ApplicationController
@shared_with_me << folder
end
end
@shared_with_me << folder
end
end
- @object
end
def show
end
def show