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
dfb66469
Commit
dfb66469
authored
Jan 16, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
259a6d1a
d3561721
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
0 deletions
+16
-0
app/controllers/dashboard/projects_controller.rb
app/controllers/dashboard/projects_controller.rb
+3
-0
app/controllers/explore/projects_controller.rb
app/controllers/explore/projects_controller.rb
+3
-0
app/views/dashboard/_projects_head.html.haml
app/views/dashboard/_projects_head.html.haml
+2
-0
changelogs/unreleased/add-badge-count-to-projects-and-groups.yml
...ogs/unreleased/add-badge-count-to-projects-and-groups.yml
+5
-0
spec/features/dashboard/projects_spec.rb
spec/features/dashboard/projects_spec.rb
+3
-0
No files found.
app/controllers/dashboard/projects_controller.rb
View file @
dfb66469
...
@@ -53,6 +53,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
...
@@ -53,6 +53,9 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
load_projects
(
finder_params
)
def
load_projects
(
finder_params
)
@total_user_projects_count
=
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
@total_starred_projects_count
=
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
projects
=
ProjectsFinder
projects
=
ProjectsFinder
.
new
(
params:
finder_params
,
current_user:
current_user
)
.
new
(
params:
finder_params
,
current_user:
current_user
)
.
execute
.
execute
...
...
app/controllers/explore/projects_controller.rb
View file @
dfb66469
...
@@ -55,6 +55,9 @@ class Explore::ProjectsController < Explore::ApplicationController
...
@@ -55,6 +55,9 @@ class Explore::ProjectsController < Explore::ApplicationController
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
def
load_projects
def
load_projects
@total_user_projects_count
=
ProjectsFinder
.
new
(
params:
{
non_public:
true
},
current_user:
current_user
).
execute
@total_starred_projects_count
=
ProjectsFinder
.
new
(
params:
{
starred:
true
},
current_user:
current_user
).
execute
projects
=
ProjectsFinder
.
new
(
current_user:
current_user
,
params:
params
)
projects
=
ProjectsFinder
.
new
(
current_user:
current_user
,
params:
params
)
.
execute
.
execute
.
includes
(
:route
,
:creator
,
:group
,
namespace:
[
:route
,
:owner
])
.
includes
(
:route
,
:creator
,
:group
,
namespace:
[
:route
,
:owner
])
...
...
app/views/dashboard/_projects_head.html.haml
View file @
dfb66469
...
@@ -15,9 +15,11 @@
...
@@ -15,9 +15,11 @@
=
nav_link
(
page:
[
dashboard_projects_path
,
root_path
])
do
=
nav_link
(
page:
[
dashboard_projects_path
,
root_path
])
do
=
link_to
dashboard_projects_path
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
=
link_to
dashboard_projects_path
,
class:
'shortcuts-activity'
,
data:
{
placement:
'right'
}
do
Your projects
Your projects
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
@total_user_projects_count
)
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
nav_link
(
page:
starred_dashboard_projects_path
)
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
=
link_to
starred_dashboard_projects_path
,
data:
{
placement:
'right'
}
do
Starred projects
Starred projects
%span
.badge.badge-pill
=
limited_counter_with_delimiter
(
@total_starred_projects_count
)
=
nav_link
(
page:
[
explore_root_path
,
trending_explore_projects_path
,
starred_explore_projects_path
,
explore_projects_path
])
do
=
nav_link
(
page:
[
explore_root_path
,
trending_explore_projects_path
,
starred_explore_projects_path
,
explore_projects_path
])
do
=
link_to
explore_root_path
,
data:
{
placement:
'right'
}
do
=
link_to
explore_root_path
,
data:
{
placement:
'right'
}
do
Explore projects
Explore projects
...
...
changelogs/unreleased/add-badge-count-to-projects-and-groups.yml
0 → 100644
View file @
dfb66469
---
title
:
Add badge count to projects and groups
merge_request
:
18425
author
:
George Tsiolis
type
:
changed
spec/features/dashboard/projects_spec.rb
View file @
dfb66469
...
@@ -93,6 +93,7 @@ describe 'Dashboard Projects' do
...
@@ -93,6 +93,7 @@ describe 'Dashboard Projects' do
visit
dashboard_projects_path
visit
dashboard_projects_path
expect
(
page
).
to
have_content
(
project
.
name
)
expect
(
page
).
to
have_content
(
project
.
name
)
expect
(
find
(
'.nav-links li:nth-child(1) .badge-pill'
)).
to
have_content
(
1
)
end
end
it
'shows personal projects on personal projects tab'
,
:js
do
it
'shows personal projects on personal projects tab'
,
:js
do
...
@@ -123,6 +124,8 @@ describe 'Dashboard Projects' do
...
@@ -123,6 +124,8 @@ describe 'Dashboard Projects' do
expect
(
page
).
not_to
have_content
(
project
.
name
)
expect
(
page
).
not_to
have_content
(
project
.
name
)
expect
(
page
).
to
have_content
(
project2
.
name
)
expect
(
page
).
to
have_content
(
project2
.
name
)
expect
(
find
(
'.nav-links li:nth-child(1) .badge-pill'
)).
to
have_content
(
1
)
expect
(
find
(
'.nav-links li:nth-child(2) .badge-pill'
)).
to
have_content
(
1
)
end
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