[ARVADOS] updated: 022d82146b1f004cec158d9801fecd8a17637e47

Git user git at public.curoverse.com
Wed Apr 12 12:03:12 EDT 2017


Summary of changes:
 .../app/assets/javascripts/edit_collection.js      |  6 ++++--
 .../app/assets/stylesheets/collections.css.scss    |  6 ++++++
 .../collections/_extra_tab_line_buttons.html.erb   |  2 +-
 .../_extra_tab_line_buttons.html.erb               |  2 +-
 .../test/integration/collection_upload_test.rb     | 17 ++++++++--------
 .../workbench/test/integration/collections_test.rb | 23 ++++++++++------------
 6 files changed, 30 insertions(+), 26 deletions(-)

       via  022d82146b1f004cec158d9801fecd8a17637e47 (commit)
      from  69a23af535264a1385d51cbe73928c79bdce1de8 (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 022d82146b1f004cec158d9801fecd8a17637e47
Author: radhika <radhika at curoverse.com>
Date:   Wed Apr 12 12:02:37 2017 -0400

    11365: lock button appearance improvements

diff --git a/apps/workbench/app/assets/javascripts/edit_collection.js b/apps/workbench/app/assets/javascripts/edit_collection.js
index 6d85684..7da3e95 100644
--- a/apps/workbench/app/assets/javascripts/edit_collection.js
+++ b/apps/workbench/app/assets/javascripts/edit_collection.js
@@ -10,10 +10,11 @@ $(document).
         classes = $(event.target).attr('class')
 
         if (classes.indexOf("fa-lock") != -1) {
-            // About to unlock; warn the user
-            if (confirm("Adding, renaming, and deleting files changes the portalble data hash. Are you sure you want to unlock the collection?")) {
+            // About to unlock; warn and get confirmation from user
+            if (confirm("Adding, renaming, and deleting files changes the portable data hash. Are you sure you want to unlock the collection?")) {
                 $(".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-control").removeClass("disabled");
                 $(".tab-pane-Upload").removeClass("disabled");
                 $("#Upload-tab").attr("data-toggle", "tab");
@@ -24,6 +25,7 @@ $(document).
             // Lock it back
             $(".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-control").addClass("disabled");
             $(".tab-pane-Upload").addClass("disabled");
             $("#Upload-tab").attr("data-toggle", "disabled");
diff --git a/apps/workbench/app/assets/stylesheets/collections.css.scss b/apps/workbench/app/assets/stylesheets/collections.css.scss
index 35c2249..2d2d0f2 100644
--- a/apps/workbench/app/assets/stylesheets/collections.css.scss
+++ b/apps/workbench/app/assets/stylesheets/collections.css.scss
@@ -64,3 +64,9 @@ $active-bg: #39b3d7;
 .btn-group.toggle-persist .btn-info.active {
     background-color: $active-bg;
 }
+
+.lock-collection-btn {
+    display: inline-block;
+    padding: .5em 2em;
+    margin: 0 1em;
+}
diff --git a/apps/workbench/app/views/collections/_extra_tab_line_buttons.html.erb b/apps/workbench/app/views/collections/_extra_tab_line_buttons.html.erb
index dd48209..fe62f6d 100644
--- a/apps/workbench/app/views/collections/_extra_tab_line_buttons.html.erb
+++ b/apps/workbench/app/views/collections/_extra_tab_line_buttons.html.erb
@@ -1,3 +1,3 @@
 <% if @object.editable? %>
-  <i class="fa fa-fw fa-lock lock-collection-btn"></i>
+  <i class="fa fa-fw fa-lock lock-collection-btn btn btn-primary" title="Unlock collection to edit files"></i>
 <% end %>
diff --git a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
index 662309f..fd79535 100644
--- a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
+++ b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
@@ -1,6 +1,6 @@
 <% if @object.state == 'Final' %>
   <%= link_to(copy_container_request_path('id' => @object.uuid),
-      class: 'btn btn-primary',
+      class: 'btn btn-sm btn-primary',
       title: 'Re-run',
       data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it',
       method: :post,
diff --git a/apps/workbench/test/integration/collection_upload_test.rb b/apps/workbench/test/integration/collection_upload_test.rb
index 1a8dd72..552a9cd 100644
--- a/apps/workbench/test/integration/collection_upload_test.rb
+++ b/apps/workbench/test/integration/collection_upload_test.rb
@@ -42,9 +42,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
     need_selenium "to make file uploads work"
     visit page_with_token 'active', sandbox_path
 
-    # unlock before uploading files
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('empty.txt')
@@ -61,9 +59,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
     need_selenium "to make file uploads work"
     visit page_with_token 'active', sandbox_path
 
-    # unlock before uploading files
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('a')
@@ -104,9 +100,7 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
     end
     visit page_with_token 'active', sandbox_path
 
-    # unlock before uploading a file
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     find('.nav-tabs a', text: 'Upload').click
     attach_file 'file_selector', testfile_path('foo.txt')
@@ -143,4 +137,9 @@ class CollectionUploadTest < ActionDispatch::IntegrationTest
     # Must be an absolute path. https://github.com/jnicklas/capybara/issues/621
     File.join Dir.getwd, 'tmp', filename
   end
+
+  def unlock_collection
+    first('.lock-collection-btn').click
+    accept_alert
+  end
 end
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index 0fc1f44..20a403d 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -305,9 +305,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     visit page_with_token('active', '/collections/zzzzz-4zz18-a21ux3541sxa8sf')
     assert(page.has_text?('file1'), 'file not found - file1')
 
-    # unlock before removing a file
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     # remove first file
     input_files = page.all('input[type=checkbox]')
@@ -328,9 +326,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     visit page_with_token('active', '/collections/zzzzz-4zz18-a21ux3541sxa8sf')
     assert(page.has_text?('file1'), 'file not found - file1')
 
-    # unlock before removing a file
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     first('.fa-trash-o').click
     accept_alert
@@ -344,9 +340,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     visit page_with_token('active', '/collections/zzzzz-4zz18-a21ux3541sxa8sf')
 
-    # unlock before renaming a file
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     within('.collection_files') do
       first('.fa-pencil').click
@@ -374,7 +368,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     end
   end
 
-  test "unlock collection to modfiy files" do
+  test "unlock collection to modify files" do
     need_selenium 'to confirm remove'
 
     collection = api_fixture('collections')['collection_owned_by_active']
@@ -398,9 +392,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
       assert_selector 'li', text: 'Create new collection with selected files'
     end
 
-    # Unlock and verify the file modification controls are enabled
-    first('.lock-collection-btn').click
-    accept_alert
+    unlock_collection
 
     assert_no_selector 'a[data-toggle="disabled"]', text: 'Upload'
     assert_selector 'a', text: 'Upload'
@@ -422,4 +414,9 @@ class CollectionsTest < ActionDispatch::IntegrationTest
       assert_selector 'li', text: 'Remove selected files'
     end
   end
+
+  def unlock_collection
+    first('.lock-collection-btn').click
+    accept_alert
+  end
 end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list