[ARVADOS] created: 74c10d0016ccf0337c66000308e67ca6a907f86f

git at public.curoverse.com git at public.curoverse.com
Mon Dec 1 11:28:47 EST 2014


        at  74c10d0016ccf0337c66000308e67ca6a907f86f (commit)


commit 74c10d0016ccf0337c66000308e67ca6a907f86f
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Nov 26 21:35:07 2014 -0500

    4291: Workbench Collection sharing buttons are actual buttons.
    
    This prevents users from trying to open them in new windows/tabs and
    getting a 404 response.
    
    I had to rework the pipeline instance comparison JavaScript because it
    was disabling the collection share button on page load.  All that was
    really necessary was making sure the event only fires when there
    actually is a form#compare, but I did some other cleanup in the
    process of learning that.

diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js
index 102c602..e820ba9 100644
--- a/apps/workbench/app/assets/javascripts/pipeline_instances.js
+++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js
@@ -110,23 +110,20 @@ $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(e
     }
 });
 
-var showhide_compare = function() {
-    var form = $('form#compare')[0];
-    $('input[type=hidden][name="uuids[]"]', form).remove();
-    $('input[type=submit]', form).prop('disabled',true).show();
-    var checked_inputs = $('[data-object-uuid*=-d1hrv-] input[name="uuids[]"]:checked');
-    if (checked_inputs.length >= 2 && checked_inputs.length <= 3) {
-        checked_inputs.each(function(){
-            if(this.checked) {
-                $('input[type=submit]', form).prop('disabled',false).show();
-                $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
-            }
-        });
-    }
-};
-$(document).on('change', '[data-object-uuid*=-d1hrv-] input[name="uuids[]"]', function(e) {
-    if(e.target == this) {
-        showhide_compare();
-    }
-});
-$(document).on('ready ajax:success', showhide_compare);
+// Set up all events for the pipeline instances compare button.
+(function() {
+    var compare_form = '#compare';
+    var compare_inputs = '#comparedInstances :checkbox[name="uuids[]"]';
+    var update_button = function(event) {
+        var $form = $(compare_form);
+        var $checked_inputs = $(compare_inputs).filter(':checked');
+        $(':submit', $form).prop('disabled', (($checked_inputs.length < 2) ||
+                                              ($checked_inputs.length > 3)));
+        $('input[name="uuids[]"]', $form).remove();
+        $form.append($checked_inputs.clone()
+                     .removeAttr('id').attr('type', 'hidden'));
+    };
+    $(document)
+        .on('ready ajax:success', compare_form, update_button)
+        .on('change', compare_inputs, update_button);
+})();
diff --git a/apps/workbench/app/views/collections/_sharing_button.html.erb b/apps/workbench/app/views/collections/_sharing_button.html.erb
index ae91552..9d3639c 100644
--- a/apps/workbench/app/views/collections/_sharing_button.html.erb
+++ b/apps/workbench/app/views/collections/_sharing_button.html.erb
@@ -1,21 +1,16 @@
-<%# a nil @search_sharing means we got an AccessForbiddenException and should
-disable this feature entirely. %>
-<% if @search_sharing != nil %>
-  <% if @search_sharing.any? %>
-    <div>Shared at:
-      <span class="pull-right">
-        <%= link_to "Unshare", unshare_collection_url, {
-              class: 'btn-xs btn-info',
-              remote: true,
-              method: :post,
-            } %></span>
-      <div class="smaller-text" style="word-break: break-all"><%= link_to download_link, download_link %></div>
-    </div>
-  <% else %>
-    <%= link_to "Create sharing link", share_collection_url, {
-          class: 'btn-xs btn-info',
-          remote: true,
-          method: :post,
-        } %>
-  <% end %>
+<% button_attrs = {
+     class: 'btn btn-xs btn-info',
+     remote: true,
+     method: :post,
+   } %>
+<% if @search_sharing.nil? %>
+  <%# API token can't manage other tokens.  Disable this feature. %>
+<% elsif @search_sharing.empty? %>
+  <%= button_to("Create sharing link", {action: "share"}, button_attrs) %>
+<% else %>
+  <div>Shared at:
+    <% button_attrs[:class] += " pull-right" %>
+    <%= button_to("Unshare", {action: "unshare"}, button_attrs) %>
+    <div class="smaller-text" style="word-break: break-all"><%= link_to download_link, download_link %></div>
+  </div>
 <% end %>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 3a170f2..b1cdfa7 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -75,7 +75,7 @@ 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 %>
