Merge branch 'issue-64738' into 'master'
Prevent archived projects from showing up in global search See merge request gitlab-org/gitlab-ce!31498
This commit is contained in:
commit
564d78dac1
3 changed files with 14 additions and 1 deletions
|
@ -18,7 +18,7 @@ module Search
|
|||
end
|
||||
|
||||
def projects
|
||||
@projects ||= ProjectsFinder.new(current_user: current_user).execute
|
||||
@projects ||= ProjectsFinder.new(params: { non_archived: true }, current_user: current_user).execute
|
||||
end
|
||||
|
||||
def allowed_scopes
|
||||
|
|
5
changelogs/unreleased/issue-64738.yml
Normal file
5
changelogs/unreleased/issue-64738.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Prevent archived projects from showing up in global search
|
||||
merge_request: 31498
|
||||
author: David Palubin
|
||||
type: fixed
|
|
@ -42,6 +42,14 @@ describe Search::GlobalService do
|
|||
|
||||
expect(results.objects('projects')).to match_array [found_project]
|
||||
end
|
||||
|
||||
it 'does not return archived projects' do
|
||||
archived_project = create(:project, :public, archived: true, name: 'archived_project')
|
||||
|
||||
results = described_class.new(user, search: "archived").execute
|
||||
|
||||
expect(results.objects('projects')).not_to include(archived_project)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue