[ARVADOS] updated: 5f8a7ee855778644abf70e7058317891738d2ce1
Git user
git at public.curoverse.com
Fri Jun 2 17:32:34 EDT 2017
Summary of changes:
.../app/controllers/trash_items_controller.rb | 1 +
.../app/views/trash_items/_show_trash_items.html.erb | 6 +++---
.../app/views/trash_items/_show_trash_rows.html.erb | 8 ++++----
.../app/views/trash_items/_untrash_item.html.erb | 4 ++--
.../arvados/v1/collections_controller_test.rb | 18 ++++++++++++++++++
5 files changed, 28 insertions(+), 9 deletions(-)
via 5f8a7ee855778644abf70e7058317891738d2ce1 (commit)
from 88abf688d7545fc663e0422f0c586107d4c56e5a (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 5f8a7ee855778644abf70e7058317891738d2ce1
Author: radhika <radhika at curoverse.com>
Date: Fri Jun 2 17:31:04 2017 -0400
9587: sort order issue
diff --git a/apps/workbench/app/controllers/trash_items_controller.rb b/apps/workbench/app/controllers/trash_items_controller.rb
index bbc0b26..db3457c 100644
--- a/apps/workbench/app/controllers/trash_items_controller.rb
+++ b/apps/workbench/app/controllers/trash_items_controller.rb
@@ -12,6 +12,7 @@ class TrashItemsController < ApplicationController
trashed_items
if @objects.any?
+ @objects = @objects.sort_by { |obj| obj.created_at }.reverse
@next_page_filters = next_page_filters('<=')
@next_page_href = url_for(partial: :trash_rows,
filters: @next_page_filters.to_json)
diff --git a/apps/workbench/app/views/trash_items/_show_trash_items.html.erb b/apps/workbench/app/views/trash_items/_show_trash_items.html.erb
index 153d7d0..6776e7a 100644
--- a/apps/workbench/app/views/trash_items/_show_trash_items.html.erb
+++ b/apps/workbench/app/views/trash_items/_show_trash_items.html.erb
@@ -27,10 +27,10 @@
<colgroup>
<col width="5%" />
<col width="20%" />
+ <col width="15%" />
+ <col width="15%" />
<col width="10%" />
- <col width="10%" />
- <col width="10%" />
- <col width="40%" />
+ <col width="30%" />
<col width="5%" />
</colgroup>
diff --git a/apps/workbench/app/views/trash_items/_show_trash_rows.html.erb b/apps/workbench/app/views/trash_items/_show_trash_rows.html.erb
index d617d8d..8db21ed 100644
--- a/apps/workbench/app/views/trash_items/_show_trash_rows.html.erb
+++ b/apps/workbench/app/views/trash_items/_show_trash_rows.html.erb
@@ -1,4 +1,4 @@
-<% @objects.sort_by { |obj| obj.created_at }.reverse.each do |obj| %>
+<% @objects.each do |obj| %>
<tr data-object-uuid="<%= obj.uuid %>" data-kind="<%= obj.kind %>" >
<td>
<% if obj.editable? %>
@@ -8,9 +8,9 @@
<td>
<%= if !obj.name.blank? then obj.name else obj.uuid end %>
<td>
- <%= obj.created_at.to_s if obj.created_at %>
+ <%= render_localized_date(obj.created_at) if obj.created_at %>
<td>
- <%= obj.trash_at.to_s if obj.trash_at %>
+ <%= render_localized_date(obj.trash_at) if obj.trash_at %>
</td>
<td>
<%= link_to_if_arvados_object obj.owner_uuid, friendly_name: true %>
@@ -22,7 +22,7 @@
<%= file_path %><br />
<% end %>
<% if obj.files.length > 3 %>
- ⋮
+ <%= "(#{obj.files.length-3} more files)" %>
<% end %>
</td>
<td>
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 2ba9dc9..8732531 100644
--- a/apps/workbench/app/views/trash_items/_untrash_item.html.erb
+++ b/apps/workbench/app/views/trash_items/_untrash_item.html.erb
@@ -1,7 +1,7 @@
<% if object.editable? %>
- <% msg = "Un-trash '" + if !object.name.blank? then object.name else object.uuid end + "'?" %>
+ <% msg = "Untrash '" + 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 %>
+ title: "Untrash", data: {confirm: msg}) do %>
<i class="fa fa-fw fa-recycle"></i>
<% end %>
<% end %>
diff --git a/services/api/test/functional/arvados/v1/collections_controller_test.rb b/services/api/test/functional/arvados/v1/collections_controller_test.rb
index a31ad8a..7618985 100644
--- a/services/api/test/functional/arvados/v1/collections_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/collections_controller_test.rb
@@ -1024,4 +1024,22 @@ EOS
assert_operator c.delete_at, :>=, time_before_trashing + Rails.configuration.default_trash_lifetime
end
end
+
+ test 'untrash a trashed collection' do
+ authorize_with :active
+ post :untrash, {
+ id: collections(:expired_collection).uuid,
+ }
+ assert_response 200
+ assert_equal false, json_response['is_trashed']
+ assert_nil json_response['trash_at']
+ end
+
+ test 'untrash error on not trashed collection' do
+ authorize_with :active
+ post :untrash, {
+ id: collections(:collection_owned_by_active).uuid,
+ }
+ assert_response 422
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list