Merge branch '12627-token-scope'
[arvados.git] / apps / workbench / app / views / workflows / _show_definition.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <%
6   wf_def = ActiveSupport::HashWithIndifferentAccess.new YAML::load(@object.definition) if @object.definition
7   wf_def = wf_def[:"$graph"].andand[0] || wf_def if wf_def
8
9   items = {}
10   baseCommand = wf_def.andand["baseCommand"]
11   items['baseCommand'] = baseCommand if baseCommand
12
13   args = wf_def.andand["arguments"]
14   items['arguments'] = args if args
15
16   hints = wf_def.andand["hints"]
17   items['hints'] = hints if hints
18
19   inputs = wf_def.andand["inputs"]
20   items['inputs'] = inputs if inputs
21
22   outputs = wf_def.andand["outputs"]
23   items['outputs'] = outputs if outputs
24
25   # preload the collections
26   collections_pdhs = []
27   items.each do |k, v|
28     v.to_s.scan(/([0-9a-f]{32}\+\d+)/).each {|l| collections_pdhs += l}
29   end
30   collections_pdhs.compact.uniq
31   preload_for_pdhs collections_pdhs if collections_pdhs.any?
32   preload_links_for_objects collections_pdhs if collections_pdhs.any?
33 %>
34
35   <div class="col-md-12">
36     <table class="table table-condensed" style="table-layout:fixed;">
37       <col width="15%" />
38       <col width="85%" />
39
40       <% items.each do |k, v| %>
41           <tr>
42             <td valign="top">
43               <%= k %>:
44             </td>
45             <td>
46               <% val = JSON.pretty_generate(v) %>
47               <%= render partial: 'show_text_with_locators', locals: {data_height: 300, text_data: val} %>
48             </td>
49           </tr>
50       <% end %>
51     </table>
52   </div>