[ARVADOS] updated: 648bcf7dda3a68d09bec6f7d6473c8996697f7cd
git at public.curoverse.com
git at public.curoverse.com
Sun Apr 26 18:02:21 EDT 2015
Summary of changes:
.../app/controllers/collections_controller.rb | 23 ++++++++++++++++-----
.../{projects => application}/tab_counts.js.erb | 0
.../views/collections/_show_contents_rows.html.erb | 1 -
apps/workbench/app/views/collections/show.html.erb | 4 +++-
apps/workbench/config/routes.rb | 1 +
.../workbench/test/integration/collections_test.rb | 24 ++++++++++++++++++++++
crunch_scripts/run-command | 2 +-
sdk/python/tests/run_test_server.py | 2 +-
8 files changed, 48 insertions(+), 9 deletions(-)
rename apps/workbench/app/views/{projects => application}/tab_counts.js.erb (100%)
via 648bcf7dda3a68d09bec6f7d6473c8996697f7cd (commit)
via 7f430fb09f6a472a2a167b220c276ab274acd7bc (commit)
via 1d9bae1d73e6ba5393d0dbed2988e1fbd8fc12b0 (commit)
via 05250216959cd8cd7bf2817b0ee13f028e1855af (commit)
via 749b87143ebb0bdcbe2d49deee9c66f6de9f86dd (commit)
via 9e0100cee5825584ff7ed6342bf661c026a8bc1d (commit)
from 0260d6ee3a9135550e6ab7b04b85d2c79dd56c9a (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 648bcf7dda3a68d09bec6f7d6473c8996697f7cd
Author: Radhika Chippada <radhika at curoverse.com>
Date: Sun Apr 26 18:01:25 2015 -0400
5622: add test for infinite scrolling for hash matches page.
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 9d8932f..badb38a 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -18,10 +18,13 @@ class CollectionsController < ApplicationController
RELATION_LIMIT = 5
def show_pane_list
- return @panes if @panes.andand.any?
- @panes = %w(Files Upload Provenance_graph Used_by Advanced)
- @panes = @panes - %w(Upload) unless (@object.editable? rescue false)
- @panes
+ if current_user and CollectionsHelper.match(@object.uuid)
+ panes = %w(Hash_matches)
+ else
+ panes = %w(Files Upload Provenance_graph Used_by Advanced)
+ panes = panes - %w(Upload) unless (@object.editable? rescue false)
+ panes
+ end
end
def set_persistent
@@ -238,7 +241,6 @@ class CollectionsController < ApplicationController
end
# This pdh has more than one uuid matching. Show the hash matches page listing those uuids.
- @panes = %w(Hash_matches)
else
jobs_with = lambda do |conds|
Job.limit(RELATION_LIMIT).where(conds)
@@ -277,11 +279,14 @@ class CollectionsController < ApplicationController
end
def tab_counts
- @limit = 1
- @filters = [["portable_data_hash", "=", @object.portable_data_hash]]
- @objects = find_objects_for_index
@tab_counts = {}
- @tab_counts['Hash_matches'] = @objects.andand.items_available
+ if show_pane_list.include? "Hash_matches"
+ @limit = 1
+ @filters = [["portable_data_hash", "=", @object.portable_data_hash]]
+ @objects = find_objects_for_index
+ @tab_counts['Hash_matches'] = @objects.andand.items_available
+ end
+ @tab_counts
end
def sharing_popup
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 96e1d47..25998cc 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -225,6 +225,30 @@ class CollectionsTest < ActionDispatch::IntegrationTest
assert page.has_no_text?("Sharing and permissions")
end
+ test "Collection portable data hash with more than one page of multiple matches" do
+ pdh = api_fixture('collections')['baz_file']['portable_data_hash']
+ visit page_with_token('admin', "/collections/#{pdh}")
+
+ matches = api_fixture('collections').select {|k,v| v["portable_data_hash"] == pdh}
+ assert matches.size > 1
+
+ (0..10).each do
+ within(".arv-collection-Hash_matches") do
+ page.execute_script "window.scrollBy(0,999000)"
+ begin
+ wait_for_ajax
+ rescue
+ end
+ end
+ end
+
+ matches.each do |k,v|
+ assert page.has_link?(v["name"]), "Page /collections/#{pdh} should contain link '#{v['name']}'"
+ end
+ assert page.has_no_text?("Activity")
+ assert page.has_no_text?("Sharing and permissions")
+ end
+
test "Filtering collection files by regexp" do
col = api_fixture('collections', 'multilevel_collection_1')
visit page_with_token('active', "/collections/#{col['uuid']}")
commit 7f430fb09f6a472a2a167b220c276ab274acd7bc
Author: Radhika Chippada <radhika at curoverse.com>
Date: Sun Apr 26 16:41:59 2015 -0400
5622: add tab_counts to hash_matches tab
diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index b1e5014..9d8932f 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -276,6 +276,14 @@ class CollectionsController < ApplicationController
super
end
+ def tab_counts
+ @limit = 1
+ @filters = [["portable_data_hash", "=", @object.portable_data_hash]]
+ @objects = find_objects_for_index
+ @tab_counts = {}
+ @tab_counts['Hash_matches'] = @objects.andand.items_available
+ end
+
def sharing_popup
@search_sharing = search_scopes
render("sharing_popup.js", content_type: "text/javascript")
diff --git a/apps/workbench/app/views/projects/tab_counts.js.erb b/apps/workbench/app/views/application/tab_counts.js.erb
similarity index 100%
rename from apps/workbench/app/views/projects/tab_counts.js.erb
rename to apps/workbench/app/views/application/tab_counts.js.erb
diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 74133df..34c5575 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -1,4 +1,6 @@
-<% if !CollectionsHelper.match(params['uuid']) %> <%# not pdh %>
+<% if !current_user or # anonymous user collection#show
+ !CollectionsHelper.match(params['uuid']) %> <%# not pdh
+%>
<div class="row row-fill-height">
<div class="col-md-6">
<div class="panel panel-info">
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 44d7ded..ea99225 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -71,6 +71,7 @@ ArvadosWorkbench::Application.routes.draw do
post 'share', :on => :member
post 'unshare', :on => :member
get 'choose', on: :collection
+ get 'tab_counts', on: :member
end
get('/collections/download/:uuid/:reader_token/*file' => 'collections#show_file',
format: false)
commit 1d9bae1d73e6ba5393d0dbed2988e1fbd8fc12b0
Merge: 0525021 749b871
Author: Radhika Chippada <radhika at curoverse.com>
Date: Sat Apr 25 21:59:24 2015 -0400
Merge branch 'master' into 5622-pdh-collections-page-paging
commit 05250216959cd8cd7bf2817b0ee13f028e1855af
Author: Radhika Chippada <radhika at curoverse.com>
Date: Sat Apr 25 21:58:25 2015 -0400
5622: white space
diff --git a/apps/workbench/app/views/collections/_show_contents_rows.html.erb b/apps/workbench/app/views/collections/_show_contents_rows.html.erb
index 3a0b660..111c048 100644
--- a/apps/workbench/app/views/collections/_show_contents_rows.html.erb
+++ b/apps/workbench/app/views/collections/_show_contents_rows.html.erb
@@ -11,4 +11,3 @@
</div>
</div>
<% end %>
-
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list