From ab038ffdf71d04214d13f5657440070f0adfd564 Mon Sep 17 00:00:00 2001 From: Miha Mencin Date: Tue, 2 Jul 2019 19:47:05 +0200 Subject: [PATCH] SCI-3649 adding catalog number, fixing up the design a bit --- .../protocols_io/v3/step_components.rb | 1 + .../protocol_importers/templates/_details.html.erb | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/utilities/protocol_importers/protocols_io/v3/step_components.rb b/app/utilities/protocol_importers/protocols_io/v3/step_components.rb index f8c83547d..31ba4bf9e 100644 --- a/app/utilities/protocol_importers/protocols_io/v3/step_components.rb +++ b/app/utilities/protocol_importers/protocols_io/v3/step_components.rb @@ -117,6 +117,7 @@ module ProtocolImporters name: desc_component[:source][:name], mol_weight: desc_component[:source][:mol_weight], details: { + catalog_number: desc_component[:source][:sku], link: desc_component[:source][:vendor][:link], linear_formula: desc_component[:source][:linfor] } diff --git a/app/views/protocol_importers/templates/_details.html.erb b/app/views/protocol_importers/templates/_details.html.erb index 40fee2b91..35c9eb462 100644 --- a/app/views/protocol_importers/templates/_details.html.erb +++ b/app/views/protocol_importers/templates/_details.html.erb @@ -1,6 +1,10 @@

- <%= item[:details]&.any? ? "#{t('protocol_importers.templates.details.title') }" : '' %> - <% item[:details]&.each do |k, v| %> - <%= "#{k.camelize.to_s}: #{v.to_s}" %> + <% if item[:details]&.any? %> + <%= t('protocol_importers.templates.details.title')%>: +
+ <% item[:details]&.each do |k, v| %> + <%= "#{k.humanize}: #{v.to_s}" %> +
+ <% end %> <% end %>