[ARVADOS] updated: 27355f62088566a9388972e128bfb8ba77790e9a
Git user
git at public.curoverse.com
Wed May 31 15:04:48 EDT 2017
Summary of changes:
.../app/controllers/trash_items_controller.rb | 6 ++---
apps/workbench/app/models/collection.rb | 3 +++
sdk/python/arvados/arvfile.py | 27 +++++++++++++++++-----
sdk/python/tests/test_arvfile.py | 4 ++--
sdk/python/tests/test_collections.py | 2 +-
.../arvados/v1/collections_controller.rb | 11 ++++++++-
services/api/config/routes.rb | 1 +
services/api/lib/crunch_dispatch.rb | 2 +-
services/api/test/unit/crunch_dispatch_test.rb | 2 +-
services/nodemanager/arvnodeman/jobqueue.py | 6 ++---
services/nodemanager/tests/test_jobqueue.py | 8 +++----
11 files changed, 50 insertions(+), 22 deletions(-)
via 27355f62088566a9388972e128bfb8ba77790e9a (commit)
via 65622f423c2ee35250856657b06118481d53edc8 (commit)
via 9da81b40a1c0e65f2459106a4718e4adcf7551c4 (commit)
via 028e052db597498ee5c1412b606fa178c621b3ca (commit)
via 31ef294c700811eae8ade8dfc5fcb7ec40d1ad2e (commit)
via 5931243d745188851c8240e3e766d97aafdf935c (commit)
via b5d352d6099b60db5dcdd9183dcab3e8e17d729e (commit)
via 8e1efc4c74f86a986dd0c6f15f53777d0d2bf0bb (commit)
via 1ceeafd5411b47834b836019dfd21d4050158171 (commit)
via 9d6fb27b6a0ef28062be37efdea20d1a4c7079d3 (commit)
via d094ae4ee58f26e0585445eccb3be2d019ab020f (commit)
via 3b12ef6b6d7ff6852f6109ab71dbec382322a686 (commit)
from 741a9b3912c382b25507ca76fae15ddac020f302 (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 27355f62088566a9388972e128bfb8ba77790e9a
Author: radhika <radhika at curoverse.com>
Date: Wed May 31 15:03:53 2017 -0400
9587: expose untrash api
diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb
index 5190474..7271fc1 100644
--- a/apps/workbench/app/controllers/trash_items_controller.rb
+++ b/apps/workbench/app/controllers/trash_items_controller.rb
@@ -77,9 +77,9 @@ class TrashItemsController < ApplicationController
updates = {trash_at: nil}
- params[:selection].collect { |uuid| ArvadosBase.find uuid }.each do |item|
- item.update_attributes updates
- @untrashed_uuids << item.uuid
+ Collection.include_trash(1).where(uuid: params[:selection]).each do |c|
+ c.untrash
+ @untrashed_uuids << c.uuid
end
respond_to do |format|
diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb
index ea81ad8..305ea01 100644
--- a/apps/workbench/app/models/collection.rb
+++ b/apps/workbench/app/models/collection.rb
@@ -98,4 +98,7 @@ class Collection < ArvadosBase
[ 'description' ]
end
+ def untrash
+ arvados_api_client.api(self.class, "/#{self.uuid}/untrash", {})
+ end
end
diff --git a/services/api/app/controllers/arvados/v1/collections_controller.rb b/services/api/app/controllers/arvados/v1/collections_controller.rb
index 8ba7925..73a7e09 100644
--- a/services/api/app/controllers/arvados/v1/collections_controller.rb
+++ b/services/api/app/controllers/arvados/v1/collections_controller.rb
@@ -12,7 +12,7 @@ class Arvados::V1::CollectionsController < ApplicationController
end
def find_objects_for_index
- if params[:include_trash] || ['destroy', 'trash'].include?(action_name)
+ if params[:include_trash] || ['destroy', 'trash', 'untrash'].include?(action_name)
@objects = Collection.readable_by(*@read_users).unscoped
end
super
@@ -63,6 +63,15 @@ class Arvados::V1::CollectionsController < ApplicationController
show
end
+ def untrash
+ if @object.is_trashed
+ @object.update_attributes!(trash_at: nil)
+ else
+ raise InvalidStateTransitionError
+ end
+ show
+ end
+
def find_collections(visited, sp, &b)
case sp
when ArvadosModel
diff --git a/services/api/config/routes.rb b/services/api/config/routes.rb
index 77e5372..87c4d91 100644
--- a/services/api/config/routes.rb
+++ b/services/api/config/routes.rb
@@ -21,6 +21,7 @@ Server::Application.routes.draw do
get 'provenance', on: :member
get 'used_by', on: :member
post 'trash', on: :member
+ post 'untrash', on: :member
end
resources :groups do
get 'contents', on: :collection
commit 65622f423c2ee35250856657b06118481d53edc8
Merge: 741a9b3 9da81b4
Author: radhika <radhika at curoverse.com>
Date: Wed May 31 13:33:54 2017 -0400
Merge branch 'master' into 9587-trash-page
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list