[ARVADOS] updated: 1a72b1b7b46d771129c1ec93221a5934fa33ef75

git at public.curoverse.com git at public.curoverse.com
Tue Jan 6 12:13:51 EST 2015


Summary of changes:
 apps/workbench/app/assets/javascripts/infinite_scroll.js |  4 ++++
 apps/workbench/test/integration/projects_test.rb         | 11 +++++++++++
 apps/workbench/test/integration_helper.rb                |  6 ++++--
 3 files changed, 19 insertions(+), 2 deletions(-)

       via  1a72b1b7b46d771129c1ec93221a5934fa33ef75 (commit)
       via  edf4ea276c364012127de71a29bad6bf23b1f5da (commit)
      from  9013faf477b5862cb915f1d80148daffa795cc89 (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 1a72b1b7b46d771129c1ec93221a5934fa33ef75
Merge: 9013faf edf4ea2
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Jan 6 12:12:27 2015 -0500

    Merge branch '4836-first-tab-load-wip'
    
    Closes #4836, #4870.


commit edf4ea276c364012127de71a29bad6bf23b1f5da
Author: Brett Smith <brett at curoverse.com>
Date:   Fri Dec 19 17:40:13 2014 -0500

    4836: Trigger Workbench infinite scroll load on tab show.
    
    If an infinite scroller is in the first tab of a show page, but the
    user is going to a different tab, we'll queue up the first event
    to load data for the container, but when it fires the container won't
    be visible so it will decline to load anything.  Then you can only get
    data to load if you resize the window.
    
    Fire a scroll event when a new tab is shown, to spur the infinite
    scroller to load data as appropriate.

diff --git a/apps/workbench/app/assets/javascripts/infinite_scroll.js b/apps/workbench/app/assets/javascripts/infinite_scroll.js
index 7bdf574..d7ad41a 100644
--- a/apps/workbench/app/assets/javascripts/infinite_scroll.js
+++ b/apps/workbench/app/assets/javascripts/infinite_scroll.js
@@ -225,6 +225,10 @@ $(document).
                 trigger('scroll');
         });
     }).
+    on('shown.bs.tab', 'a[data-toggle="tab"]', function(event) {
+        $(event.target.getAttribute('href') + ' [data-infinite-scroller]').
+            trigger('scroll');
+    }).
     on('click', 'th[data-sort-order]', function() {
         var direction = $(this).data('sort-order-direction');
         // reverse the current direction, or do ascending if none
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index 97e1a54..e5aa791 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -744,4 +744,15 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     assert match, 'Expected project name not found'
     assert_text 'No description provided'
   end
+
+  test "first tab loads data when visiting other tab directly" do
+    # As of 2014-12-19, the first tab of project#show uses infinite scrolling.
+    # Make sure that it loads data even if we visit another tab directly.
+    project = api_fixture("groups", "aproject")
+    visit(page_with_token("active_trustedclient",
+                          "/projects/#{project['uuid']}#Advanced"))
+    assert_text("API response")
+    find("#page-wrapper .nav-tabs :first-child a").click
+    assert_text("bytes Collection")
+  end
 end
diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb
index febcfcf..2cf6bca 100644
--- a/apps/workbench/test/integration_helper.rb
+++ b/apps/workbench/test/integration_helper.rb
@@ -32,9 +32,11 @@ class ActionDispatch::IntegrationTest
     # fixture, or passed as a raw string.
     api_token = ((@@API_AUTHS.include? token) ?
                  @@API_AUTHS[token]['api_token'] : token)
-    sep = (path.include? '?') ? '&' : '?'
+    path_parts = path.partition("#")
+    sep = (path_parts.first.include? '?') ? '&' : '?'
     q_string = URI.encode_www_form('api_token' => api_token)
-    "#{path}#{sep}#{q_string}"
+    path_parts.insert(1, "#{sep}#{q_string}")
+    path_parts.join("")
   end
 
   # Find a page element, but return false instead of raising an

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list