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
de4e54e4
Commit
de4e54e4
authored
7 years ago
by
Takuya Noguchi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove duplicated queries
parent
5155dbd9
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
app/views/shared/milestones/_issuable.html.haml
app/views/shared/milestones/_issuable.html.haml
+3
-3
app/views/shared/milestones/_tabs.html.haml
app/views/shared/milestones/_tabs.html.haml
+6
-3
changelogs/unreleased/34736-n-1-problem-on-milestone-page.yml
...gelogs/unreleased/34736-n-1-problem-on-milestone-page.yml
+4
-0
No files found.
app/views/shared/milestones/_issuable.html.haml
View file @
de4e54e4
-# @project is present when viewing Project's milestone
-
project
=
@project
||
issuable
.
project
-
namespace
=
@project_namespace
||
project
.
namespace
.
becomes
(
Namespace
)
-
labels
=
issuable
.
labels
-
assignees
=
issuable
.
assignees
-
issuable_type
=
issuable
.
class
.
table_name
-
base_url_args
=
[
namespace
,
project
]
-
issuable_type_args
=
base_url_args
+
[
issuable
_typ
e
]
-
issuable_type_args
=
base_url_args
+
[
issuable
.
class
.
table_nam
e
]
-
issuable_url_args
=
base_url_args
+
[
issuable
]
%li
.issuable-row
...
...
@@ -20,7 +20,7 @@
=
link_to
[
namespace
,
project
,
issuable
]
do
%span
.issuable-number
=
issuable
.
to_reference
-
issuable
.
labels
.
each
do
|
label
|
-
labels
.
each
do
|
label
|
=
link_to
polymorphic_path
(
issuable_type_args
,
{
milestone_title:
@milestone
.
title
,
label_name:
label
.
title
,
state:
'all'
})
do
-
render_colored_label
(
label
)
...
...
This diff is collapsed.
Click to expand it.
app/views/shared/milestones/_tabs.html.haml
View file @
de4e54e4
-
issues_accessible
=
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
.scrolling-tabs-container.inner-page-scroll-tabs.is-smaller
.fade-left
=
icon
(
'angle-left'
)
.fade-right
=
icon
(
'angle-right'
)
%ul
.nav-links.scrolling-tabs.js-milestone-tabs
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
-
if
issues_accessible
%li
.active
=
link_to
'#tab-issues'
,
'data-toggle'
=>
'tab'
,
'data-show'
=>
'.tab-issues-buttons'
do
Issues
...
...
@@ -25,13 +27,14 @@
Labels
%span
.badge
=
milestone
.
labels
.
count
-
issues
=
milestone
.
sorted_issues
(
current_user
)
-
show_project_name
=
local_assigns
.
fetch
(
:show_project_name
,
false
)
-
show_full_project_name
=
local_assigns
.
fetch
(
:show_full_project_name
,
false
)
.tab-content.milestone-content
-
if
milestone
.
is_a?
(
GlobalMilestone
)
||
can?
(
current_user
,
:read_issue
,
@project
)
-
if
issues_accessible
.tab-pane.active
#tab-issues
{
data:
{
sort_endpoint:
(
sort_issues_project_milestone_path
(
@project
,
@milestone
)
if
@project
&&
current_user
)
}
}
=
render
'shared/milestones/issues_tab'
,
issues:
milestone
.
sorted_issues
(
current_user
)
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
=
render
'shared/milestones/issues_tab'
,
issues:
issues
,
show_project_name:
show_project_name
,
show_full_project_name:
show_full_project_name
.tab-pane
#tab-merge-requests
-# loaded async
=
render
"shared/milestones/tab_loading"
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/34736-n-1-problem-on-milestone-page.yml
0 → 100644
View file @
de4e54e4
---
title
:
N+1 problems on milestone page
merge_request
:
12670
author
:
Takuya Noguchi
This diff is collapsed.
Click to expand it.
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