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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
677af1dd
Commit
677af1dd
authored
Nov 09, 2016
by
Lucas Deschamps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve changes after MR review.
parent
8c3e6987
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+2
-2
changelogs/unreleased/fix_navigation_bar_issuables_counters.yml
...logs/unreleased/fix_navigation_bar_issuables_counters.yml
+1
-1
spec/features/dashboard/issuables_counter_spec.rb
spec/features/dashboard/issuables_counter_spec.rb
+1
-1
No files found.
app/helpers/issuables_helper.rb
View file @
677af1dd
...
@@ -142,7 +142,7 @@ module IssuablesHelper
...
@@ -142,7 +142,7 @@ module IssuablesHelper
end
end
def
cached_assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
def
cached_assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
cache_key
=
"
#{
assignee
.
id
}
_
#{
issuable_type
}
_
#{
state
}
"
cache_key
=
hexdigest
([
'assigned_issuables_count'
,
assignee
.
id
,
issuable_type
,
state
].
join
(
'-'
))
Rails
.
cache
.
fetch
(
cache_key
,
expires_in:
2
.
minutes
)
do
Rails
.
cache
.
fetch
(
cache_key
,
expires_in:
2
.
minutes
)
do
assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
end
end
...
@@ -151,7 +151,7 @@ module IssuablesHelper
...
@@ -151,7 +151,7 @@ module IssuablesHelper
private
private
def
assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
def
assigned_issuables_count
(
assignee
,
issuable_type
,
state
)
assignee
.
send
(
"assigned_
#{
issuable_type
}
"
).
send
(
state
).
count
assignee
.
public_send
(
"assigned_
#{
issuable_type
}
"
).
public_
send
(
state
).
count
end
end
def
sidebar_gutter_collapsed?
def
sidebar_gutter_collapsed?
...
...
changelogs/unreleased/fix_navigation_bar_issuables_counters.yml
View file @
677af1dd
---
---
title
:
Navigation bar issuables counters reflects dashboard issuables counters
title
:
Navigation bar issuables counters reflects dashboard issuables counters
merge_request
:
merge_request
:
7368
author
:
Lucas Deschamps
author
:
Lucas Deschamps
spec/features/dashboard/issuables_counter_spec.rb
View file @
677af1dd
...
@@ -2,7 +2,7 @@ require 'spec_helper'
...
@@ -2,7 +2,7 @@ require 'spec_helper'
describe
'Navigation bar counter'
,
feature:
true
,
js:
true
,
caching:
true
do
describe
'Navigation bar counter'
,
feature:
true
,
js:
true
,
caching:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
let
(
:project
)
{
create
(
:
empty_
project
,
namespace:
user
.
namespace
)
}
before
do
before
do
login_as
(
user
)
login_as
(
user
)
...
...
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