[ARVADOS] updated: 0274800af0b90207c64b6982a5b78384c9f04bf5

git at public.curoverse.com git at public.curoverse.com
Wed May 21 11:38:42 EDT 2014


Summary of changes:
 .../app/controllers/collections_controller.rb      |  87 ++++++-----------
 apps/workbench/app/helpers/application_helper.rb   |  12 +++
 .../app/views/collections/_show_jobs.html.erb      |  64 -------------
 .../views/collections/_show_provenance.html.erb    |  84 -----------------
 .../views/collections/_show_source_data.html.erb   |  44 ---------
 apps/workbench/app/views/collections/show.html.erb | 105 +++++++++++++++++++++
 .../app/views/collections/show_file_links.html.erb |  45 ++++++---
 apps/workbench/app/views/folders/show.html.erb     |  60 ++++++------
 .../test/functional/collections_controller_test.rb |  47 ++++++++-
 services/api/test/fixtures/jobs.yml                |   2 +-
 services/api/test/fixtures/logs.yml                |   5 +
 11 files changed, 260 insertions(+), 295 deletions(-)
 delete mode 100644 apps/workbench/app/views/collections/_show_jobs.html.erb
 delete mode 100644 apps/workbench/app/views/collections/_show_provenance.html.erb
 delete mode 100644 apps/workbench/app/views/collections/_show_source_data.html.erb
 create mode 100644 apps/workbench/app/views/collections/show.html.erb

       via  0274800af0b90207c64b6982a5b78384c9f04bf5 (commit)
       via  22f1aef9b47f6d8eb190cfada1878d499c031625 (commit)
       via  2768b056f5d99952d2d2c4ba8cd1dfbb898901e3 (commit)
       via  c965f26c02b0f358eccf6989e49703d173206486 (commit)
       via  f1a04b3e3c61cc92501d18863ccf0abb162f9855 (commit)
       via  6d1b822d5a168166deb44d4256bf0abcfd618c67 (commit)
       via  9cdf7a2f51489403a488c3d06cf252a36b8e4198 (commit)
      from  ee73fe1721723da22514b60bd639b72c059fe05b (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 0274800af0b90207c64b6982a5b78384c9f04bf5
Merge: 22f1aef 2768b05
Author: Brett Smith <brett at curoverse.com>
Date:   Wed May 21 11:35:00 2014 -0400

    Merge branch 'master' into 2764-wget-collections-wip
    
    Conflicts:
    	apps/workbench/test/functional/collections_controller_test.rb

diff --cc apps/workbench/app/controllers/collections_controller.rb
index 501484f,656c063..180e1d0
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@@ -1,9 -1,10 +1,11 @@@
  class CollectionsController < ApplicationController
 -  skip_around_filter :thread_with_mandatory_api_token, only: [:show_file]
 -  skip_before_filter :find_object_by_uuid, only: [:provenance, :show_file]
 -  skip_before_filter :check_user_agreements, only: [:show_file]
 +  skip_around_filter(:thread_with_mandatory_api_token,
 +                     only: [:show_file, :show_file_links])
 +  skip_before_filter(:find_object_by_uuid,
 +                     only: [:provenance, :show_file, :show_file_links])
  
+   RELATION_LIMIT = 5
+ 
    def show_pane_list
      %w(Files Attributes Metadata Provenance_graph Used_by JSON API)
    end
diff --cc apps/workbench/test/functional/collections_controller_test.rb
index 5fc2780,7a15161..f4e7a30
--- a/apps/workbench/test/functional/collections_controller_test.rb
+++ b/apps/workbench/test/functional/collections_controller_test.rb
@@@ -49,16 -53,66 +53,51 @@@ class CollectionsControllerTest < Actio
      assert_equal([['.', 'foo', 3]], assigns(:object).files)
    end
  
 +  test "viewing collection files with a reader token" do
 +    params = collection_params(:foo_file)
 +    params[:reader_token] =
 +      api_fixture('api_client_authorizations')['active']['api_token']
 +    get(:show_file_links, params)
 +    assert_response :success
 +    assert_equal([['.', 'foo', 3]], assigns(:object).files)
 +    assert_no_session
 +  end
 +
+   test "viewing a collection fetches related folders" do
+     show_collection(:foo_file, :active)
+     assert_includes(assigns(:folders).map(&:uuid),
+                     api_fixture('groups')['afolder']['uuid'],
+                     "controller did not find linked folder")
+   end
+ 
+   test "viewing a collection fetches related permissions" do
+     show_collection(:bar_file, :active)
+     assert_includes(assigns(:permissions).map(&:uuid),
+                     api_fixture('links')['bar_file_readable_by_active']['uuid'],
+                     "controller did not find permission link")
+   end
+ 
+   test "viewing a collection fetches jobs that output it" do
+     show_collection(:bar_file, :active)
+     assert_includes(assigns(:output_of).map(&:uuid),
+                     api_fixture('jobs')['foobar']['uuid'],
+                     "controller did not find output job")
+   end
+ 
+   test "viewing a collection fetches jobs that logged it" do
+     show_collection(:baz_file, :active)
+     assert_includes(assigns(:log_of).map(&:uuid),
+                     api_fixture('jobs')['foobar']['uuid'],
+                     "controller did not find logger job")
+   end
+ 
+   test "viewing a collection fetches logs about it" do
+     show_collection(:foo_file, :active)
+     assert_includes(assigns(:logs).map(&:uuid),
+                     api_fixture('logs')['log4']['uuid'],
+                     "controller did not find related log")
+   end
+ 
 -  test "viewing a collection with a reader token" do
 -    params = collection_params(:foo_file)
 -    params[:reader_tokens] =
 -      [api_fixture('api_client_authorizations')['active']['api_token']]
 -    show_collection(params)
 -    assert_equal([['.', 'foo', 3]], assigns(:object).files)
 -    assert_no_session
 -  end
 -
 -  test "viewing the index with a reader token" do
 -    params = {reader_tokens:
 -      [api_fixture('api_client_authorizations')['spectator']['api_token']]
 -    }
 -    get(:index, params)
 -    assert_response :success
 -    assert_no_session
 -    listed_collections = assigns(:collections).map { |c| c.uuid }
 -    assert_includes(listed_collections,
 -                    api_fixture('collections')['bar_file']['uuid'],
 -                    "spectator reader token didn't list bar file")
 -    refute_includes(listed_collections,
 -                    api_fixture('collections')['foo_file']['uuid'],
 -                    "spectator reader token listed foo file")
 -  end
 -
    test "getting a file from Keep" do
      params = collection_params(:foo_file, 'foo')
      sess = session_for(:active)

commit 22f1aef9b47f6d8eb190cfada1878d499c031625
Author: Brett Smith <brett at curoverse.com>
Date:   Wed May 21 11:30:44 2014 -0400

    2764: Add information to the Collection download page.

diff --git a/apps/workbench/app/views/collections/show_file_links.html.erb b/apps/workbench/app/views/collections/show_file_links.html.erb
index 9d61a6a..efc1d01 100644
--- a/apps/workbench/app/views/collections/show_file_links.html.erb
+++ b/apps/workbench/app/views/collections/show_file_links.html.erb
@@ -1,27 +1,43 @@
 <!DOCTYPE html>
 <html>
+<% coll_name = (@object.name =~ /\S/) ? @object.name : "Collection #{@object.uuid}" %>
+<% link_opts = {controller: 'collections', action: 'show_file',
+                uuid: @object.uuid, reader_token: params[:reader_token]} %>
 <head>
   <meta charset="utf-8">
   <title>
-    <% if content_for? :page_title %>
-    <%= yield :page_title %> / <%= Rails.configuration.site_name %>
-    <% else %>
-    <%= Rails.configuration.site_name %>
-    <% end %>
+    <%= coll_name %> / <%= Rails.configuration.site_name %>
   </title>
   <meta name="description" content="">
   <meta name="author" content="">
   <meta name="robots" content="NOINDEX">
+  <style type="text/css">
+body {
+  margin: 1.5em;
+}
+pre {
+  background-color: #D9EDF7;
+  border-radius: .25em;
+  padding: .75em;
+  overflow: auto;
+}
+  </style>
 </head>
 <body>
-<% content_for :page_title do %>
-  <%= (@object.respond_to?(:properties) ? @object.properties[:page_title] : nil) ||
-        @object.friendly_link_name %>
-<% end %>
+
+<h1><%= coll_name %></h1>
+
+<p>This collection of data files is being shared with you through
+Arvados.  You can download individual files listed below.  To download
+the entire collection with wget, try:</p>
+
+<pre>$ wget -m -np -nH --cut-dirs=3 <%=
+         url_for(link_opts.merge(action: 'show_file_links', only_path: false))
+       %></pre>
+
+<h2>File Listing</h2>
 
 <% if @object.andand.files.andand.any? %>
-  <% link_opts = {controller: 'collections', action: 'show_file',
-                  uuid: @object.uuid, reader_token: params[:reader_token]} %>
   <ul>
   <% @object.files.map { |spec|
        CollectionsHelper::file_path(spec)
@@ -32,5 +48,12 @@
 <% else %>
   <p>No files in this collection.</p>
 <% end %>
+
+<h2>About Arvados</h2>
+
+<p>Arvados is a free and open source software bioinformatics platform.
+To learn more, visit arvados.org.
+Arvados is not responsible for the files listed on this page.</p>
+
 </body>
 </html>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list