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
d8b7df3c
Commit
d8b7df3c
authored
Dec 08, 2016
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for nested groups to admin routing
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
3f768f9a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
48 additions
and
27 deletions
+48
-27
app/views/admin/dashboard/_head.html.haml
app/views/admin/dashboard/_head.html.haml
+1
-1
app/views/admin/dashboard/index.html.haml
app/views/admin/dashboard/index.html.haml
+1
-1
app/views/admin/groups/_group.html.haml
app/views/admin/groups/_group.html.haml
+1
-1
app/views/admin/groups/show.html.haml
app/views/admin/groups/show.html.haml
+2
-2
app/views/admin/projects/index.html.haml
app/views/admin/projects/index.html.haml
+6
-6
app/views/repository_check_mailer/notify.html.haml
app/views/repository_check_mailer/notify.html.haml
+1
-1
app/views/repository_check_mailer/notify.text.haml
app/views/repository_check_mailer/notify.text.haml
+1
-1
config/routes/admin.rb
config/routes/admin.rb
+16
-7
features/steps/shared/paths.rb
features/steps/shared/paths.rb
+1
-1
spec/features/admin/admin_groups_spec.rb
spec/features/admin/admin_groups_spec.rb
+1
-1
spec/features/admin/admin_projects_spec.rb
spec/features/admin/admin_projects_spec.rb
+3
-3
spec/features/security/admin_access_spec.rb
spec/features/security/admin_access_spec.rb
+1
-1
spec/routing/admin_routing_spec.rb
spec/routing/admin_routing_spec.rb
+13
-1
No files found.
app/views/admin/dashboard/_head.html.haml
View file @
d8b7df3c
...
...
@@ -8,7 +8,7 @@
%span
Overview
=
nav_link
(
controller:
[
:admin
,
:projects
])
do
=
link_to
admin_
namespaces_
projects_path
,
title:
'Projects'
do
=
link_to
admin_projects_path
,
title:
'Projects'
do
%span
Projects
=
nav_link
(
controller: :users
)
do
...
...
app/views/admin/dashboard/index.html.haml
View file @
d8b7df3c
...
...
@@ -116,7 +116,7 @@
.light-well.well-centered
%h4
Projects
.data
=
link_to
admin_
namespaces_
projects_path
do
=
link_to
admin_projects_path
do
%h1
=
number_with_delimiter
(
Project
.
cached_count
)
%hr
=
link_to
(
'New Project'
,
new_project_path
,
class:
"btn btn-new"
)
...
...
app/views/admin/groups/_group.html.haml
View file @
d8b7df3c
...
...
@@ -2,7 +2,7 @@
%li
.group-row
{
class:
css_class
}
.controls
=
link_to
'Edit'
,
edit_admin_group
_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
'btn'
=
link_to
'Edit'
,
admin_group_edit
_path
(
group
),
id:
"edit_
#{
dom_id
(
group
)
}
"
,
class:
'btn'
=
link_to
'Delete'
,
[
:admin
,
group
],
data:
{
confirm:
"Are you sure you want to remove
#{
group
.
name
}
?"
},
method: :delete
,
class:
'btn btn-remove'
.stats
%span
...
...
app/views/admin/groups/show.html.haml
View file @
d8b7df3c
...
...
@@ -2,7 +2,7 @@
%h3
.page-title
Group:
#{
@group
.
name
}
=
link_to
edit_admin_group
_path
(
@group
),
class:
"btn pull-right"
do
=
link_to
admin_group_edit
_path
(
@group
),
class:
"btn pull-right"
do
%i
.fa.fa-pencil-square-o
Edit
%hr
...
...
@@ -88,7 +88,7 @@
Read more about project permissions
%strong
=
link_to
"here"
,
help_page_path
(
"user/permissions"
),
class:
"vlink"
=
form_tag
members_update_admin_group
_path
(
@group
),
id:
"new_project_member"
,
class:
"bulk_import"
,
method: :put
do
=
form_tag
admin_group_members_update
_path
(
@group
),
id:
"new_project_member"
,
class:
"bulk_import"
,
method: :put
do
%div
=
users_select_tag
(
:user_ids
,
multiple:
true
,
email_user:
true
,
scope: :all
)
%div
.prepend-top-10
...
...
app/views/admin/projects/index.html.haml
View file @
d8b7df3c
...
...
@@ -7,7 +7,7 @@
%div
{
class:
container_class
}
.top-area
.prepend-top-default
=
form_tag
admin_
namespaces_
projects_path
,
method: :get
do
|
f
|
=
form_tag
admin_projects_path
,
method: :get
do
|
f
|
.search-holder
.search-field-holder
=
search_field_tag
:name
,
params
[
:name
],
class:
"form-control search-text-input js-search-input"
,
id:
"dashboard_search"
,
autofocus:
true
,
spellcheck:
false
,
placeholder:
'Search by name'
...
...
@@ -41,19 +41,19 @@
=
button_tag
"Search"
,
class:
"btn btn-primary btn-search"
%ul
.nav-links
-
opts
=
params
[
:visibility_level
].
present?
?
{}
:
{
page:
admin_
namespaces_
projects_path
}
-
opts
=
params
[
:visibility_level
].
present?
?
{}
:
{
page:
admin_projects_path
}
=
nav_link
(
opts
)
do
=
link_to
admin_
namespaces_
projects_path
do
=
link_to
admin_projects_path
do
All
=
nav_link
(
html_options:
{
class:
params
[
:visibility_level
]
==
Gitlab
::
VisibilityLevel
::
PRIVATE
.
to_s
?
'active'
:
''
})
do
=
link_to
admin_
namespaces_
projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
do
=
link_to
admin_projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PRIVATE
)
do
Private
=
nav_link
(
html_options:
{
class:
params
[
:visibility_level
]
==
Gitlab
::
VisibilityLevel
::
INTERNAL
.
to_s
?
'active'
:
''
})
do
=
link_to
admin_
namespaces_
projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
)
do
=
link_to
admin_projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
INTERNAL
)
do
Internal
=
nav_link
(
html_options:
{
class:
params
[
:visibility_level
]
==
Gitlab
::
VisibilityLevel
::
PUBLIC
.
to_s
?
'active'
:
''
})
do
=
link_to
admin_
namespaces_
projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
do
=
link_to
admin_projects_path
(
visibility_level:
Gitlab
::
VisibilityLevel
::
PUBLIC
)
do
Public
.nav-controls
...
...
app/views/repository_check_mailer/notify.html.haml
View file @
d8b7df3c
...
...
@@ -2,7 +2,7 @@
#{
@message
}
.
%p
=
link_to
"See the affected projects in the GitLab admin panel"
,
admin_
namespaces_
projects_url
(
last_repository_check_failed:
1
)
=
link_to
"See the affected projects in the GitLab admin panel"
,
admin_projects_url
(
last_repository_check_failed:
1
)
%p
You are receiving this message because you are a GitLab administrator for
#{
Gitlab
.
config
.
gitlab
.
url
}
.
app/views/repository_check_mailer/notify.text.haml
View file @
d8b7df3c
#{
@message
}
.
\
View details:
#{
admin_
namespaces_
projects_url
(
last_repository_check_failed:
1
)
}
View details:
#{
admin_projects_url
(
last_repository_check_failed:
1
)
}
You are receiving this message because you are a GitLab administrator
for
#{
Gitlab
.
config
.
gitlab
.
url
}
.
config/routes/admin.rb
View file @
d8b7df3c
...
...
@@ -28,9 +28,19 @@ namespace :admin do
resources
:applications
resources
:groups
,
constraints:
{
id:
/[^\/]+/
}
do
member
do
resources
:groups
,
only:
[
:index
,
:new
,
:create
]
scope
(
path:
'groups/*id'
,
controller: :groups
,
constraints:
{
id:
Gitlab
::
Regex
.
namespace_route_regex
})
do
scope
(
as: :group
)
do
put
:members_update
get
:edit
,
action: :edit
get
'/'
,
action: :show
patch
'/'
,
action: :update
put
'/'
,
action: :update
delete
'/'
,
action: :destroy
end
end
...
...
@@ -50,14 +60,13 @@ namespace :admin do
resource
:system_info
,
controller:
'system_info'
,
only:
[
:show
]
resources
:requests_profiles
,
only:
[
:index
,
:show
],
param: :name
,
constraints:
{
name:
/.+\.html/
}
resources
:namespaces
,
path:
'/projects'
,
constraints:
{
id:
/[a-zA-Z.0-9_\-]+/
},
only:
[]
do
root
to:
'projects#index'
,
as: :projects
resources
:projects
,
only:
[
:index
]
scope
(
path:
'projects/*namespace_id'
,
as: :namespace
)
do
resources
(
:projects
,
path:
'/'
,
constraints:
{
id:
/[a-zA-Z.0-9_\-]+/
},
only:
[
:index
,
:show
])
do
root
to:
'projects#show'
constraints:
{
id:
Gitlab
::
Regex
.
project_route_regex
},
only:
[
:show
])
do
member
do
put
:transfer
...
...
features/steps/shared/paths.rb
View file @
d8b7df3c
...
...
@@ -168,7 +168,7 @@ module SharedPaths
end
step
'I visit admin projects page'
do
visit
admin_
namespaces_
projects_path
visit
admin_projects_path
end
step
'I visit admin users page'
do
...
...
spec/features/admin/admin_groups_spec.rb
View file @
d8b7df3c
...
...
@@ -21,7 +21,7 @@ feature 'Admin Groups', feature: true do
scenario
'shows the visibility level radio populated with the group visibility_level value'
do
group
=
create
(
:group
,
:private
)
visit
edit_admin_group
_path
(
group
)
visit
admin_group_edit
_path
(
group
)
expect_selected_visibility
(
group
.
visibility_level
)
end
...
...
spec/features/admin/admin_projects_spec.rb
View file @
d8b7df3c
...
...
@@ -8,11 +8,11 @@ describe "Admin::Projects", feature: true do
describe
"GET /admin/projects"
do
before
do
visit
admin_
namespaces_
projects_path
visit
admin_projects_path
end
it
"is ok"
do
expect
(
current_path
).
to
eq
(
admin_
namespaces_
projects_path
)
expect
(
current_path
).
to
eq
(
admin_projects_path
)
end
it
"has projects list"
do
...
...
@@ -22,7 +22,7 @@ describe "Admin::Projects", feature: true do
describe
"GET /admin/projects/:id"
do
before
do
visit
admin_
namespaces_
projects_path
visit
admin_projects_path
click_link
"
#{
@project
.
name
}
"
end
...
...
spec/features/security/admin_access_spec.rb
View file @
d8b7df3c
...
...
@@ -4,7 +4,7 @@ describe "Admin::Projects", feature: true do
include
AccessMatchers
describe
"GET /admin/projects"
do
subject
{
admin_
namespaces_
projects_path
}
subject
{
admin_projects_path
}
it
{
is_expected
.
to
be_allowed_for
:admin
}
it
{
is_expected
.
to
be_denied_for
:user
}
...
...
spec/routing/admin_routing_spec.rb
View file @
d8b7df3c
...
...
@@ -66,7 +66,8 @@ describe Admin::ProjectsController, "routing" do
end
it
"to #show"
do
expect
(
get
(
"/admin/projects/gitlab"
)).
to
route_to
(
'admin/projects#show'
,
namespace_id:
'gitlab'
)
expect
(
get
(
"/admin/projects/gitlab/gitlab-ce"
)).
to
route_to
(
'admin/projects#show'
,
namespace_id:
'gitlab'
,
id:
'gitlab-ce'
)
expect
(
get
(
"/admin/projects/gitlab/subgroup/gitlab-ce"
)).
to
route_to
(
'admin/projects#show'
,
namespace_id:
'gitlab/subgroup'
,
id:
'gitlab-ce'
)
end
end
...
...
@@ -119,3 +120,14 @@ describe Admin::HealthCheckController, "routing" do
expect
(
get
(
"/admin/health_check"
)).
to
route_to
(
'admin/health_check#show'
)
end
end
describe
Admin
::
GroupsController
,
"routing"
do
it
"to #index"
do
expect
(
get
(
"/admin/groups"
)).
to
route_to
(
'admin/groups#index'
)
end
it
"to #show"
do
expect
(
get
(
"/admin/groups/gitlab"
)).
to
route_to
(
'admin/groups#show'
,
id:
'gitlab'
)
expect
(
get
(
"/admin/groups/gitlab/subgroup"
)).
to
route_to
(
'admin/groups#show'
,
id:
'gitlab/subgroup'
)
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