2352: Address review feedback: (1) input can be edited even in Ready state, (2) pipel...
authorradhika <radhika@curoverse.com>
Sat, 10 May 2014 03:00:23 +0000 (23:00 -0400)
committerradhika <radhika@curoverse.com>
Sat, 10 May 2014 03:00:23 +0000 (23:00 -0400)
apps/workbench/app/models/pipeline_instance.rb
apps/workbench/app/views/pipeline_instances/_show_components.html.erb
sdk/cli/bin/arv-run-pipeline-instance
services/api/app/models/pipeline_instance.rb

index 93e950945b5072b5e3b53fb68ea34441ee459088..45e472fae923077bf850727272ed412193747a06 100644 (file)
@@ -19,7 +19,7 @@ class PipelineInstance < ArvadosBase
   
   def attribute_editable?(attr)
     attr && (attr.to_sym == :name ||
-            (attr.to_sym == :components and self.state == 'New'))
+            (attr.to_sym == :components and (self.state == 'New' || self.state == 'Ready')))
   end
 
   def attributes_for_display
index 3fae559f0aed3bec71b24dac1778700bdb3c6b8c..92da0d5e00128f985075a6dc55e539bbab831013 100644 (file)
@@ -100,7 +100,7 @@ setInterval(function(){$('a.refresh').click()}, 15000);
     <% end %>
   <% end %>
 
-  <% if @object.state == 'New' %>
+  <% if @object.state.in? ['New', 'Ready'] %>
     <%= render partial: 'show_components_editable', locals: {editable: true} %>
   <% else %>
     <%= render partial: 'show_components_editable', locals: {editable: false} %>
index 0550bbcac532d4da51a939a4164c238adcb308d1..b86b217194ee16f0dc0498201583a8ffa0fcfc5e 100755 (executable)
@@ -541,7 +541,6 @@ class WhRunPipelineInstance
         end
       end
       @instance[:components] = @components
-#      @instance[:active] = moretodo
       report_status
 
       if @options[:no_wait]
@@ -555,7 +554,6 @@ class WhRunPipelineInstance
           debuglog "interrupt", 0
           interrupted = true
           break
-          #abort
         end
       end
     end
@@ -580,18 +578,12 @@ class WhRunPipelineInstance
 
     if interrupted
      if success
-#        @instance[:active] = false
-#        @instance[:success] = success
         @instance[:state] = 'Complete'
      else
-#        @instance[:active] = nil
-#        @instance[:success] = nil
         @instance[:state] = 'Paused'
       end
     else
       if ended == @components.length or failed > 0
-#        @instance[:active] = false
-#        @instance[:success] = success
         @instance[:state] = success ? 'Complete' : 'Failed'
       end
     end
@@ -604,9 +596,8 @@ class WhRunPipelineInstance
   end
 
   def cleanup
-    if @instance
-#      @instance[:active] = false
-      @instance[:state] = 'New'  # should it be Failed?
+    if @instance and @instance[:state] == 'RunningOnClient'
+      @instance[:state] = 'Paused'
       @instance.save
     end
   end
index 24253bf0ae7539499d8d4bd1f12df89b05e6adb9..cea0ff691438119c68a9f650a56f0e66b2c974fc 100644 (file)
@@ -196,8 +196,8 @@ class PipelineInstance < ArvadosModel
     end
 
     if new_record? or 'components'.in? changed_attributes
-      state ||= New
-      if state == New and self.components_look_ready?
+      self.state ||= New
+      if self.state == New and self.components_look_ready?
         self.state = Ready
       end
     end