diff --git a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
index e1a7cea..7d1fd39 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
@@ -1,4 +1,4 @@
-<%= form_tag do |f| %>
+<%= form_tag({}, {id: "comparedInstances"}) do |f| %>
 
 <table class="table table-condensed table-fixedlayout arv-recent-pipeline-instances">
   <colgroup>
diff --git a/apps/workbench/app/views/pipeline_instances/index.html.erb b/apps/workbench/app/views/pipeline_instances/index.html.erb
index e538815..1181b3e 100644
--- a/apps/workbench/app/views/pipeline_instances/index.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/index.html.erb
@@ -9,8 +9,7 @@
   </div>
 
   <%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %>
-  <%= submit_tag 'Compare 2 or 3 selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
-   
+    <%= submit_tag 'Compare 2 or 3 selected', {class: 'btn btn-primary', disabled: true} %>
   <% end rescue nil %>
 
 <% end %>
diff --git a/apps/workbench/test/integration/collections_test.rb b/apps/workbench/test/integration/collections_test.rb
index f4fc4cb..a54d70f 100644
--- a/apps/workbench/test/integration/collections_test.rb
+++ b/apps/workbench/test/integration/collections_test.rb
@@ -44,6 +44,35 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert(page.has_link?('foo'), "Collection page did not include file link")
   end
 
+  def check_sharing(want_state, link_regexp)
+    # We specifically want to click buttons.  See #4291.
+    if want_state == :off
+      click_button "Unshare"
+      text_assertion = :assert_no_text
+      link_assertion = :assert_empty
+    else
+      click_button "Create sharing link"
+      text_assertion = :assert_text
+      link_assertion = :refute_empty
+    end
+    using_wait_time(Capybara.default_wait_time * 3) do
+      send(text_assertion, "Shared at:")
+    end
+    send(link_assertion, all("a").select { |a| a[:href] =~ link_regexp })
+  end
+
+  test "creating and uncreating a sharing link" do
+    Capybara.current_driver = Capybara.javascript_driver
+    coll_uuid = api_fixture("collections", "collection_owned_by_active", "uuid")
+    download_link_re =
+      Regexp.new(Regexp.escape("/collections/download/#{coll_uuid}/"))
+    visit page_with_token("active_trustedclient", "/collections/#{coll_uuid}")
+    within "#sharing-button" do
+      check_sharing(:on, download_link_re)
+      check_sharing(:off, download_link_re)
+    end
+  end
+
   test "can download an entire collection with a reader token" do
     CollectionsController.any_instance.
       stubs(:file_enumerator).returns(["foo\n", "file\n"])
@@ -282,7 +311,7 @@ class CollectionsTest < ActionDispatch::IntegrationTest
     assert_checkboxes_state('[value*="file1"]', true, 'checkboxes for file1 should be selected after filtering')
     assert_checkboxes_state('[value*="file2"]', true, 'checkboxes for file2 should be selected after filtering')
     assert_checkboxes_state('[value*="file3"]', false, 'checkboxes for file3 should be clear after filtering')
- 
+
     # Select all files, then filter, then "unselect all", then unfilter
     page.find_field('file_regex').set("\b") # backspace
     find('button#select-all').click

commit e2dc5d3da861e9f99e6812f63afd0d6485bc3b45
Author: Brett Smith <brett at curoverse.com>
Date:   Mon Dec 1 11:07:07 2014 -0500

    4676: Collection sharing popup is always JavaScript.
    
    This fixes an issue where the response would sometimes be sent with
    Content-Type: text/html.  We thought it might be a race condition with
    AJAX, but the browser was sending a correct Accept: header.

