[ARVADOS] updated: 8c948701e887e96f05ffaf0adaec9da9f2533f72

Git user git at public.curoverse.com
Thu Apr 27 09:58:45 EDT 2017


Summary of changes:
 .../_extra_tab_line_buttons.html.erb               | 49 +++++++++++++++-------
 .../container_requests_controller_test.rb          |  5 +--
 2 files changed, 37 insertions(+), 17 deletions(-)

       via  8c948701e887e96f05ffaf0adaec9da9f2533f72 (commit)
      from  fed8ee006cdfc2029f287c656b184f3ce7507847 (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 8c948701e887e96f05ffaf0adaec9da9f2533f72
Author: Lucas Di Pentima <lucas at curoverse.com>
Date:   Thu Apr 27 10:55:26 2017 -0300

    11185: Now we only have one "Re-run" button that will give the user the option to disable container reuse on a modal dialog.
    Updated test.

diff --git a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
index 46f4bc9..6d5ba64 100644
--- a/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
+++ b/apps/workbench/app/views/container_requests/_extra_tab_line_buttons.html.erb
@@ -1,16 +1,37 @@
 <% if @object.state == 'Final' %>
-  <%= link_to(copy_container_request_path('id' => @object.uuid, 'no_reuse' => true),
-      class: 'btn btn-sm btn-primary',
-      data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it without container reuse',
-      method: :post,
-      ) do %>
-    <i class="fa fa-fw fa-play"></i> Re-run without reuse
-  <% end %>
-  <%= link_to(copy_container_request_path('id' => @object.uuid),
-      class: 'btn btn-sm btn-primary',
-      data: {toggle: :tooltip, placement: :top}, title: 'This will make a copy and take you there. You can then make any needed changes and run it',
-      method: :post,
-      ) do %>
-    <i class="fa fa-fw fa-play"></i> Re-run
-  <% end %>
+  <%= link_to raw('<i class="fa fa-fw fa-play"></i> Re-run'),
+      "#",
+      {class: 'btn btn-sm btn-primary', 'data-toggle' => 'modal',
+       'data-target' => '#clone-and-edit-modal-window',
+       title: 'This will make a copy and take you there. You can then make any needed changes and run it'}  %>
 <% end %>
+
+<div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
+     aria-labelledby="myModalLabel" aria-hidden="true">
+  <div class="modal-dialog">
+    <div class="modal-content">
+
+    <%= form_tag copy_container_request_path do |f| %>
+
+      <div class="modal-header">
+        <button type="button" class="close" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">×</button>
+        <div>
+          <div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
+        </div>
+        <br/>
+      </div>
+
+      <div class="modal-body">
+              <%= check_box_tag(:no_reuse, "true", false) %>
+              <%= label_tag(:script_use_latest, "Disable container reuse") %>
+      </div>
+
+      <div class="modal-footer">
+        <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+        <button type="submit" class="btn btn-primary" name="container_request[state]" value="Uncommitted">Copy and edit inputs</button>
+      </div>
+
+    </div>
+    <% end %>
+  </div>
+</div>
diff --git a/apps/workbench/test/controllers/container_requests_controller_test.rb b/apps/workbench/test/controllers/container_requests_controller_test.rb
index af7abcd..9b4009e 100644
--- a/apps/workbench/test/controllers/container_requests_controller_test.rb
+++ b/apps/workbench/test/controllers/container_requests_controller_test.rb
@@ -30,7 +30,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     assert_select 'Download the log', false
   end
 
-  test "completed container request offers re-run options" do
+  test "completed container request offers re-run option" do
     use_token 'active'
 
     uuid = api_fixture('container_requests')['completed']['uuid']
@@ -38,8 +38,7 @@ class ContainerRequestsControllerTest < ActionController::TestCase
     get :show, {id: uuid}, session_for(:active)
     assert_response :success
 
-   assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy\""
-   assert_includes @response.body, "href=\"/container_requests/#{uuid}/copy?no_reuse=true\""
+   assert_includes @response.body, "action=\"/container_requests/#{uuid}/copy\""
   end
 
   test "container request copy" do

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list