to be able to use it on the tests.
Change the reset_form() JS function to something more specific to this usage, to avoid future
conflicts.
<% if @object.state == 'Final' %>
+<script type="application/javascript">
+ function reset_form_cr_reuse() {
+ $('#use_existing').removeAttr('checked');
+ }
+</script>
+
<%= 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'} %>
-<script type="application/javascript">
- function reset_form() {
- $('#use_existing').removeAttr('checked');
- }
-</script>
-
<div id="clone-and-edit-modal-window" class="modal fade" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<%= 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>
+ <button type="button" class="close" onClick="reset_form_cr_reuse()" data-dismiss="modal" aria-hidden="true">×</button>
<div>
<div class="col-sm-6"> <h4 class="modal-title">Re-run container request</h4> </div>
</div>
</div>
<div class="modal-footer">
- <button class="btn btn-default" onClick="reset_form()" data-dismiss="modal" aria-hidden="true">Cancel</button>
+ <button class="btn btn-default" onClick="reset_form_cr_reuse()" 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>
[
['completed', false, false],
['completed', true, false],
- ['completed-acr', false, true],
- ['completed-acr', true, true],
+ ['completed-older', false, true],
+ ['completed-older', true, true],
].each do |cr_fixture, reuse_enabled, uses_acr|
test "container request #{uses_acr ? '' : 'not'} using arvados-cwl-runner copy #{reuse_enabled ? 'with' : 'without'} reuse enabled" do
completed_cr = api_fixture('container_requests')[cr_fixture]
+ # Set up post request params
copy_params = {id: completed_cr['uuid']}
if reuse_enabled
copy_params.merge!({use_existing: true})
container_image: test
cwd: test
output_path: test
- command: ["echo", "hello"]
- container_uuid: zzzzz-dz642-compltcontainr2
- runtime_constraints:
- vcpus: 1
- ram: 123
-
-completed-acr:
- uuid: zzzzz-xvhdp-cr4completedacr
- owner_uuid: zzzzz-tpzed-xurymjxw79nv3jz
- name: completed
- state: Final
- priority: 1
- created_at: 2016-01-11 11:11:11.111111111 Z
- updated_at: 2016-01-11 11:11:11.111111111 Z
- modified_at: 2016-01-11 11:11:11.111111111 Z
- modified_by_user_uuid: zzzzz-tpzed-xurymjxw79nv3jz
- container_image: test
- cwd: test
- output_path: test
command: ["arvados-cwl-runner", "echo", "hello"]
container_uuid: zzzzz-dz642-compltcontainr2
runtime_constraints: