Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
222e1dc5
Commit
222e1dc5
authored
Apr 06, 2016
by
PotHix
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #14638.
The SQL query was ambiguous and in this case we want to filter projects.
parent
801e870d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
CHANGELOG
CHANGELOG
+1
-0
app/controllers/admin/projects_controller.rb
app/controllers/admin/projects_controller.rb
+1
-1
spec/controllers/admin/projects_controller_spec.rb
spec/controllers/admin/projects_controller_spec.rb
+23
-0
No files found.
CHANGELOG
View file @
222e1dc5
...
...
@@ -22,6 +22,7 @@ v 8.7.0 (unreleased)
- Fall back to `In-Reply-To` and `References` headers when sub-addressing is not available (David Padilla)
- Remove "Congratulations!" tweet button on newly-created project. (Connor Shea)
- Improved UX of the navigation sidebar
- Fix admin/projects when using visibility levels on search (PotHix)
- Build status notifications
- API: Ability to retrieve a specific tag (Robert Schilling)
- API: Expose user location (Robert Schilling)
...
...
app/controllers/admin/projects_controller.rb
View file @
222e1dc5
...
...
@@ -5,7 +5,7 @@ class Admin::ProjectsController < Admin::ApplicationController
def
index
@projects
=
Project
.
all
@projects
=
@projects
.
in_namespace
(
params
[
:namespace_id
])
if
params
[
:namespace_id
].
present?
@projects
=
@projects
.
where
(
"visibility_level IN (?)"
,
params
[
:visibility_levels
])
if
params
[
:visibility_levels
].
present?
@projects
=
@projects
.
where
(
"
projects.
visibility_level IN (?)"
,
params
[
:visibility_levels
])
if
params
[
:visibility_levels
].
present?
@projects
=
@projects
.
with_push
if
params
[
:with_push
].
present?
@projects
=
@projects
.
abandoned
if
params
[
:abandoned
].
present?
@projects
=
@projects
.
non_archived
unless
params
[
:with_archived
].
present?
...
...
spec/controllers/admin/projects_controller_spec.rb
0 → 100644
View file @
222e1dc5
require
'spec_helper'
describe
Admin
::
ProjectsController
do
let!
(
:project
)
{
create
(
:project
,
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
}
before
do
sign_in
(
create
(
:admin
))
end
describe
'GET /projects'
do
render_views
it
'retrieves the project for the given visibility level'
do
get
:index
,
visibility_levels:
[
Gitlab
::
VisibilityLevel
::
PUBLIC
]
expect
(
response
.
body
).
to
match
(
project
.
name
)
end
it
'does not retrieve the project'
do
get
:index
,
visibility_levels:
[
Gitlab
::
VisibilityLevel
::
INTERNAL
]
expect
(
response
.
body
).
to_not
match
(
project
.
name
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment