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
7c5af3ea
Commit
7c5af3ea
authored
8 years ago
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More aggressively preload on merge request and issue index pages
parent
aea8baed
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
7 deletions
+13
-7
app/controllers/concerns/issuable_collections.rb
app/controllers/concerns/issuable_collections.rb
+2
-2
app/controllers/concerns/issues_action.rb
app/controllers/concerns/issues_action.rb
+0
-1
app/controllers/concerns/merge_requests_action.rb
app/controllers/concerns/merge_requests_action.rb
+0
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+0
-1
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+4
-2
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+3
-0
changelogs/unreleased/optimize-mr-index.yml
changelogs/unreleased/optimize-mr-index.yml
+4
-0
No files found.
app/controllers/concerns/issuable_collections.rb
View file @
7c5af3ea
...
...
@@ -10,11 +10,11 @@ module IssuableCollections
private
def
issues_collection
issues_finder
.
execute
issues_finder
.
execute
.
preload
(
:project
,
:author
,
:assignee
,
:labels
,
:milestone
,
project: :namespace
)
end
def
merge_requests_collection
merge_requests_finder
.
execute
merge_requests_finder
.
execute
.
preload
(
:source_project
,
:target_project
,
:author
,
:assignee
,
:labels
,
:milestone
,
:merge_request_diff
,
target_project: :namespace
)
end
def
issues_finder
...
...
This diff is collapsed.
Click to expand it.
app/controllers/concerns/issues_action.rb
View file @
7c5af3ea
...
...
@@ -7,7 +7,6 @@ module IssuesAction
@issues
=
issues_collection
.
non_archived
.
preload
(
:author
,
:project
)
.
page
(
params
[
:page
])
respond_to
do
|
format
|
...
...
This diff is collapsed.
Click to expand it.
app/controllers/concerns/merge_requests_action.rb
View file @
7c5af3ea
...
...
@@ -7,7 +7,6 @@ module MergeRequestsAction
@merge_requests
=
merge_requests_collection
.
non_archived
.
preload
(
:author
,
:target_project
)
.
page
(
params
[
:page
])
end
end
This diff is collapsed.
Click to expand it.
app/controllers/projects/merge_requests_controller.rb
View file @
7c5af3ea
...
...
@@ -38,7 +38,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController
def
index
@merge_requests
=
merge_requests_collection
@merge_requests
=
@merge_requests
.
page
(
params
[
:page
])
@merge_requests
=
@merge_requests
.
preload
(
:target_project
)
if
params
[
:label_name
].
present?
labels_params
=
{
project_id:
@project
.
id
,
title:
params
[
:label_name
]
}
...
...
This diff is collapsed.
Click to expand it.
app/helpers/issuables_helper.rb
View file @
7c5af3ea
...
...
@@ -171,9 +171,11 @@ module IssuablesHelper
def
issuables_count_for_state
(
issuable_type
,
state
)
issuables_finder
=
public_send
(
"
#{
issuable_type
}
_finder"
)
issuables_finder
.
params
[
:state
]
=
state
params
=
issuables_finder
.
params
.
merge
(
state:
state
)
finder
=
issuables_finder
.
class
.
new
(
issuables_finder
.
current_user
,
params
)
issuables_
finder
.
execute
.
page
(
1
).
total_count
finder
.
execute
.
page
(
1
).
total_count
end
IRRELEVANT_PARAMS_FOR_CACHE_KEY
=
%i[utf8 sort page]
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/merge_requests/_merge_request.html.haml
View file @
7c5af3ea
...
...
@@ -54,15 +54,18 @@
=
link_to
namespace_project_commits_path
(
merge_request
.
project
.
namespace
,
merge_request
.
project
,
merge_request
.
target_branch
)
do
=
icon
(
'code-fork'
)
=
merge_request
.
target_branch
-
if
merge_request
.
milestone
=
link_to
namespace_project_merge_requests_path
(
merge_request
.
project
.
namespace
,
merge_request
.
project
,
milestone_title:
merge_request
.
milestone
.
title
)
do
=
icon
(
'clock-o'
)
=
merge_request
.
milestone
.
title
-
if
merge_request
.
labels
.
any?
-
merge_request
.
labels
.
each
do
|
label
|
=
link_to_label
(
label
,
subject:
merge_request
.
project
,
type: :merge_request
)
-
if
merge_request
.
tasks?
%span
.task-status
...
...
This diff is collapsed.
Click to expand it.
changelogs/unreleased/optimize-mr-index.yml
0 → 100644
View file @
7c5af3ea
---
title
:
More aggressively preload on merge request and issue index pages
merge_request
:
author
:
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