SCI-3649 All reagent data from step are not imported (#1881)

SCI-3649 All reagent data from step are not imported
This commit is contained in:
Jure Grabnar 2019-07-03 16:54:25 +02:00 committed by GitHub
commit 721bb9ab77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 11 deletions

View file

@ -115,10 +115,11 @@ module ProtocolImporters
{ {
type: 'reagent', type: 'reagent',
name: desc_component[:source][:name], name: desc_component[:source][:name],
mol_weight: desc_component[:source][:mol_weight],
details: { details: {
catalog_number: desc_component[:source][:sku],
link: desc_component[:source][:vendor][:link], link: desc_component[:source][:vendor][:link],
linear_formula: desc_component[:source][:linfor] linear_formula: desc_component[:source][:linfor],
mol_weight: desc_component[:source][:mol_weight]
} }
} }
when :gotostep when :gotostep

View file

@ -1,6 +1,10 @@
<p> <p>
<%= item[:details]&.any? ? "<b>#{t('protocol_importers.templates.details.title') }</b>" : '' %> <% if item[:details]&.any? %>
<% item[:details]&.each do |k, v| %> <b> <%= t('protocol_importers.templates.details.title')%>: </b>
<%= "#{k.camelize.to_s}: #{v.to_s}" %> <br />
<% item[:details].reject { |_,v| v.blank? }.each do |k, v| %>
<%= "#{k.humanize}: #{v.to_s}" %>
<br />
<% end %>
<% end %> <% end %>
</p> </p>

View file

@ -1,7 +1,15 @@
<p class="step-description-component-reagent"><b><%= t('protocol_importers.templates.reagent.title') %></b><br/> <p class="step-description-component-reagent">
<b><%= t('protocol_importers.templates.reagent.title') %></b>
<br/>
<%= "#{t('protocol_importers.templates.reagent.name')}: #{item[:name]}" %> <%= "#{t('protocol_importers.templates.reagent.name')}: #{item[:name]}" %>
<%= "#{t('protocol_importers.templates.reagent.mol_weight')}: #{item[:mol_weight]}" %> <% if item[:source] %>
<%= "#{t('protocol_importers.templates.reagent.link')}: <a href='#{item[:source]}'>#{item[:source]}</a>" if item[:source] %> <%= t('protocol_importers.templates.reagent.link') %>:
<%= "<a href='#{item[:source]}'>#{item[:source]}</a>" %>
<% end -%>
</p> </p>
<%= render partial: 'protocol_importers/templates/details', locals: { item: item } %> <%= render(
partial: 'protocol_importers/templates/details',
locals: { item: item }
)
%>

View file

@ -72,10 +72,11 @@
{ {
"type": "reagent", "type": "reagent",
"name": "2 mg Gastrin I, human", "name": "2 mg Gastrin I, human",
"mol_weight": 0.1,
"details": { "details": {
"catalog_number": "",
"link": "https://www.biorbyt.com/gastrin-i-human-orb321073", "link": "https://www.biorbyt.com/gastrin-i-human-orb321073",
"linear_formula": "C130H204N38O31S" "linear_formula": "C130H204N38O31S",
"mol_weight": 0.1
} }
}, },
{ {