[ARVADOS] updated: bf55ee80e71c6503292a44fb377927f2ed908f9b

Git user git at public.curoverse.com
Sun Apr 16 21:21:06 EDT 2017


Summary of changes:
 .../app/assets/javascripts/edit_collection.js       | 21 +++++++++------------
 .../app/assets/stylesheets/collections.css.scss     |  8 --------
 .../app/views/collections/_show_files.html.erb      | 12 +++++++++---
 apps/workbench/test/integration/collections_test.rb | 12 ++++++++----
 4 files changed, 26 insertions(+), 27 deletions(-)

       via  bf55ee80e71c6503292a44fb377927f2ed908f9b (commit)
      from  2f06f0e4d5b9ef371463c65dd5cae19f5b385a17 (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 bf55ee80e71c6503292a44fb377927f2ed908f9b
Author: radhika <radhika at curoverse.com>
Date:   Sun Apr 16 21:20:11 2017 -0400

    11465: add tooltips to disabled collection file controls

diff --git a/apps/workbench/app/assets/javascripts/edit_collection.js b/apps/workbench/app/assets/javascripts/edit_collection.js
index ba0e82c..5f0c3b4 100644
--- a/apps/workbench/app/assets/javascripts/edit_collection.js
+++ b/apps/workbench/app/assets/javascripts/edit_collection.js
@@ -2,10 +2,9 @@
 // disable all file modification controls (upload, rename, delete)
 $(document).
     ready(function(event) {
-        $(".btn-collection-file-rename").addClass("disabled");
-        $(".btn-collection-file-rename").attr("title", "Unlock collection to rename file");
-        $(".btn-collection-file-remove").addClass("disabled");
-        $(".btn-collection-file-remove").attr("title", "Unlock collection to remove file");
+        $(".btn-collection-file-control").addClass("disabled");
+        $(".btn-collection-rename-file-span").attr("title", "Unlock collection to rename file");
+        $(".btn-collection-remove-file-span").attr("title", "Unlock collection to remove file");
         $(".btn-remove-selected-files").attr("title", "Unlock collection to remove selected files");
         $(".tab-pane-Upload").addClass("disabled");
         $(".tab-pane-Upload").attr("title", "Unlock collection to upload files");
@@ -20,10 +19,9 @@ $(document).
                 $(".lock-collection-btn").removeClass("fa-lock");
                 $(".lock-collection-btn").addClass("fa-unlock");
                 $(".lock-collection-btn").attr("title", "Lock collection to prevent editing files");
-                $(".btn-collection-file-rename").removeClass("disabled");
-                $(".btn-collection-file-rename").attr("data-original-title", "Edit name or path or both for this file");
-                $(".btn-collection-file-remove").removeClass("disabled");
-                $(".btn-collection-file-remove").attr("data-original-title", "Remove this file");
+                $(".btn-collection-rename-file-span").attr("title", "");
+                $(".btn-collection-remove-file-span").attr("title", "");
+                $(".btn-collection-file-control").removeClass("disabled");
                 $(".btn-remove-selected-files").attr("title", "");
                 $(".tab-pane-Upload").removeClass("disabled");
                 $(".tab-pane-Upload").attr("data-original-title", "");
@@ -36,10 +34,9 @@ $(document).
             $(".lock-collection-btn").removeClass("fa-unlock");
             $(".lock-collection-btn").addClass("fa-lock");
             $(".lock-collection-btn").attr("title", "Unlock collection to edit files");
-            $(".btn-collection-file-rename").addClass("disabled");
-            $(".btn-collection-file-rename").attr("data-original-title", "Unlock collection to rename file");
-            $(".btn-collection-file-remove").addClass("disabled");
-            $(".btn-collection-file-remove").attr("data-original-title", "Unlock collection to remove file");
+            $(".btn-collection-rename-file-span").attr("title", "Unlock collection to rename file");
+            $(".btn-collection-remove-file-span").attr("title", "Unlock collection to remove file");
+            $(".btn-collection-file-control").addClass("disabled");
             $(".btn-remove-selected-files").attr("title", "Unlock collection to remove selected files");
             $(".tab-pane-Upload").addClass("disabled");
             $(".tab-pane-Upload").attr("data-original-title", "Unlock collection to upload files");
diff --git a/apps/workbench/app/assets/stylesheets/collections.css.scss b/apps/workbench/app/assets/stylesheets/collections.css.scss
index cfb99e7..2d2d0f2 100644
--- a/apps/workbench/app/assets/stylesheets/collections.css.scss
+++ b/apps/workbench/app/assets/stylesheets/collections.css.scss
@@ -70,11 +70,3 @@ $active-bg: #39b3d7;
     padding: .5em 2em;
     margin: 0 1em;
 }
-
-.btn-collection-file-rename.disabled {
-    pointer-events: auto;
-}
-
-.btn-collection-file-remove.disabled {
-    pointer-events: auto;
-}
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index c1c7d3b..c528d24 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -98,14 +98,18 @@
             <% end %>
 
             <% if object.editable? %>
-                <%= link_to({controller: 'collections', action: 'remove_selected_files', id: object.uuid, selection: [object.portable_data_hash+'/'+file_path]}, method: :post, remote: true, data: {confirm: "Remove #{file_path}?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate btn-collection-file-remove') do %>
+                <span class="btn-collection-remove-file-span">
+                <%= link_to({controller: 'collections', action: 'remove_selected_files', id: object.uuid, selection: [object.portable_data_hash+'/'+file_path]}, method: :post, remote: true, data: {confirm: "Remove #{file_path}?", toggle: 'tooltip', placement: 'top'}, class: 'btn btn-sm btn-default btn-nodecorate btn-collection-file-control', title: "Remove #{file_path}") do %>
                   <i class="fa fa-fw fa-trash-o"></i>
                 <% end %>
+                </span>
             <% end %>
         <% if CollectionsHelper::is_image(filename) %>
             <i class="fa fa-fw fa-bar-chart-o"></i>
+              <span class="btn-collection-rename-file-span">
               <% if object.editable? %>
-                <%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_path' => 'rename-file-path:'+file_path}, {btnclass: 'collection-file-rename'} %>
+                <%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_path' => 'rename-file-path:'+file_path}, {tiptitle: 'Edit name or directory or both for this file'} %>
+              </span>
               <% else %>
                 <%= filename %>
               <% end %>
@@ -118,7 +122,9 @@
          </div>
         <% else %>
               <% if object.editable? %>
-                <i class="fa fa-fw fa-file"></i><%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_name' => 'rename-file-path:'+file_path}, {btnclass: 'collection-file-rename'}  %>
+                <span class="btn-collection-rename-file-span">
+                <i class="fa fa-fw fa-file"></i><%= render_editable_attribute object, 'filename', filename, {'data-value' => file_path, 'data-toggle' => 'manual', 'selection_name' => 'rename-file-path:'+file_path}, {tiptitle: 'Edit name or directory or both for this file', btnclass: 'collection-file-control'}  %>
+                </span>
               <% else %>
                 <i class="fa fa-fw fa-file" href="<%=object.uuid%>/<%=file_path%>" ></i> <%= filename %>
               <% end %>
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 203d08d..8b43e5d 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -379,8 +379,10 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert_selector 'a[data-toggle="disabled"]', text: 'Upload'
 
     within('.collection_files') do
-      assert_equal true, page.all('.btn-collection-file-rename')[0]['class'].include?('disabled')
-      assert_equal true, page.all('.btn-collection-file-remove')[0]['class'].include?('disabled')
+      file_ctrls = page.all('.btn-collection-file-control')
+      assert_equal 2, file_ctrls.size
+      assert_equal true, file_ctrls[0]['class'].include?('disabled')
+      assert_equal true, file_ctrls[1]['class'].include?('disabled')
       find('input[type=checkbox]').click
     end
 
@@ -396,8 +398,10 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert_selector 'a', text: 'Upload'
 
     within('.collection_files') do
-      assert_equal false, page.all('.btn-collection-file-rename')[0]['class'].include?('disabled')
-      assert_equal false, page.all('.btn-collection-file-remove')[0]['class'].include?('disabled')
+      file_ctrls = page.all('.btn-collection-file-control')
+      assert_equal 2, file_ctrls.size
+      assert_equal false, file_ctrls[0]['class'].include?('disabled')
+      assert_equal false, file_ctrls[1]['class'].include?('disabled')
 
       # previous checkbox selection won't result in firing a new event;
       # undo and redo checkbox to fire the selection event again

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list