Commit 3900b2f3 authored by Horacio Bertorello's avatar Horacio Bertorello

Hide archived project labels from group issue tracker

parent a704f9e5
......@@ -83,7 +83,12 @@ class LabelsFinder < UnionFinder
def projects
return @projects if defined?(@projects)
@projects = skip_authorization ? Project.all : ProjectsFinder.new(current_user: current_user).execute
@projects = if skip_authorization
Project.all
else
ProjectsFinder.new(params: { non_archived: true }, current_user: current_user).execute
end
@projects = @projects.in_namespace(params[:group_id]) if group?
@projects = @projects.where(id: params[:project_ids]) if projects?
@projects = @projects.reorder(nil)
......
---
title: Hide archived project labels from group issue tracker
merge_request: 12547
author: Horacio Bertorello
......@@ -49,12 +49,12 @@ describe LabelsFinder do
end
context 'filtering by group_id' do
it 'returns labels available for any project within the group' do
it 'returns labels available for any non-archived project within the group' do
group_1.add_developer(user)
project_1.archive!
finder = described_class.new(user, group_id: group_1.id)
expect(finder.execute).to eq [group_label_2, project_label_1, group_label_1, project_label_5]
expect(finder.execute).to eq [group_label_2, group_label_1, project_label_5]
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment