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
16b1512e
Commit
16b1512e
authored
Jan 17, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'reduce-queries-milestone-index' into 'master'
Use cached values to compute total issues count in milestone index pages See merge request !8518
parents
fbc1a06c
b11492c2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
3 deletions
+10
-3
milestoneish.rb
app/models/concerns/milestoneish.rb
+5
-2
_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+1
-1
reduce-queries-milestone-index.yml
changelogs/unreleased/reduce-queries-milestone-index.yml
+4
-0
No files found.
app/models/concerns/milestoneish.rb
View file @
16b1512e
...
...
@@ -7,11 +7,14 @@ module Milestoneish
def
total_items_count
(
user
)
memoize_per_user
(
user
,
:total_items_count
)
do
issues_count
=
count_issues_by_state
(
user
).
values
.
sum
issues_count
+
merge_requests
.
size
total_issues_count
(
user
)
+
merge_requests
.
size
end
end
def
total_issues_count
(
user
)
count_issues_by_state
(
user
).
values
.
sum
end
def
complete?
(
user
)
total_items_count
(
user
)
>
0
&&
total_items_count
(
user
)
==
closed_items_count
(
user
)
end
...
...
app/views/shared/milestones/_milestone.html.haml
View file @
16b1512e
...
...
@@ -9,7 +9,7 @@
.pull-right.light
#{
milestone
.
percent_complete
(
current_user
)
}
% complete
.row
.col-sm-6
=
link_to
pluralize
(
milestone
.
issues_visible_to_user
(
current_user
).
size
,
'Issue'
),
issues_path
=
link_to
pluralize
(
milestone
.
total_issues_count
(
current_user
)
,
'Issue'
),
issues_path
·
=
link_to
pluralize
(
milestone
.
merge_requests
.
size
,
'Merge Request'
),
merge_requests_path
.col-sm-6
=
milestone_progress_bar
(
milestone
)
...
...
changelogs/unreleased/reduce-queries-milestone-index.yml
0 → 100644
View file @
16b1512e
---
title
:
Use cached values to compute total issues count in milestone index pages
merge_request
:
8518
author
:
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