diff --git a/apps/workbench/app/controllers/collections_controller.rb b/apps/workbench/app/controllers/collections_controller.rb
index 39f637e..2ca845a 100644
--- a/apps/workbench/app/controllers/collections_controller.rb
+++ b/apps/workbench/app/controllers/collections_controller.rb
@@ -233,10 +233,7 @@ class CollectionsController < ApplicationController
 
   def sharing_popup
     @search_sharing = search_scopes
-    respond_to do |format|
-      format.html
-      format.js
-    end
+    render("sharing_popup.js", content_type: "text/javascript")
   end
 
   helper_method :download_link
@@ -246,18 +243,15 @@ class CollectionsController < ApplicationController
   end
 
   def share
-    a = ApiClientAuthorization.create(scopes: sharing_scopes)
-    @search_sharing = search_scopes
-    render 'sharing_popup'
+    ApiClientAuthorization.create(scopes: sharing_scopes)
+    sharing_popup
   end
 
   def unshare
-    @search_sharing = search_scopes
-    @search_sharing.each do |s|
+    search_scopes.each do |s|
       s.destroy
     end
-    @search_sharing = search_scopes
-    render 'sharing_popup'
+    sharing_popup
   end
 
   protected

commit 228551c925306be1dd7537dd0e37e49f9b39bf0e
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Nov 26 21:35:00 2014 -0500

    4291: Add Workbench controller tests for collection sharing.
    
    I wrote these while diagnosing another problem.

diff --git a/apps/workbench/test/functional/collections_controller_test.rb b/apps/workbench/test/functional/collections_controller_test.rb
index 6c64ac9..47e6105 100644
--- a/apps/workbench/test/functional/collections_controller_test.rb
+++ b/apps/workbench/test/functional/collections_controller_test.rb
@@ -106,6 +106,22 @@ class CollectionsControllerTest < ActionController::TestCase
     assert_no_session
   end
 
+  test "sharing auths available to admin" do
+    show_collection("collection_owned_by_active", "admin_trustedclient")
+    assert_not_nil assigns(:search_sharing)
+  end
+
+  test "sharing auths available to owner" do
+    show_collection("collection_owned_by_active", "active_trustedclient")
+    assert_not_nil assigns(:search_sharing)
+  end
+
+  test "sharing auths available to reader" do
+    show_collection("foo_collection_in_aproject",
+                    "project_viewer_trustedclient")
+    assert_not_nil assigns(:search_sharing)
+  end
+
   test "reader token Collection links end with trailing slash" do
     # Testing the fix for #2937.
     session = session_for(:active_trustedclient)
diff --git a/services/api/test/fixtures/api_client_authorizations.yml b/services/api/test/fixtures/api_client_authorizations.yml
index 54329b0..0b4d874 100644
--- a/services/api/test/fixtures/api_client_authorizations.yml
+++ b/services/api/test/fixtures/api_client_authorizations.yml
@@ -49,6 +49,12 @@ project_viewer:
   api_token: projectviewertoken1234567890abcdefghijklmnopqrstuv
   expires_at: 2038-01-01 00:00:00
 
+project_viewer_trustedclient:
+  api_client: trusted_workbench
+  user: project_viewer
+  api_token: projectviewertrustedtoken1234567890abcdefghijklmno
+  expires_at: 2038-01-01 00:00:00
+
 subproject_admin:
   api_client: untrusted
   user: subproject_admin

commit efcb40c9f8e0e6a6b5aa30c705096ed0475dc81b
Author: Brett Smith <brett at curoverse.com>
Date:   Wed Nov 26 11:34:53 2014 -0500

    4291: Workbench uses .prop() to set element disabled property.
    
    Per <http://api.jquery.com/prop/>: "The .prop() method should be used
    to set disabled and checked instead of the .attr() method."

