[ARVADOS] updated: 08b394b0df66374a75dab082ca858dda6e4beae3

git at public.curoverse.com git at public.curoverse.com
Sat Sep 6 00:16:34 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/selection.js           |  2 +-
 apps/workbench/app/controllers/actions_controller.rb         |  3 ++-
 apps/workbench/app/views/collections/_show_files.html.erb    |  9 +++++++--
 apps/workbench/app/views/collections/_show_recent.html.erb   |  9 +++++++--
 .../workbench/app/views/projects/_show_tab_contents.html.erb | 12 +++++++++---
 apps/workbench/config/routes.rb                              |  2 +-
 6 files changed, 27 insertions(+), 10 deletions(-)

       via  08b394b0df66374a75dab082ca858dda6e4beae3 (commit)
      from  852573d60776116bed4e86431667abf8c77d3f9a (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 08b394b0df66374a75dab082ca858dda6e4beae3
Author: radhika <radhika at curoverse.com>
Date:   Sat Sep 6 00:15:51 2014 -0400

    3654: use POST method to combine selections.

diff --git a/apps/workbench/app/assets/javascripts/selection.js b/apps/workbench/app/assets/javascripts/selection.js
index cf31fd7..bcc33c4 100644
--- a/apps/workbench/app/assets/javascripts/selection.js
+++ b/apps/workbench/app/assets/javascripts/selection.js
@@ -213,7 +213,7 @@ function enable_disable_selection_actions() {
         toggleClass('disabled',
                     ($checked.filter('[value*=-j7d0g-]').length > 0) ||
                     ($checked.length < 1));
-    $('[data-selection-action=combine]').
+    $('[data-selection-action=combine-project-contents]').
         closest('li').
         toggleClass('disabled',
                     ($checked.filter('[value*=-4zz18-]').length < 1) ||
diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index bda7ca3..52a89cc 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -170,7 +170,8 @@ class ActionsController < ApplicationController
       l.save!
     end
 
-    if params["show_project"]
+    action_data = JSON.parse(params['action_data']) if params['action_data']
+    if action_data && action_data['selection_param'].eql?('project')
       respond_to do |format|
         format.js {render inline: "location.reload();" }
       end
diff --git a/apps/workbench/app/views/collections/_show_files.html.erb b/apps/workbench/app/views/collections/_show_files.html.erb
index 8dbc9ba..581d74e 100644
--- a/apps/workbench/app/views/collections/_show_files.html.erb
+++ b/apps/workbench/app/views/collections/_show_files.html.erb
@@ -4,11 +4,16 @@
       <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 selections into a new collection", '/combine_selected',
-                  'data-href' => url_for('/combine_selected'),
+          <li><%= link_to "Combine selections into a new collection", '#',
+                  'data-href' => combine_selected_path(
+                    action_href: actions_path,
+                    action_method: 'post',
+                    action_data_from_params: ['selection'],
+                  ),
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
                   'data-remote' => true,
+                  '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 221e0aa..e2dcd89 100644
--- a/apps/workbench/app/views/collections/_show_recent.html.erb
+++ b/apps/workbench/app/views/collections/_show_recent.html.erb
@@ -4,11 +4,16 @@
       <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 selections into a new collection", '/combine_selected',
-                  'data-href' => url_for('/combine_selected'),
+          <li><%= link_to "Combine selections into a new collection", '#',
+                  'data-href' => combine_selected_path(
+                    action_href: actions_path,
+                    action_method: 'post',
+                    action_data_from_params: ['selection'],
+                  ),
                   'data-selection-param-name' => 'selection[]',
                   'data-selection-action' => 'combine-collections',
                   'data-remote' => true,
+                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
         </ul>
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 2789542..1a2d141 100644
--- a/apps/workbench/app/views/projects/_show_tab_contents.html.erb
+++ b/apps/workbench/app/views/projects/_show_tab_contents.html.erb
@@ -4,11 +4,17 @@
       <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 selections into a new collection", '/combine_selected',
-                  'data-href' => url_for('/combine_selected?show_project=true'),
+          <li><%= link_to "Combine selections into a new collection", '#',
+                  'data-href' => combine_selected_path(
+                    action_href: actions_path,
+                    action_method: 'post',
+                    action_data_from_params: ['selection'],
+                    action_data: {selection_param: 'project'}.to_json
+                  ),
                   'data-selection-param-name' => 'selection[]',
-                  'data-selection-action' => 'combine',
+                  'data-selection-action' => 'combine-project-contents',
                   'data-remote' => true,
+                  'method' => 'post',
                   'data-toggle' => 'dropdown'
             %></li>
           <li><%= link_to "Compare selected", 'action',
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 6236e0c..65a8e54 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -80,7 +80,7 @@ ArvadosWorkbench::Application.routes.draw do
   post 'actions' => 'actions#post'
   get 'actions' => 'actions#show'
   get 'websockets' => 'websocket#index'
-  get 'combine_selected' => 'actions#combine_selected_files_into_collection', :as => :combine_selected
+  post "combine_selected" => 'actions#combine_selected_files_into_collection'
 
   root :to => 'projects#index'
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list