13681: Implement WorkflowRunnerResources hint
[arvados.git] / apps / workbench / app / helpers / application_helper.rb
index 57b8d8780c6859e9063cabb7c43cfcb30a14d6bf..106716a0f72f178e826afc6eaaf2908ecb8afe0a 100644 (file)
@@ -426,18 +426,23 @@ module ApplicationHelper
     lt
   end
 
-  def get_cwl_inputs(workflow)
-    if workflow[:inputs]
-      return workflow[:inputs]
+  def get_cwl_main(workflow)
+    if workflow[:"$graph"].nil?
+      return workflow
     else
       workflow[:"$graph"].each do |tool|
         if tool[:id] == "#main"
-          return tool[:inputs]
+          return tool
         end
       end
     end
   end
 
+  def get_cwl_inputs(workflow)
+    get_cwl_main(workflow)[:inputs]
+  end
+
+
   def cwl_shortname(id)
     if id[0] == "#"
       id = id[1..-1]