diff --git a/apps/workbench/app/assets/javascripts/report_issue.js b/apps/workbench/app/assets/javascripts/report_issue.js
index e769d80..f3c323c 100644
--- a/apps/workbench/app/assets/javascripts/report_issue.js
+++ b/apps/workbench/app/assets/javascripts/report_issue.js
@@ -1,7 +1,7 @@
 $(document).
   on('click', "#report-issue-submit", function(e){
     $(this).html('Sending');
-    $(this).attr('disabled', true);
+    $(this).prop('disabled', true);
     var $cancelButton = $('#report-issue-cancel');
     if ($cancelButton) {
       $cancelButton.html('Close');
@@ -21,7 +21,7 @@ $(document).
           $('div').remove('.modal-footer-status');
           $('.modal-footer').append('<div><br/></div><div class="modal-footer-status alert alert-danger"><p class="contain-align-left">We are sorry. We could not submit your report! We really want this to work, though -- please try again.</p></div>');
           $sendButton.html('Send problem report');
-          $sendButton.attr('disabled',false);
+          $sendButton.prop('disabled', false);
         }
         var $cancelButton = $('#report-issue-cancel');
         $cancelButton.html('Cancel');
diff --git a/apps/workbench/app/views/application/report_issue_popup.js.erb b/apps/workbench/app/views/application/report_issue_popup.js.erb
index 6795c09..73830ee 100644
--- a/apps/workbench/app/views/application/report_issue_popup.js.erb
+++ b/apps/workbench/app/views/application/report_issue_popup.js.erb
@@ -3,14 +3,10 @@ $("#report-issue-modal-window .modal").modal('show');
 
 // Disable the submit button on modal loading
 $submit = $('#report-issue-submit');
-$submit.attr('disabled', true);
+$submit.prop('disabled', true);
 
 // capture events to enable submit button when applicable
 $('#report_issue_text').bind('input propertychange', function() {
   var problem_desc = document.forms["report-issue-form"]["report_issue_text"].value;
-  if (problem_desc === null || problem_desc === "") {
-    $submit.attr('disabled', true)
-  } else {
-    $submit.removeAttr('disabled');
-  }
+  $submit.prop('disabled', (problem_desc === null) || (problem_desc === ""));
 });
diff --git a/apps/workbench/app/views/users/setup_popup.js.erb b/apps/workbench/app/views/users/setup_popup.js.erb
index 5671cc2..b1aa796 100644
--- a/apps/workbench/app/views/users/setup_popup.js.erb
+++ b/apps/workbench/app/views/users/setup_popup.js.erb
@@ -9,7 +9,7 @@ var email_value = document.forms["setup_form"]["email"].value;
 var prefix_value = document.forms["setup_form"]["openid_prefix"].value;
 if ((email_disabled == false) && (email_value == null || email_value == "" ||
         prefix_value == null || prefix_value == "")) {
-  $register.attr('disabled', true);
+  $register.prop('disabled', true);
 }
 
 // capture events to enable submit button when applicable
@@ -22,7 +22,7 @@ $input.on('keyup paste mouseleave', function() {
 
   var emailRegExp = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
   var validEmail = false;
- 
+
   if (emailRegExp.test(email_value )) {
     validEmail = true;
   }
@@ -32,7 +32,7 @@ $input.on('keyup paste mouseleave', function() {
     trigger = true;
   }
 
-  trigger ? $register.attr('disabled', true) : $register.removeAttr('disabled');
+  $register.prop('disabled', trigger);
 });
 
 // reset form input fields, for the next time around

commit e0c20695767a45366b9f5993b460b8b58841868f
Author: Brett Smith <brett at curoverse.com>
Date:   Tue Nov 25 17:57:47 2014 -0500

    4291: Clean up HTTP methods in Workbench URL generators.
    
    According to the docs at
    <http://api.rubyonrails.org/files/actionview/lib/action_view/helpers/url_helper_rb.html>:
    
    * `button_to` and `form_for` take :method as a symbol.
    * `link_to` takes :method as a symbol, and only supports :delete,
      :post, :patch, and :put.  Any link that should be done with GET
      should not have a method specified.
    * Note that `form_tag` *does* take a string, so not every method
      should be symbolized.

diff --git a/apps/workbench/app/views/collections/_sharing_button.html.erb b/apps/workbench/app/views/collections/_sharing_button.html.erb
index fc81e70..ae91552 100644
--- a/apps/workbench/app/views/collections/_sharing_button.html.erb
+++ b/apps/workbench/app/views/collections/_sharing_button.html.erb
@@ -7,7 +7,7 @@ disable this feature entirely. %>
         <%= link_to "Unshare", unshare_collection_url, {
               class: 'btn-xs btn-info',
               remote: true,
-              method: 'post'
+              method: :post,
             } %></span>
       <div class="smaller-text" style="word-break: break-all"><%= link_to download_link, download_link %></div>
     </div>
@@ -15,7 +15,7 @@ disable this feature entirely. %>
     <%= link_to "Create sharing link", share_collection_url, {
           class: 'btn-xs btn-info',
           remote: true,
-          method: 'post'
+          method: :post,
         } %>
   <% end %>
 <% end %>
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 76d8731..3a170f2 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -38,12 +38,12 @@ function unselect_all_files() {
         <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 files", '#',
+                  method: :post,
                   'data-href' => combine_selected_path(
                     action_data: {current_project_uuid: @object.owner_uuid}.to_json
                   ),
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
-                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
         </ul>
diff --git a/apps/workbench/app/views/collections/_show_recent.html.erb b/apps/workbench/app/views/collections/_show_recent.html.erb
index 6ebb3b2..39651cc 100644
--- a/apps/workbench/app/views/collections/_show_recent.html.erb
+++ b/apps/workbench/app/views/collections/_show_recent.html.erb
@@ -5,10 +5,10 @@
         <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", '#',
+                  method: :post,
                   'data-href' => combine_selected_path,
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
-                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
         </ul>
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 9e966e1..035d147 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -161,7 +161,7 @@
                       &block)
                   end,
                   :top_button => Proc.new do %>
-                    <% link_to projects_path, method: 'post', class: 'btn btn-xs btn-default pull-right' do %>
+                    <% link_to projects_path, method: :post, class: 'btn btn-xs btn-default pull-right' do %>
                       <i class="fa fa-plus"></i> New project
                     <% end %>
                   <% end %>
diff --git a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
index 252b93a..a1749a7 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
@@ -38,7 +38,7 @@
                                                    'pipeline_instance[description]' => "Created at #{Time.now.localtime}" + (ob.name.andand.size.andand>0 ? " using the pipeline template *#{ob.name}*" : ""),
                                                    'success' => 'redirect-to-created-object'
                                                   }.to_json),
-                { class: "btn btn-default btn-xs", title: "Run #{ob.name}", remote: true, method: 'get' }
+                { class: "btn btn-default btn-xs", title: "Run #{ob.name}", remote: true, method: :get }
             ) do %>
                <i class="fa fa-fw fa-play"></i> Run
               <% end %>
