3654: disable search icon collection show page rather than hide it when it is not...
authorradhika <radhika@curoverse.com>
Fri, 12 Sep 2014 18:19:44 +0000 (14:19 -0400)
committerradhika <radhika@curoverse.com>
Fri, 12 Sep 2014 18:19:44 +0000 (14:19 -0400)
apps/workbench/app/views/collections/_show_files.html.erb
apps/workbench/app/views/collections/_show_recent.html.erb
apps/workbench/app/views/projects/_show_tab_contents.html.erb
apps/workbench/test/integration/collections_test.rb
apps/workbench/test/integration/projects_test.rb

index 020f16dd5a4d46b903f42739051abb63903efd74..9fdd32b733ce460f57e5e8ea21ded4ea04896052 100644 (file)
@@ -5,7 +5,7 @@
       <div class="btn-group btn-group-sm">
         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
         <ul class="dropdown-menu" role="menu">
-          <li><%= link_to "Combine selected files into a new collection", '#',
+          <li><%= link_to "Create new collection with selected files", '#',
                   'data-href' => combine_selected_path,
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
        <div class="collection_files_row">
         <div class="collection_files_buttons pull-right">
           <%= raw(human_readable_bytes_html(size)) %>
-          <% if Rails.configuration.filename_suffixes_with_view_icon.include? file_path.split('.')[-1] %>
+          <% disable_search = (Rails.configuration.filename_suffixes_with_view_icon.include? file_path.split('.')[-1]) ? false : true %>
           <%= link_to(raw('<i class="fa fa-search"></i>'),
                       link_params.merge(disposition: 'inline'),
-                      {title: "View #{file_path}", class: "btn btn-info btn-sm"}) %>
-          <% end %>
-
+                      {title: "View #{file_path}", class: "btn btn-info btn-sm", disabled: disable_search}) %>
           <%= link_to(raw('<i class="fa fa-download"></i>'),
                       link_params.merge(disposition: 'attachment'),
                       {title: "Download #{file_path}", class: "btn btn-info btn-sm"}) %>
@@ -64,6 +62,7 @@
                                  uuid: @object.portable_data_hash, file: file_path),
                 :title => "Include #{file_path} in your selections",
               } %>
+          <span>&nbsp;</span>
           <% end %>
       <% if CollectionsHelper::is_image(filename) %>
           <i class="fa fa-fw fa-bar-chart-o"></i> <%= filename %></div>
index 5edabfaa69a62373a945a55daa036912729f0d53..c958b290e8600c8b789b49ad21d06186873bd078 100644 (file)
@@ -4,7 +4,7 @@
       <div class="btn-group btn-group-sm">
         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
         <ul class="dropdown-menu" role="menu">
-          <li><%= link_to "Combine selected collections into a new collection", '#',
+          <li><%= link_to "Create new collection with selected collections", '#',
                   'data-href' => combine_selected_path,
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
index 3aff23e7443d2d89a8ac341010dc48760333c7b9..f185abe69e7bddbda805c137fbed8aec6ceb0280 100644 (file)
@@ -4,7 +4,7 @@
       <div class="btn-group btn-group-sm">
         <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">Selection... <span class="caret"></span></button>
         <ul class="dropdown-menu" role="menu">
-          <li><%= link_to "Combine selected collections into a new collection", '#',
+          <li><%= link_to "Create new collection with selected collections", '#',
                   'data-href' => combine_selected_path(
                     action_data: {selection_param: 'project'}.to_json
                   ),
index 084a3380643414a3a52615ae5c31d66cb2f3cec5..17a59f81851bcac50584991babca8311597fe58b 100644 (file)
@@ -70,7 +70,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      click_link 'Combine selected collections into a new collection'
+      click_link 'Create new collection with selected collections'
     end
 
     # now in the newly created collection page
@@ -81,7 +81,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert(page.has_text?('bar'), "Collection page did not include bar file")
   end
 
-  test "combine selected collection contents into new collection" do
+  test "combine selected collection files into new collection" do
     foo_collection = api_fixture('collections')['foo_file']
 
     visit page_with_token('active', "/collections")
@@ -96,7 +96,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      click_link 'Combine selected files into a new collection'
+      click_link 'Create new collection with selected files'
     end
 
     # now in the newly created collection page
index ade4ed4c32a2e09aa9c6478cf8f5a56399448282..3b7f7a43be0eb7eb0033f3700b951a34e0c83528 100644 (file)
@@ -339,7 +339,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      page.assert_selector 'li.disabled', text: 'Combine selected collections into a new collection'
+      page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_selector 'li.disabled', text: 'Move selected'
@@ -357,8 +357,8 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      page.assert_no_selector 'li.disabled', text: 'Combine selected collections into a new collection'
-      page.assert_selector 'li', text: 'Combine selected collections into a new collection'
+      page.assert_no_selector 'li.disabled', text: 'Create new collection with selected collections'
+      page.assert_selector 'li', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_no_selector 'li.disabled', text: 'Copy selected'
       page.assert_selector 'li', text: 'Copy selected'
@@ -381,7 +381,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      page.assert_selector 'li.disabled', text: 'Combine selected collections into a new collection'
+      page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_no_selector 'li.disabled', text: 'Move selected'
@@ -410,7 +410,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      page.assert_selector 'li.disabled', text: 'Combine selected collections into a new collection'
+      page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
       page.assert_selector 'li.disabled', text: 'Copy selected'
       page.assert_no_selector 'li.disabled', text: 'Move selected'
@@ -434,7 +434,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
 
     click_button 'Selection...'
     within('.selection-action-container') do
-      click_link 'Combine selected collections into a new collection'
+      click_link 'Create new collection with selected collections'
     end
 
     # back in project page