BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
80597d59
Commit
80597d59
authored
Dec 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dashboard-fix-assignee' into 'master'
Dashboard: fix assignee filter and remove some old code See merge request !1354
parents
a7b7a2dd
465f1869
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
42 deletions
+9
-42
application_controller.rb
app/controllers/application_controller.rb
+0
-4
dashboard_helper.rb
app/helpers/dashboard_helper.rb
+4
-34
_dashboard.html.haml
app/views/layouts/nav/_dashboard.html.haml
+2
-2
paths.rb
features/steps/shared/paths.rb
+3
-2
No files found.
app/controllers/application_controller.rb
View file @
80597d59
...
...
@@ -257,10 +257,6 @@ class ApplicationController < ActionController::Base
# or improve current implementation to filter only issues you
# created or assigned or mentioned
#@filter_params[:authorized_only] = true
unless
@filter_params
[
:assignee_id
]
@filter_params
[
:assignee_id
]
=
current_user
.
id
end
end
@filter_params
...
...
app/helpers/dashboard_helper.rb
View file @
80597d59
module
DashboardHelper
def
entities_per_project
(
project
,
entity
)
case
entity
.
to_sym
when
:issue
then
@issues
.
where
(
project_id:
project
.
id
)
when
:merge_request
then
@merge_requests
.
where
(
target_project_id:
project
.
id
)
else
[]
end
.
count
end
def
projects_dashboard_filter_path
(
options
=
{})
exist_opts
=
{
sort:
params
[
:sort
],
...
...
@@ -22,32 +13,11 @@ module DashboardHelper
path
end
def
assigned_entities_count
(
current_user
,
entity
,
scope
=
nil
)
items
=
current_user
.
send
(
'assigned_'
+
entity
.
pluralize
)
get_count
(
items
,
scope
)
end
def
authored_entities_count
(
current_user
,
entity
,
scope
=
nil
)
items
=
current_user
.
send
(
entity
.
pluralize
)
get_count
(
items
,
scope
)
def
assigned_issues_dashboard_path
issues_dashboard_path
(
assignee_id:
current_user
.
id
)
end
def
authorized_entities_count
(
current_user
,
entity
,
scope
=
nil
)
items
=
entity
.
classify
.
constantize
get_count
(
items
,
scope
,
true
,
current_user
)
end
protected
def
get_count
(
items
,
scope
,
get_authorized
=
false
,
current_user
=
nil
)
items
=
items
.
opened
if
scope
.
kind_of?
(
Group
)
items
=
items
.
of_group
(
scope
)
elsif
scope
.
kind_of?
(
Project
)
items
=
items
.
of_projects
(
scope
)
elsif
get_authorized
items
=
items
.
of_projects
(
current_user
.
authorized_projects
)
end
items
.
count
def
assigned_mrs_dashboard_path
merge_requests_dashboard_path
(
assignee_id:
current_user
.
id
)
end
end
app/views/layouts/nav/_dashboard.html.haml
View file @
80597d59
...
...
@@ -10,13 +10,13 @@
%span
Projects
=
nav_link
(
path:
'dashboard#issues'
)
do
=
link_to
issues_dashboard_path
,
class:
'shortcuts-issues'
do
=
link_to
assigned_
issues_dashboard_path
,
class:
'shortcuts-issues'
do
%i
.fa.fa-exclamation-circle
%span
Issues
%span
.count
=
current_user
.
assigned_issues
.
opened
.
count
=
nav_link
(
path:
'dashboard#merge_requests'
)
do
=
link_to
merge_request
s_dashboard_path
,
class:
'shortcuts-merge_requests'
do
=
link_to
assigned_mr
s_dashboard_path
,
class:
'shortcuts-merge_requests'
do
%i
.fa.fa-tasks
%span
Merge Requests
...
...
features/steps/shared/paths.rb
View file @
80597d59
module
SharedPaths
include
Spinach
::
DSL
include
RepoHelpers
include
DashboardHelper
step
'I visit new project page'
do
visit
new_project_path
...
...
@@ -71,11 +72,11 @@ module SharedPaths
end
step
'I visit dashboard issues page'
do
visit
issues_dashboard_path
visit
assigned_
issues_dashboard_path
end
step
'I visit dashboard merge requests page'
do
visit
merge_request
s_dashboard_path
visit
assigned_mr
s_dashboard_path
end
step
'I visit dashboard search page'
do
...
...
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