Merge branch 'master' into 3088-project-chooser-on-run-pipeline-template
authorradhika <radhika@curoverse.com>
Fri, 27 Jun 2014 14:19:59 +0000 (10:19 -0400)
committerradhika <radhika@curoverse.com>
Fri, 27 Jun 2014 14:19:59 +0000 (10:19 -0400)
apps/workbench/app/views/collections/_index_tbody.html.erb
apps/workbench/app/views/collections/_show_recent.html.erb
apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
apps/workbench/app/views/pipeline_templates/_show_components.html.erb
apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
apps/workbench/app/views/users/_tables.html.erb
apps/workbench/test/integration/pipeline_instances_test.rb

index deba78e47b7f2723b2fa10da36a7674b357a123f..ec5a09e3c6a8a1c676cabb74d0f9fc40e75c2770 100644 (file)
@@ -26,7 +26,7 @@
     <% end %>
   </td>
   <td>
-    <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if c.created_at %>
+    <%= c.created_at.to_s if c.created_at %>
   </td>
   <td>
     <% current_state = @collection_info[c.uuid][:wanted_by_me] ? 'persistent' : 'cache' %>
index 80640ad3991bb20ada08bc5154a4ac2806f5f685..21a815c40cc0b0cb7363263ae43c76fa36dcbed8 100644 (file)
@@ -33,7 +33,7 @@
       <th></th>
       <th>uuid</th>
       <th>contents</th>
-      <th>age</th>
+      <th>created at</th>
       <th>storage</th>
       <th>tags</th>
     </tr>
index 86eab623f6595508043ee31634580435056caceb..fc67e1791a93954ac447c25fa17f21c234cf1e6a 100644 (file)
@@ -31,7 +31,7 @@
       </th><th>
        Owner
       </th><th>
-       Age
+       Created at
       </th><th>
       </th>
     </tr>
@@ -52,7 +52,7 @@
       </td><td>
         <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
       </td><td>
-        <%= distance_of_time_in_words(ob.created_at, Time.now) %>
+        <%= ob.created_at.to_s %>
       </td><td>
         <%= render partial: 'delete_object_button', locals: {object:ob} %>
       </td>
index 1624fd7eb01d4f9cb56a2627fee1ffb1ac83928e..509b86a10ef6139b8db7c7f3d3f5310f72fa3485 100644 (file)
@@ -1,8 +1,18 @@
 <% content_for :tab_line_buttons do %>
-  <%= form_tag '/pipeline_instances' do |f| %>
-  <%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => @object.uuid %>
-  <%= button_tag "Run this pipeline", {class: 'btn btn-primary pull-right', id: "run-pipeline-button"} %>
-<% end %>
+  <%= button_to(choose_projects_path(id: "run-pipeline-button",
+                                     title: 'Choose project',
+                                     editable: true,
+                                     action_name: 'Choose',
+                                     action_href: pipeline_instances_path,
+                                     action_method: 'post',
+                                     action_data: {selection_param: 'pipeline_instance[owner_uuid]',
+                                                   'pipeline_instance[pipeline_template_uuid]' => @object.uuid,
+                                                   'success' => 'redirect-to-created-object'
+                                                  }.to_json),
+                { class: "btn btn-primary btn-sm", remote: true, method: 'get' }
+               ) do %>
+                   <i class="fa fa-fw fa-folder"></i> Run this pipeline
+                 <% end %>
 <% end %>
 
 <%= render partial: 'pipeline_instances/show_components_editable', locals: {editable: false} %>
index f18f515ac3533388c3eda2bf43e400ca73036909..c580e46b386d012b91cc3d774671b970a1c5bc06 100644 (file)
 
     <tr>
       <td>
-        <%= form_tag '/pipeline_instances' do |f| %>
-          <%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => ob.uuid %>
-          <%= button_tag nil, {class: "btn btn-default btn-xs", title: "Run #{ob.name}"} do %>
-            Run <i class="fa fa-fw fa-play"></i>
-          <% end %>
-        <% end %>
+        <%= button_to(choose_projects_path(id: "run-pipeline-button",
+                                     title: 'Choose project',
+                                     editable: true,
+                                     action_name: 'Choose',
+                                     action_href: pipeline_instances_path,
+                                     action_method: 'post',
+                                     action_data: {selection_param: 'pipeline_instance[owner_uuid]',
+                                                   'pipeline_instance[pipeline_template_uuid]' => ob.uuid,
+                                                   'success' => 'redirect-to-created-object'
+                                                  }.to_json),
+                { class: "btn btn-default btn-xs", title: "Run #{ob.name}", remote: true, method: 'get' }
+            ) do %>
+               Run <i class="fa fa-fw fa-play"></i>
+              <% end %>
       </td>
       <td>
         <%= render :partial => "show_object_button", :locals => {object: ob, size: 'xs'} %>
index a8c00e75442e76b0925a088454177bc90ce8a4ad..ebb52019a9f57d3912c7cc4c9b2383eec689d9b6 100644 (file)
@@ -20,7 +20,7 @@
           <th>Script</th>
           <th>Output</th>
           <th>Log</th>
-          <th>Age</th>
+          <th>Created at</th>
           <th>Status</th>
           <th>Progress</th>
         </tr>
@@ -92,7 +92,7 @@
 
 <td>
   <small>
-    <%= raw(distance_of_time_in_words(j.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if j.created_at %>
+    <%= j.created_at.to_s if j.created_at %>
   </small>
 </td>
 
       <tr>
         <th>Instance</th>
         <th>Template</th>
-        <th>Age</th>
+        <th>Created at</th>
         <th>Status</th>
         <th>Progress</th>
       </tr>
 
           <td>
             <small>
-              <%= raw(distance_of_time_in_words(p.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if p.created_at %>
+              <%= (p.created_at.to_s) if p.created_at %>
             </small>
           </td>
 
           </td>
           <td>
             <small>
-              <%= raw(distance_of_time_in_words(c.created_at, Time.now).sub('about ','~').sub(' ','&nbsp;')) if c.created_at %>
+              <%= c.created_at.to_s if c.created_at %>
             </small>
           </td>
           <td>
index e33944563ab58c0e7c75c946f961d792a008924b..5071fb47666bee5fe73813a3e50cc93d9b3580a2 100644 (file)
@@ -18,18 +18,17 @@ class PipelineInstancesTest < ActionDispatch::IntegrationTest
       find('a,button', text: 'Run').click
     end
 
+    # project chooser
+    within('.modal-dialog') do
+      find('.selectable', text: 'A Project').click
+      find('button', text: 'Choose').click
+    end
+
     # This pipeline needs input. So, Run should be disabled
     page.assert_selector 'a.disabled,button.disabled', text: 'Run'
 
     instance_page = current_path
 
-    # put this pipeline instance in "A Project"
-    find('button', text: 'Choose a project...').click
-    within('.modal-dialog') do
-      find('.selectable', text: 'A Project').click
-      find('button', text: 'Move').click
-    end
-
     # Go over to the collections page and select something
     visit '/collections'
     within('tr', text: 'GNU_General_Public_License') do