mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 02:04:33 +08:00
Merge pull request #7695 from aignatov-bio/ai-sci-10849-fix-preview-for-import-cells
Fix preview for cells creating [SCI-10849]
This commit is contained in:
commit
6c47e6058f
1 changed files with 7 additions and 4 deletions
|
@ -241,12 +241,15 @@ module RepositoryImportParser
|
|||
repository_cell
|
||||
else
|
||||
# Create new cell
|
||||
cell_value.repository_cell.value = cell_value
|
||||
repository_row.repository_cells << cell_value.repository_cell
|
||||
|
||||
if @preview
|
||||
cell_value.validate
|
||||
cell_value.repository_cell.id = SecureRandom.uuid.gsub(/[a-zA-Z-]/, '') unless cell_value.repository_cell.id.present? # ID required for preview with serializer
|
||||
repository_cell = repository_row.repository_cells.build(value: cell_value, repository_column: cell_value.repository_cell.repository_column)
|
||||
repository_cell.validate
|
||||
repository_cell.id = SecureRandom.uuid.gsub(/[a-zA-Z-]/, '') unless cell_value.repository_cell.id.present? # ID required for preview with serializer
|
||||
return repository_cell
|
||||
else
|
||||
cell_value.repository_cell.value = cell_value
|
||||
repository_row.repository_cells << cell_value.repository_cell
|
||||
cell_value.save!
|
||||
end
|
||||
@updated ||= true
|
||||
|
|
Loading…
Reference in a new issue