Skip to content
Snippets Groups Projects
Commit 0bd86052 authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch 'bvl-hide-archived-shared-projects' into 'master'

Hide archived projects from `shared_projects`

Closes #47206

See merge request gitlab-org/gitlab-ce!19361
parents 3997707b 2f50b206
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -24,7 +24,9 @@ module Groups
# Make the `search` param consistent for the frontend,
# which will be using `filter`.
params[:search] ||= params[:filter] if params[:filter]
params.permit(:sort, :search)
# Don't show archived projects
params[:non_archived] = true
params.permit(:sort, :search, :non_archived)
end
end
end
Loading
Loading
Loading
Loading
@@ -38,7 +38,7 @@ describe Groups::SharedProjectsController do
end
 
it 'allows filtering shared projects' do
project = create(:project, :archived, namespace: user.namespace, name: "Searching for")
project = create(:project, namespace: user.namespace, name: "Searching for")
share_project(project)
 
get_shared_projects(filter: 'search')
Loading
Loading
@@ -55,5 +55,14 @@ describe Groups::SharedProjectsController do
 
expect(json_project_ids).to eq([second_project.id, shared_project.id])
end
it 'does not include archived projects' do
archived_project = create(:project, :archived, namespace: user.namespace)
share_project(archived_project)
get_shared_projects
expect(json_project_ids).to contain_exactly(shared_project.id)
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment