[ARVADOS] created: 1.1.1-160-gfbe39c0

Git user git at public.curoverse.com
Fri Dec 8 13:04:45 EST 2017


        at  fbe39c0c33a9c9c3451ad6bf8ec4b336e7e3b24f (commit)


commit fbe39c0c33a9c9c3451ad6bf8ec4b336e7e3b24f
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Fri Dec 8 12:40:39 2017 -0500

    12765: Fix untrash button on 404 page.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb
index 94a6520..61cbd67 100644
--- a/apps/workbench/app/views/application/404.html.erb
+++ b/apps/workbench/app/views/application/404.html.erb
@@ -23,13 +23,16 @@ SPDX-License-Identifier: AGPL-3.0 %>
     <% if object.respond_to?(:is_trashed) && object.is_trashed %>
       <% untrash_object = object %>
     <% else %>
-      <% owner = Group.where(uuid: object.owner_uuid).include_trash(true).first %>
-      <% while !owner.nil? && !owner.is_trashed %>
-        <% if !owner.nil? and owner.is_trashed then %>
+      <% owner = object %>
+      <% while true %>
+        <% owner = Group.where(uuid: owner.owner_uuid).include_trash(true).first %>
+        <% if owner.nil? %>
+          <% break %>
+        <% end %>
+        <% if owner.is_trashed %>
           <% untrash_object = owner %>
           <% break %>
         <% end %>
-        <% owner = Group.where(uuid: owner.owner_uuid).include_trash(true).first %>
       <% end %>
     <% end %>
   <% end %>

commit fed9f70cdc99a3bc94a54bf1d182b13204a597be
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Fri Dec 8 09:52:10 2017 -0500

    12765: Add test for untrash on 404 page
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/apps/workbench/app/views/application/404.html.erb b/apps/workbench/app/views/application/404.html.erb
index 283f5d5..94a6520 100644
--- a/apps/workbench/app/views/application/404.html.erb
+++ b/apps/workbench/app/views/application/404.html.erb
@@ -16,20 +16,26 @@ SPDX-License-Identifier: AGPL-3.0 %>
    end
 %>
 
-  <% if check_trash.andand.any? %>
-    <h2>Trashed</h2>
-
-      <% object = check_trash.first %>
+  <% untrash_object = nil %>
 
+  <% if check_trash.andand.any? %>
+    <% object = check_trash.first %>
+    <% if object.respond_to?(:is_trashed) && object.is_trashed %>
       <% untrash_object = object %>
-      <% while !untrash_object.is_trashed %>
-        <% owner = Group.where(uuid: untrash_object.owner_uuid).include_trash(true).first %>
-        <% if owner.nil? then %>
-          <% break %>
-        <% else %>
+    <% else %>
+      <% owner = Group.where(uuid: object.owner_uuid).include_trash(true).first %>
+      <% while !owner.nil? && !owner.is_trashed %>
+        <% if !owner.nil? and owner.is_trashed then %>
           <% untrash_object = owner %>
+          <% break %>
         <% end %>
+        <% owner = Group.where(uuid: owner.owner_uuid).include_trash(true).first %>
       <% end %>
+    <% end %>
+  <% end %>
+
+  <% if !untrash_object.nil? %>
+    <h2>Trashed</h2>
 
       <% untrash_name = if !untrash_object.name.blank? then
                  "'#{untrash_object.name}'"
diff --git a/apps/workbench/test/integration/errors_test.rb b/apps/workbench/test/integration/errors_test.rb
index f9054d0..81d4bbb 100644
--- a/apps/workbench/test/integration/errors_test.rb
+++ b/apps/workbench/test/integration/errors_test.rb
@@ -112,4 +112,17 @@ class ErrorsTest < ActionDispatch::IntegrationTest
     # out of the popup now and should be back in the error page
     assert_text 'fiddlesticks'
   end
+
+  test "showing a trashed collection UUID gives untrash button" do
+    visit(page_with_token("active", "/collections/zzzzz-4zz18-trashedproj2col"))
+    assert(page.has_text?(/You must untrash the owner project to access this/i),
+           "missing untrash instructions")
+  end
+
+  test "showing a trashed container request gives untrash button" do
+    visit(page_with_token("active", "/container_requests/zzzzz-xvhdp-cr5trashedcontr"))
+    assert(page.has_text?(/You must untrash the owner project to access this/i),
+           "missing untrash instructions")
+  end
+
 end
diff --git a/services/api/test/fixtures/container_requests.yml b/services/api/test/fixtures/container_requests.yml
index 836f840..85e40ff 100644
--- a/services/api/test/fixtures/container_requests.yml
+++ b/services/api/test/fixtures/container_requests.yml
@@ -743,6 +743,28 @@ uncommitted-with-required-and-optional-inputs:
     ram: 256000000
     API: true
 
+cr_in_trashed_project:
+  uuid: zzzzz-xvhdp-cr5trashedcontr
+  owner_uuid: zzzzz-j7d0g-trashedproject1
+  name: completed container request
+  state: Final
+  priority: 1
+  created_at: <%= 2.minute.ago.to_s(:db) %>
+  updated_at: <%= 1.minute.ago.to_s(:db) %>
+  modified_at: <%= 1.minute.ago.to_s(:db) %>
+  modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
+  container_image: test
+  cwd: test
+  output_path: test
+  command: ["echo", "hello"]
+  container_uuid: zzzzz-dz642-compltcontainer
+  log_uuid: zzzzz-4zz18-y9vne9npefyxh8g
+  output_uuid: zzzzz-4zz18-znfnqtbbv4spc3w
+  runtime_constraints:
+    vcpus: 1
+    ram: 123
+
+
 # Test Helper trims the rest of the file
 
 # Do not add your fixtures below this line as the rest of this file will be trimmed by test_helper

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list