diff --git a/apps/workbench/app/views/pipeline_templates/show.html.erb b/apps/workbench/app/views/pipeline_templates/show.html.erb
index 02ebd6d..0faa48f 100644
--- a/apps/workbench/app/views/pipeline_templates/show.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/show.html.erb
@@ -10,7 +10,7 @@
                                                    'pipeline_instance[description]' => "Created at #{Time.now.localtime}" + (@object.name.andand.size.andand>0 ? " using the pipeline template *#{@object.name}*" : ""),
                                                    'success' => 'redirect-to-created-object'
                                                   }.to_json),
-                { class: "btn btn-primary btn-sm", remote: true, method: 'get', title: 'Run this pipeline' }
+                { class: "btn btn-primary btn-sm", remote: true, title: 'Run this pipeline' }
                ) do %>
                    <i class="fa fa-gear"></i> Run this pipeline
                  <% end %>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 0d71f94..40f319f 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -11,7 +11,7 @@
 	    action_href: pipeline_instances_path,
 	    action_method: 'post',
 	    action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
-	  { class: "btn btn-primary btn-xs", remote: true, method: 'get' }) do %>
+	  { class: "btn btn-primary btn-xs", remote: true }) do %>
       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
     <% end %>
     </span>
diff --git a/apps/workbench/app/views/projects/_show_sharing.html.erb b/apps/workbench/app/views/projects/_show_sharing.html.erb
index cc862c4..480f401 100644
--- a/apps/workbench/app/views/projects/_show_sharing.html.erb
+++ b/apps/workbench/app/views/projects/_show_sharing.html.erb
@@ -45,7 +45,7 @@
       action_href: share_with_project_path,
       action_name: 'Add',
       action_data: {selection_param: 'uuids[]', success: 'tab-refresh'}.to_json),
