[ARVADOS] created: ac3bafbcbc8e6d6c6b3be13e3e29b7ab7cf4ad7a
Git user
git at public.curoverse.com
Wed Apr 26 12:15:47 EDT 2017
at ac3bafbcbc8e6d6c6b3be13e3e29b7ab7cf4ad7a (commit)
commit ac3bafbcbc8e6d6c6b3be13e3e29b7ab7cf4ad7a
Author: radhika <radhika at curoverse.com>
Date: Wed Apr 26 12:15:24 2017 -0400
10112: add Run button to workflow#show page
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 fd79535..7f90af2 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,7 +1,6 @@
<% if @object.state == 'Final' %>
<%= link_to(copy_container_request_path('id' => @object.uuid),
class: 'btn btn-sm btn-primary',
- title: 'Re-run',
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 %>
diff --git a/apps/workbench/app/views/workflows/show.html.erb b/apps/workbench/app/views/workflows/show.html.erb
new file mode 100644
index 0000000..f14ac1e
--- /dev/null
+++ b/apps/workbench/app/views/workflows/show.html.erb
@@ -0,0 +1,20 @@
+<% if current_user.andand.is_active %>
+ <% content_for :tab_line_buttons do %>
+ <%= link_to(choose_projects_path(id: "run-workflow-button",
+ title: 'Choose project',
+ editable: true,
+ action_name: 'Choose',
+ action_href: work_units_path,
+ action_method: 'post',
+ action_data: {'selection_param' => 'work_unit[owner_uuid]',
+ 'work_unit[template_uuid]' => @object.uuid,
+ 'success' => 'redirect-to-created-object'
+ }.to_json),
+ { class: "btn btn-primary btn-sm", title: "Run #{@object.name}", remote: true }
+ ) do %>
+ <i class="fa fa-fw fa-gear"></i> Run this workflow
+ <% end %>
+ <% end %>
+<% end %>
+
+<%= render file: 'application/show.html.erb', locals: local_assigns %>
diff --git a/apps/workbench/test/integration/work_units_test.rb b/apps/workbench/test/integration/work_units_test.rb
index f9f5add..87a9771 100644
--- a/apps/workbench/test/integration/work_units_test.rb
+++ b/apps/workbench/test/integration/work_units_test.rb
@@ -278,4 +278,21 @@ class WorkUnitsTest < ActionDispatch::IntegrationTest
assert_text "This container request was created from the workflow #{wf_name}"
assert_match /Provide a value for .* then click the \"Run\" button to start the workflow/, page.text
end
+
+ test 'Run workflow from show page' do
+ visit page_with_token('active', '/workflows/zzzzz-7fd4e-validwithinputs')
+
+ find('a,button', text: 'Run this workflow').click
+
+ # Choose project for the container_request being created
+ within('.modal-dialog') do
+ find('.selectable', text: 'A Project').click
+ find('button', text: 'Choose').click
+ end
+
+ # In newly created container_request page now
+ assert_text 'A Project' # CR created in "A Project"
+ assert_text "This container request was created from the workflow"
+ assert_match /Provide a value for .* then click the \"Run\" button to start the workflow/, page.text
+ end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list