17154: Make sure most current user record is loaded.
[arvados.git] / apps / workbench / app / views / workflows / _show_definition.html.erb
index 3ca15e2ca6bea6aa2d9a76faabbc21f2ac7f74a2..f0e01a12ade39e76369edfad83816c0668d77dd3 100644 (file)
@@ -1,3 +1,7 @@
+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
 <%
   wf_def = ActiveSupport::HashWithIndifferentAccess.new YAML::load(@object.definition) if @object.definition
   wf_def = wf_def[:"$graph"].andand[0] || wf_def if wf_def
 
   outputs = wf_def.andand["outputs"]
   items['outputs'] = outputs if outputs
+
+  # preload the collections
+  collections_pdhs = []
+  items.each do |k, v|
+    v.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|l| collections_pdhs += l}
+  end
+  collections_pdhs.compact.uniq
+  preload_for_pdhs collections_pdhs if collections_pdhs.any?
+  preload_links_for_objects collections_pdhs if collections_pdhs.any?
 %>
 
   <div class="col-md-12">