mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-08 22:24:23 +08:00
Merge pull request #786 from mlorb/ml-sci-1587
Fix bugs with importing samples [SCI-1587]
This commit is contained in:
commit
03743a21f6
2 changed files with 3 additions and 3 deletions
|
@ -106,7 +106,7 @@ class Team < ActiveRecord::Base
|
||||||
|
|
||||||
sheet.row(i).each.with_index do |value, index|
|
sheet.row(i).each.with_index do |value, index|
|
||||||
if index == stype_index
|
if index == stype_index
|
||||||
stype = SampleType.where(name: value, team: self).take
|
stype = SampleType.where(name: value.strip, team: self).take
|
||||||
|
|
||||||
unless stype
|
unless stype
|
||||||
stype = SampleType.new(name: value, team: self)
|
stype = SampleType.new(name: value, team: self)
|
||||||
|
@ -117,7 +117,7 @@ class Team < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
sample.sample_type = stype
|
sample.sample_type = stype
|
||||||
elsif index == sgroup_index
|
elsif index == sgroup_index
|
||||||
sgroup = SampleGroup.where(name: value, team: self).take
|
sgroup = SampleGroup.where(name: value.strip, team: self).take
|
||||||
|
|
||||||
unless sgroup
|
unless sgroup
|
||||||
sgroup = SampleGroup.new(name: value, team: self)
|
sgroup = SampleGroup.new(name: value, team: self)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<% if th.nil? %>
|
<% if th.nil? %>
|
||||||
<i><%= t('samples.modal_import.no_header_name') %></i>
|
<i><%= t('samples.modal_import.no_header_name') %></i>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% if th.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>
|
<% if th.to_s.length > Constants::NAME_TRUNCATION_LENGTH_DROPDOWN %>
|
||||||
<div class="modal-tooltip">
|
<div class="modal-tooltip">
|
||||||
<%= truncate(th, length: Constants::NAME_TRUNCATION_LENGTH_DROPDOWN) %>
|
<%= truncate(th, length: Constants::NAME_TRUNCATION_LENGTH_DROPDOWN) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue