Merge pull request #3301 from okriuchykhin/ok_SCI_5691

Hide empty projects in reports editor [SCI-5691]
This commit is contained in:
Miha Mencin 2021-05-10 10:47:23 +02:00 committed by GitHub
commit b4b7783cd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -512,9 +512,12 @@ class ReportsController < ApplicationController
def load_visible_projects
render_404 unless current_team
@visible_projects = Project.viewable_by_user(
current_user, current_team
).select(:id, :name)
@visible_projects = Project.active
.viewable_by_user(current_user, current_team)
.joins(experiments: :my_modules)
.merge(Experiment.active)
.merge(MyModule.active)
.select(:id, :name)
end
def load_available_repositories