Properly handle repository snapshots in reports [SCI-8212]

This commit is contained in:
Martin Artnik 2023-03-28 10:37:24 +02:00
parent 8f9e028577
commit f48350c6ea
2 changed files with 2 additions and 2 deletions

View file

@ -82,7 +82,7 @@ module ReportActions
my_module_element = save_element!({ 'my_module_id' => my_module.id }, :my_module, experiment_element)
my_module.live_and_snapshot_repositories_list.each do |repository|
next unless @repositories.include?(repository.id)
next unless @repositories.include?(repository.parent_id || repository.id)
save_element!(
{ 'my_module_id' => my_module.id, 'repository_id' => repository.id },

View file

@ -71,7 +71,7 @@
<span class="sci-checkbox-container">
<input type="checkbox"
class="sci-checkbox repositories-setting"
value="<%= repository.id %>"
value="<%= repository.is_a?(RepositorySnapshot) ? repository.parent_id : repository.id %>"
<%= 'checked' if report.new_record? ||
@project_contents[:repositories].include?(repository.id) ||
(repository.is_a?(Repository) && repository.repository_snapshots.exists?(id: @project_contents[:repositories])) %> />