-      class: "btn btn-primary btn-sm", remote: true, method: 'get') do %>
+      class: "btn btn-primary btn-sm", remote: true) do %>
   <i class="fa fa-fw fa-plus"></i> Share with <%= share_class %>…
   <% end %>
 
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..c9917a1 100644
--- a/apps/workbench/app/views/projects/_show_tab_contents.html.erb
+++ b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
@@ -10,9 +10,9 @@
                     action_data: {current_project_uuid: @object.uuid}.to_json
                   ),
                   'id' => 'combine_selections_button',
+                  method: :post,
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-project-contents',
-                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
           <li><%= link_to "Compare selected", 'action',
@@ -53,11 +53,11 @@
                   'data-selection-action' => 'move'
             %></li>
           <li><%= link_to "Remove selected", '#',
+                  method: :delete,
                   'data-href' => url_for(action: :remove_items),
                   'data-selection-param-name' => 'item_uuids[]',
                   'data-selection-action' => 'remove',
                   'data-remote' => true,
-                  'method' => 'delete',
                   'data-toggle' => 'dropdown'
             %></li>
         </ul>
diff --git a/apps/workbench/app/views/projects/show.html.erb b/apps/workbench/app/views/projects/show.html.erb
index 0429f33..7a9eda0 100644
--- a/apps/workbench/app/views/projects/show.html.erb
+++ b/apps/workbench/app/views/projects/show.html.erb
@@ -14,7 +14,7 @@
 	    action_href: actions_path(id: @object.uuid),
 	    action_method: 'post',
 	    action_data: {selection_param: 'selection[]', copy_selections_into_project: @object.uuid, success: 'page-refresh'}.to_json),
-	  { class: "btn btn-primary btn-sm", remote: true, method: 'get', title: "Add data to this project", data: {'event-after-select' => 'page-refresh'} }) do %>
+	  { class: "btn btn-primary btn-sm", remote: true, title: "Add data to this project", data: {'event-after-select' => 'page-refresh'} }) do %>
       <i class="fa fa-fw fa-plus"></i> Add data...
     <% end %>
     <%= link_to(
@@ -24,10 +24,10 @@
 	    action_href: pipeline_instances_path,
 	    action_method: 'post',
 	    action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => @object.uuid, 'success' => 'redirect-to-created-object'}.to_json),
-	  { class: "btn btn-primary btn-sm", remote: true, method: 'get', title: "Run a pipeline in this project" }) do %>
+	  { class: "btn btn-primary btn-sm", remote: true, title: "Run a pipeline in this project" }) do %>
       <i class="fa fa-fw fa-gear"></i> Run a pipeline...
     <% end %>
-    <%= link_to projects_path({'project[owner_uuid]' => @object.uuid, 'options' => {'ensure_unique_name' => true}}), method: 'post', title: "Add a subproject to this project", class: 'btn btn-sm btn-primary' do %>
+    <%= link_to projects_path({'project[owner_uuid]' => @object.uuid, 'options' => {'ensure_unique_name' => true}}), method: :post, title: "Add a subproject to this project", class: 'btn btn-sm btn-primary' do %>
       <i class="fa fa-fw fa-plus"></i>
       Add a subproject
     <% end %>
diff --git a/apps/workbench/app/views/user_agreements/index.html.erb b/apps/workbench/app/views/user_agreements/index.html.erb
index d73ccff..4c80caf 100644
--- a/apps/workbench/app/views/user_agreements/index.html.erb
+++ b/apps/workbench/app/views/user_agreements/index.html.erb
@@ -9,7 +9,7 @@ User agreements
 <% end %>
 <% end %>
 
-<%= form_for(unsigned_user_agreements.first, {url: {action: 'sign', controller: 'user_agreements'}, method: 'post'}) do |f| %>
+<%= form_for(unsigned_user_agreements.first, {url: {action: 'sign', controller: 'user_agreements'}, method: :post}) do |f| %>
 <%= hidden_field_tag :return_to, request.url %>
 <div id="open_user_agreement">
   <div class="alert alert-info">
