[ARVADOS] updated: 95fd4dd7f982a343ec45d188bdbdcc9950df6e93

git at public.curoverse.com git at public.curoverse.com
Mon Dec 1 15:11:48 EST 2014


Summary of changes:
 .../app/views/projects/_show_tab_contents.html.erb |  8 +++--
 apps/workbench/test/integration/projects_test.rb   | 34 +++++++++++++++++-----
 2 files changed, 32 insertions(+), 10 deletions(-)

       via  95fd4dd7f982a343ec45d188bdbdcc9950df6e93 (commit)
      from  4b0934a2bb95509468fc4b6132177d47cc7988a8 (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 95fd4dd7f982a343ec45d188bdbdcc9950df6e93
Author: radhika <radhika at curoverse.com>
Date:   Mon Dec 1 15:10:32 2014 -0500

    4487: Omit "Remove selected" selection option when the current user cannot write to the project.
    4558: Remove ellipsis from Selection dropdown name.

diff --git a/apps/workbench/app/views/projects/_show_tab_contents.html.erb b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
index 1ef7fbd..3c94518 100644
--- a/apps/workbench/app/views/projects/_show_tab_contents.html.erb
+++ b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
@@ -3,7 +3,7 @@
   <div class="row">
     <div class="col-sm-5">
       <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>
+        <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 "Create new collection with selected collections", '#',
                   'data-href' => combine_selected_path(
@@ -20,7 +20,7 @@
                   'data-selection-param-name' => 'uuids[]',
                   'data-selection-action' => 'compare'
             %></li>
-          <li><%= link_to "Copy selected", '#',
+          <li><%= link_to "Copy selected...", '#',
                   'data-href' => choose_projects_path(
                     title: 'Copy selected items to...',
                     editable: true,
@@ -36,7 +36,7 @@
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'copy'
             %></li>
-          <li><%= link_to "Move selected", '#',
+          <li><%= link_to "Move selected...", '#',
                   'data-href' => choose_projects_path(
                     title: 'Move selected items to...',
                     editable: true,
@@ -52,6 +52,7 @@
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'move'
             %></li>
+          <% if (ArvadosBase.find(@object.owner_uuid).writable_by.include?(current_user.uuid) rescue nil) %>
           <li><%= link_to "Remove selected", '#',
                   'data-href' => url_for(action: :remove_items),
                   'data-selection-param-name' => 'item_uuids[]',
@@ -60,6 +61,7 @@
                   'method' => 'delete',
                   'data-toggle' => 'dropdown'
             %></li>
+          <% end %>
         </ul>
       </div>
     </div>
diff --git a/apps/workbench/test/integration/projects_test.rb b/apps/workbench/test/integration/projects_test.rb
index e210068..aa94924 100644
--- a/apps/workbench/test/integration/projects_test.rb
+++ b/apps/workbench/test/integration/projects_test.rb
@@ -332,7 +332,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       find('input[type=checkbox]').click
     end
 
-    click_button 'Selection...'
+    click_button 'Selection'
 
     within('.selection-action-container') do
       assert page.has_text?("Compare selected"), "Compare selected link text not found"
@@ -364,7 +364,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     find("#projects-menu").click
     find(".dropdown-menu a", text: my_project['name']).click
 
-    click_button 'Selection...'
+    click_button 'Selection'
     within('.selection-action-container') do
       page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
@@ -383,7 +383,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       find('input[type=checkbox]').click
     end
 
-    click_button 'Selection...'
+    click_button 'Selection'
     within('.selection-action-container') do
       page.assert_no_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li', text: 'Create new collection with selected collections'
@@ -408,7 +408,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       find('input[type=checkbox]').click
     end
 
-    click_button 'Selection...'
+    click_button 'Selection'
     within('.selection-action-container') do
       page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
@@ -438,7 +438,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       find('input[type=checkbox]').click
     end
 
-    click_button 'Selection...'
+    click_button 'Selection'
     within('.selection-action-container') do
       page.assert_selector 'li.disabled', text: 'Create new collection with selected collections'
       page.assert_selector 'li.disabled', text: 'Compare selected'
@@ -450,6 +450,26 @@ class ProjectsTest < ActionDispatch::IntegrationTest
     end
   end
 
+  # "Remove selected" selection option should not be available when current user cannot write to the project
+  test "remove selected action is not avaialble when current user cannot write to project" do
+    my_project = api_fixture('groups')['anonymously_accessible_project']
+
+    # verify that selection options are disabled or unavailable on the project
+    visit page_with_token 'active', '/'
+    find("#projects-menu").click
+    find(".dropdown-menu a", text: my_project['name']).click
+
+    click_button 'Selection'
+    within('.selection-action-container') do
+      assert_selector 'li.disabled', text: 'Create new collection with selected collections'
+      assert_selector 'li.disabled', text: 'Compare selected'
+      assert_selector 'li.disabled', text: 'Copy selected'
+      assert_selector 'li.disabled', text: 'Move selected'
+      assert_no_selector 'li.disabled', text: 'Remove selected'
+      assert_no_selector 'li', text: 'Remove selected'
+    end
+  end
+
   [
     ['active', true],
     ['project_viewer', false],
@@ -467,7 +487,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
         find('input[type=checkbox]').click
       end
 
-      click_button 'Selection...'
+      click_button 'Selection'
       within('.selection-action-container') do
         click_link 'Create new collection with selected collections'
       end
@@ -654,7 +674,7 @@ class ProjectsTest < ActionDispatch::IntegrationTest
       Rails.configuration.arvados_v1_base = original_arvados_v1_base
       click_link 'Reload tab'
       assert_no_selector('a', text: 'Reload tab')
-      assert_selector('button', text: 'Selection...')
+      assert_selector('button', text: 'Selection')
       within '.selection-action-container' do
         assert_selector 'tr[data-kind="arvados#trait"]'
       end

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list