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:
aignatov-bio 2024-07-10 15:11:39 +02:00 committed by GitHub
commit 6c47e6058f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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