diff --git a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb
index efa8cae..8cd5ae3 100644
--- a/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb
+++ b/apps/workbench/app/views/users/_add_ssh_key_popup.html.erb
@@ -1,7 +1,7 @@
 <div class="modal-dialog modal-with-loading-spinner">
   <div class="modal-content">
 
-    <%= form_tag add_ssh_key_path, {method: 'get', id: 'add_new_key_form', name: 'add_new_key_form', class: 'form-search, new_authorized_key', remote: true} do %>
+    <%= form_tag add_ssh_key_path, {method: :get, id: 'add_new_key_form', name: 'add_new_key_form', class: 'form-search, new_authorized_key', remote: true} do %>
 
       <div class="modal-header">
         <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">×</button>
@@ -14,7 +14,7 @@
 
       <div class="modal-body">
         <div> <%= link_to "Click here to learn about SSH keys in Arvados.",
-	          "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", 
+	          "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
 	          style: "font-weight: bold",
 	          target: "_blank" %>
         </div>
diff --git a/apps/workbench/app/views/users/_manage_ssh_keys.html.erb b/apps/workbench/app/views/users/_manage_ssh_keys.html.erb
index 17b64b2..34dbb59 100644
--- a/apps/workbench/app/views/users/_manage_ssh_keys.html.erb
+++ b/apps/workbench/app/views/users/_manage_ssh_keys.html.erb
@@ -2,7 +2,7 @@
   <% if !@my_ssh_keys.any? %>
      <p> You have not yet set up an SSH public key for use with Arvados. </p>
      <p>  <%= link_to "Click here",
-	          "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", 
+	          "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
 	          style: "font-weight: bold",
 	          target: "_blank" %>  to learn about SSH keys in Arvados.
      </p>
@@ -43,7 +43,7 @@
               <% end %>
             </td>
             <td>
-              <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %>
+              <%= link_to(authorized_key_path(id: key[:uuid]), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %>
                   <i class="fa fa-fw fa-trash-o"></i>
               <% end %>
             </td>
diff --git a/apps/workbench/app/views/users/_setup_popup.html.erb b/apps/workbench/app/views/users/_setup_popup.html.erb
index e9429cf..f525635 100644
--- a/apps/workbench/app/views/users/_setup_popup.html.erb
+++ b/apps/workbench/app/views/users/_setup_popup.html.erb
@@ -1,7 +1,7 @@
 <div class="modal-dialog modal-with-loading-spinner">
   <div class="modal-content">
 
-    <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: 'get',
+    <%= form_tag setup_user_path, {id: 'setup_form', name: 'setup_form', method: :get,
         class: 'form-search', remote: true} do %>
 
     <div class="modal-header">
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index 45ca939..b0f5753 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -1,7 +1,7 @@
 <% if current_user.andand.is_active %>
   <div>
     <strong>Recent jobs</strong>
-    <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true, method: 'get'} %>
+    <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true} %>
     <%= link_to raw("Show all jobs →"), jobs_path, class: 'pull-right' %>
     <% if not current_user.andand.is_active or @my_jobs.empty? %>
       <p>(None)</p>
@@ -109,7 +109,7 @@
 
 <div>
   <strong>Recent pipeline instances</strong>
-  <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true, method: 'get'} %>
+  <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true} %>
   <%= link_to raw("Show all pipeline instances →"), pipeline_instances_path, class: 'pull-right' %>
   <% if not current_user.andand.is_active or @my_pipelines.empty? %>
     <p>(None)</p>
@@ -168,7 +168,7 @@
 
 <div>
   <strong>Recent collections</strong>
-  <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true, method: 'get'} %>
+  <%= link_to '(refresh)', {format: :js}, {class: 'refresh', remote: true} %>
   <%= link_to raw("Show all collections →"), collections_path, class: 'pull-right' %>
   <div class="pull-right" style="padding-right: 1em; width: 30%;">
     <%= form_tag collections_path,

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list