[ARVADOS] updated: a0e70cf1da033f7d94e728ab919bd8cfcabf3743

git at public.curoverse.com git at public.curoverse.com
Wed Nov 12 16:07:48 EST 2014


Summary of changes:
 .../app/assets/javascripts/select_modal.js         |  39 +--
 .../app/controllers/application_controller.rb      |   1 +
 .../app/controllers/collections_controller.rb      |  39 +--
 apps/workbench/app/controllers/users_controller.rb |   6 +-
 apps/workbench/app/helpers/application_helper.rb   |   6 +-
 apps/workbench/app/models/arvados_api_client.rb    |   7 +-
 apps/workbench/app/models/arvados_base.rb          |   4 +-
 apps/workbench/app/models/arvados_resource_list.rb | 163 ++++++----
 .../app/views/application/_choose.html.erb         |   4 +-
 .../app/views/application/_paging.html.erb         |  22 +-
 .../app/views/collections/_choose_rows.html.erb    |  22 +-
 .../app/views/collections/_index_tbody.html.erb    |   2 +-
 .../collections/_show_chooser_preview.html.erb     |   2 +-
 .../app/views/collections/_show_files.html.erb     |  21 +-
 .../app/views/collections/_show_recent.html.erb    |   4 +-
 .../app/views/projects/_show_sharing.html.erb      |   3 +-
 .../workbench/app/views/users/_show_admin.html.erb |   2 +-
 .../test/unit/arvados_resource_list_test.rb        |  97 ++++--
 services/api/lib/load_param.rb                     |   7 +-
 .../arvados/v1/groups_controller_test.rb           |  67 ++--
 .../nodemanager/arvnodeman/computenode/__init__.py | 353 ---------------------
 .../computenode/{ => dispatch}/__init__.py         | 123 +------
 .../arvnodeman/computenode/driver/__init__.py      |  64 ++++
 .../arvnodeman/computenode/{ => driver}/dummy.py   |   3 +-
 .../arvnodeman/computenode/{ => driver}/ec2.py     |   3 +-
 services/nodemanager/arvnodeman/config.py          |   2 +-
 services/nodemanager/arvnodeman/daemon.py          |   7 +-
 services/nodemanager/arvnodeman/launcher.py        |   4 +-
 services/nodemanager/tests/test_computenode.py     | 279 ----------------
 ...computenode.py => test_computenode_dispatch.py} |  35 +-
 ...enode_ec2.py => test_computenode_driver_ec2.py} |   2 +-
 services/nodemanager/tests/test_daemon.py          |   4 +-
 32 files changed, 363 insertions(+), 1034 deletions(-)
 copy services/nodemanager/arvnodeman/computenode/{ => dispatch}/__init__.py (69%)
 create mode 100644 services/nodemanager/arvnodeman/computenode/driver/__init__.py
 rename services/nodemanager/arvnodeman/computenode/{ => driver}/dummy.py (96%)
 rename services/nodemanager/arvnodeman/computenode/{ => driver}/ec2.py (98%)
 copy services/nodemanager/tests/{test_computenode.py => test_computenode_dispatch.py} (89%)
 rename services/nodemanager/tests/{test_computenode_ec2.py => test_computenode_driver_ec2.py} (98%)

       via  a0e70cf1da033f7d94e728ab919bd8cfcabf3743 (commit)
       via  c28b9b91028c90497455bfde188915982377b825 (commit)
       via  8f9f0dece977ccf5a778f3b3bd2379375e723c18 (commit)
       via  b626a85eb86fd4909712852040cd305c71c37ee5 (commit)
       via  5141c3ee23e89696773e227a93236ef2a51543c2 (commit)
       via  45bfc1104dd30fb97a586de5ff96d6b739f7bb2b (commit)
       via  6bcb827b1405ce8ca5d767108bc4356ecc2972f4 (commit)
       via  093cebc3a4baed645fd5d4a5331c2ff837de8c77 (commit)
       via  91f0b180a8474321738577a12250b5a1b8f5bcbc (commit)
       via  0198b4937df2be79e41ea76ea6c31841441f4f2c (commit)
       via  fbd2326841005c1a288c65502dc038f26923ed65 (commit)
       via  0f9bca457448372de1d15dcd9ed4548c324ff14f (commit)
       via  3bbb988777079718338e3e6cb9c6c9b5399be800 (commit)
       via  83369774c123b427f519bd2a2229415fac383a6a (commit)
       via  2361a1b4d619a0f405f98c507cff6219b237bb2e (commit)
       via  47530892a8a6b174786316c3881e22dc0864c859 (commit)
       via  c1f7fd8aa615d4a91f919ce18a6085ae766a5517 (commit)
      from  76c9a858643680d90f9694d49c212a54fe5b759f (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 a0e70cf1da033f7d94e728ab919bd8cfcabf3743
Merge: c28b9b9 8f9f0de
Author: radhika <radhika at curoverse.com>
Date:   Wed Nov 12 15:47:27 2014 -0500

    Merge branch 'master' into 3177-collection-choose-files
    
    Conflicts:
    	apps/workbench/app/views/collections/_choose_rows.html.erb

diff --cc apps/workbench/app/views/collections/_choose_rows.html.erb
index 5165949,bafc2cc..17274dd
--- a/apps/workbench/app/views/collections/_choose_rows.html.erb
+++ b/apps/workbench/app/views/collections/_choose_rows.html.erb
@@@ -1,6 -1,6 +1,6 @@@
- <% @collections.each do |object| %>
+ <% @objects.each do |object| %>
 -    <div class="row filterable selectable" data-object-uuid="<%= object.uuid %>"
 -         data-preview-href="<%= chooser_preview_url_for object %>"
 +    <div class="row filterable selectable <%= 'use-preview-selection' if params['use_preview_selection']%>" data-object-uuid="<%= object.uuid %>"
 +         data-preview-href="<%= chooser_preview_url_for object, params['use_preview_selection'] %>"
           style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD">
        <i class="fa fa-fw fa-archive"></i>
        <% if object.respond_to? :name %>

commit c28b9b91028c90497455bfde188915982377b825
Author: radhika <radhika at curoverse.com>
Date:   Wed Nov 12 15:35:23 2014 -0500

    3177: in file chooser mode, allow row selection

diff --git a/apps/workbench/app/assets/javascripts/select_modal.js b/apps/workbench/app/assets/javascripts/select_modal.js
index d840377..160e8de 100644
--- a/apps/workbench/app/assets/javascripts/select_modal.js
+++ b/apps/workbench/app/assets/javascripts/select_modal.js
@@ -9,16 +9,18 @@ $(document).on('click', '.selectable', function() {
     }
     $this.toggleClass('active');
 
-    if (!$this.hasClass('use-checkbox-selection')) {
+    if (!$this.hasClass('use-preview-selection')) {
       any = ($container.
            find('.selectable.active').length > 0)
     }
-    $this.
+
+    if (!$container.hasClass('preview-selectable-container')) {
+      $this.
         closest('.modal').
         find('[data-enable-if-selection]').
         prop('disabled', !any);
 
-    if ($this.hasClass('active')) {
+      if ($this.hasClass('active')) {
         var no_preview_available = '<div class="spinner-h-center spinner-v-center"><center>(No preview available)</center></div>';
         if (!$this.attr('data-preview-href')) {
             $(".modal-dialog-preview-pane").html(no_preview_available);
@@ -33,21 +35,16 @@ $(document).on('click', '.selectable', function() {
             fail(function(data, status, jqxhr) {
                 $(".modal-dialog-preview-pane").html(no_preview_available);
             });
-    }
-}).on('click', '.persistent-selection', function() {
-    var checked_status = this.checked;
-    var $modal = $(this).closest('.modal');
-    $checked_selections = $modal.find('.persistent-selection:checked');
-
-    if (checked_status && ($checked_selections.length > 1)) {
-      $(this).prop('checked', false);
+      }
+    } else {
+      any = ($container.
+           find('.preview-selectable.active').length > 0)
+      $(this).
+          closest('.modal').
+          find('[data-enable-if-selection]').
+          prop('disabled', !any);
     }
 
-    any = ($checked_selections.length > 0);
-    $(this).
-        closest('.modal').
-        find('[data-enable-if-selection]').
-        prop('disabled', !any);
 }).on('click', '.modal button[data-action-href]', function() {
     var selection = [];
     var data = [];
@@ -57,14 +54,12 @@ $(document).on('click', '.selectable', function() {
     var selection_param = action_data.selection_param;
     $modal.find('.modal-error').removeClass('hide').hide();
 
-    $checked_selections = $modal.find('.persistent-selection:checked');
-    if ($checked_selections) {
-      $checked_selections.each(function() {
-          data.push({name: selection_param, value: $(this).attr('value')});
-      });
+    var $preview_selections = $modal.find('.preview-selectable.active');
+    if ($preview_selections) {
+      data.push({name: selection_param, value: $preview_selections.first().children('fa-file').prop('title')});
     }
 
-    if (data.length == 0) {   // no checked persistent selection
+    if (data.length == 0) {   // no preview selection option
       $modal.find('.selectable.active[data-object-uuid]').each(function() {
         var val = $(this).attr('data-object-uuid');
         data.push({name: selection_param, value: val});
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index 213f5c2..c8c4ccc 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -287,7 +287,7 @@ module ApplicationHelper
          preconfigured_search_str: (preconfigured_search_str || ""),
          action_data: {
            merge: true,
-           use_checkbox_selection: dataclass == File ? true : nil,
+           use_preview_selection: dataclass == File ? true : nil,
            selection_param: selection_param,
            success: 'page-refresh'
          }.to_json,
@@ -449,10 +449,10 @@ module ApplicationHelper
     end
   end
 
-  def chooser_preview_url_for object, use_checkbox_selection=false
+  def chooser_preview_url_for object, use_preview_selection=false
     case object.class.to_s
     when 'Collection'
-      polymorphic_path(object, tab_pane: 'chooser_preview', use_checkbox_selection: use_checkbox_selection)
+      polymorphic_path(object, tab_pane: 'chooser_preview', use_preview_selection: use_preview_selection)
     else
       nil
     end
diff --git a/apps/workbench/app/views/application/_choose.html.erb b/apps/workbench/app/views/application/_choose.html.erb
index 26bf407..d36f5f9 100644
--- a/apps/workbench/app/views/application/_choose.html.erb
+++ b/apps/workbench/app/views/application/_choose.html.erb
@@ -63,10 +63,10 @@
                <% end %>
                <%
                   action_data = JSON.parse params['action_data'] if params['action_data']
-                  use_checkbox_sel = action_data ? action_data['use_checkbox_selection'] : false
+                  use_preview_sel = action_data ? action_data['use_preview_selection'] : false
                 %>
                data-infinite-content-href="<%= url_for partial: true,
-                                                       use_checkbox_selection: use_checkbox_sel %>">
+                                                       use_preview_selection: use_preview_sel %>">
           </div>
           <% if preview_pane %>
             <div class="col-md-6 hidden-xs hidden-sm modal-dialog-preview-pane" style="height: 100%; overflow-y: scroll">
diff --git a/apps/workbench/app/views/collections/_choose_rows.html.erb b/apps/workbench/app/views/collections/_choose_rows.html.erb
index f782bb8..5165949 100644
--- a/apps/workbench/app/views/collections/_choose_rows.html.erb
+++ b/apps/workbench/app/views/collections/_choose_rows.html.erb
@@ -1,6 +1,6 @@
 <% @collections.each do |object| %>
-    <div class="row filterable selectable <%= 'use-checkbox-selection' if params['use_checkbox_selection']%>" data-object-uuid="<%= object.uuid %>"
-         data-preview-href="<%= chooser_preview_url_for object, params['use_checkbox_selection'] %>"
+    <div class="row filterable selectable <%= 'use-preview-selection' if params['use_preview_selection']%>" data-object-uuid="<%= object.uuid %>"
+         data-preview-href="<%= chooser_preview_url_for object, params['use_preview_selection'] %>"
          style="margin-left: 1em; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #DDDDDD">
       <i class="fa fa-fw fa-archive"></i>
       <% if object.respond_to? :name %>
diff --git a/apps/workbench/app/views/collections/_show_chooser_preview.html.erb b/apps/workbench/app/views/collections/_show_chooser_preview.html.erb
index eae99fa..cb91f85 100644
--- a/apps/workbench/app/views/collections/_show_chooser_preview.html.erb
+++ b/apps/workbench/app/views/collections/_show_chooser_preview.html.erb
@@ -1,2 +1,2 @@
 <%= render partial: "show_source_summary" %>
-<%= render partial: "show_files", locals: {no_checkboxes: true, use_checkbox_selection: params['use_checkbox_selection']} %>
+<%= render partial: "show_files", locals: {no_checkboxes: true, use_preview_selection: params['use_preview_selection']} %>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 9b55f5c..4c3782f 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -53,7 +53,15 @@ function unselect_all_files() {
 <% if file_tree.nil? or file_tree.empty? %>
   <p>This collection is empty.</p>
 <% else %>
-  <ul id="collection_files" class="collection_files">
+  <%
+    preview_selectable_container = ''
+    preview_selectable = ''
+    if !params['use_preview_selection'].nil? and params['use_preview_selection'] == 'true'
+      preview_selectable_container = 'preview-selectable-container selectable-container'
+      preview_selectable = 'preview-selectable selectable'
+    end
+  %>
+  <ul id="collection_files" class="collection_files <%=preview_selectable_container%>">
   <% dirstack = [file_tree.first.first] %>
   <% file_tree.take(10000).each_with_index do |(dirname, filename, size), index| %>
     <% file_path = CollectionsHelper::file_path([dirname, filename]) %>
@@ -64,13 +72,13 @@ function unselect_all_files() {
     <% if size.nil?  # This is a subdirectory. %>
       <% dirstack.push(File.join(dirname, filename)) %>
       <div class="collection_files_row">
-       <div class="collection_files_name"><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
+       <div class="collection_files_name><i class="fa fa-fw fa-folder-open"></i> <%= filename %></div>
       </div>
       <ul class="collection_files">
     <% else %>
       <% link_params = {controller: 'collections', action: 'show_file',
                         uuid: @object.portable_data_hash, file: file_path, size: size} %>
-       <div class="collection_files_row filterable">
+       <div class="collection_files_row filterable <%=preview_selectable%>">
         <div class="collection_files_buttons pull-right">
           <%= raw(human_readable_bytes_html(size)) %>
           <% disable_search = (Rails.configuration.filename_suffixes_with_view_icon.include? file_path.split('.')[-1]) ? false : true %>
@@ -83,10 +91,9 @@ function unselect_all_files() {
         </div>
 
         <div class="collection_files_name">
-          <% if !defined? no_checkboxes or !no_checkboxes or
-                (!params['use_checkbox_selection'].nil? and params['use_checkbox_selection'] == 'true') %>
+          <% if !defined? no_checkboxes or !no_checkboxes %>
           <%= check_box_tag 'uuids[]', "#{@object.uuid}/#{file_path}", false, {
-                :class => 'persistent-selection',
+                :class => "persistent-selection",
                 :friendly_type => "File",
                 :friendly_name => "#{@object.uuid}/#{file_path}",
                 :href => url_for(controller: 'collections', action: 'show_file',
@@ -104,7 +111,7 @@ function unselect_all_files() {
                       {title: file_path}) %>
         </div>
       <% else %>
-          <i class="fa fa-fw fa-file"></i> <%= filename %></div>
+          <i class="fa fa-fw fa-file" href="<%=@object.uuid%>/<%=file_path%>" ></i> <%= filename %></div>
        </div>
       <% end %>
       </li>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list