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
f590f9ff
Commit
f590f9ff
authored
Jun 30, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make issuables_count_for_state helper public
parent
d54ed686
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+13
-12
app/views/projects/issues/export_issues/_csv_download.html.haml
...ews/projects/issues/export_issues/_csv_download.html.haml
+1
-1
No files found.
app/helpers/issuables_helper.rb
View file @
f590f9ff
...
...
@@ -173,6 +173,7 @@ module IssuablesHelper
html
.
html_safe
end
def
cached_assigned_issuables_count
(
assignee
,
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
...
...
@@ -241,6 +242,18 @@ module IssuablesHelper
}
end
def
issuables_count_for_state
(
issuable_type
,
state
,
finder:
nil
)
finder
||=
public_send
(
"
#{
issuable_type
}
_finder"
)
cache_key
=
finder
.
state_counter_cache_key
(
state
)
@counts
||=
{}
@counts
[
cache_key
]
||=
Rails
.
cache
.
fetch
(
cache_key
,
expires_in:
2
.
minutes
)
do
finder
.
count_by_state
end
@counts
[
cache_key
][
state
]
end
private
def
sidebar_gutter_collapsed?
...
...
@@ -259,18 +272,6 @@ module IssuablesHelper
end
end
def
issuables_count_for_state
(
issuable_type
,
state
,
finder:
nil
)
finder
||=
public_send
(
"
#{
issuable_type
}
_finder"
)
cache_key
=
finder
.
state_counter_cache_key
(
state
)
@counts
||=
{}
@counts
[
cache_key
]
||=
Rails
.
cache
.
fetch
(
cache_key
,
expires_in:
2
.
minutes
)
do
finder
.
count_by_state
end
@counts
[
cache_key
][
state
]
end
def
issuable_templates
(
issuable
)
@issuable_templates
||=
case
issuable
...
...
app/views/projects/issues/export_issues/_csv_download.html.haml
View file @
f590f9ff
...
...
@@ -12,7 +12,7 @@
.modal-header
=
icon
(
'check'
,
{
class:
'export-checkmark'
})
%strong
#{
pluralize
(
cached_
issuables_count_for_state
(
:issues
,
params
[
:state
]),
'issue'
)
}
selected
#{
pluralize
(
issuables_count_for_state
(
:issues
,
params
[
:state
]),
'issue'
)
}
selected
.modal-body
%div
The CSV export will be created in the background. Once finished, it will be sent to
...
...
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