Commit 68249f23dacbddf61ca296a7decf98ecf6fc16fb
1 parent
d701d586
Exists in
spb-stable
and in
3 other branches
Prevent Compare page timout for large amount of commits
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
3 changed files
with
15 additions
and
1 deletions
Show diff stats
CHANGELOG
1 | v 6.6.0 | 1 | v 6.6.0 |
2 | - Permissions: Developer now can manage issue tracker (modify any issue) | 2 | - Permissions: Developer now can manage issue tracker (modify any issue) |
3 | + - Improve Code Compare page performance | ||
3 | 4 | ||
4 | v 6.5.1 | 5 | v 6.5.1 |
5 | - Fix branch selectbox when create merge request from fork | 6 | - Fix branch selectbox when create merge request from fork |
app/assets/stylesheets/generic/lists.scss
app/views/projects/compare/show.html.haml
@@ -15,7 +15,14 @@ | @@ -15,7 +15,14 @@ | ||
15 | %div.ui-box | 15 | %div.ui-box |
16 | .title | 16 | .title |
17 | Commits (#{@commits.count}) | 17 | Commits (#{@commits.count}) |
18 | - %ul.well-list= render Commit.decorate(@commits), project: @project | 18 | + - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE |
19 | + %ul.well-list | ||
20 | + - Commit.decorate(@commits.first(MergeRequestDiff::COMMITS_SAFE_SIZE)).each do |commit| | ||
21 | + = render "projects/commits/inline_commit", commit: commit, project: @project | ||
22 | + %li.warning-row.unstyled | ||
23 | + other #{@commits.size - MergeRequestDiff::COMMITS_SAFE_SIZE} commits hidden to prevent performance issues. | ||
24 | + - else | ||
25 | + %ul.well-list= render Commit.decorate(@commits), project: @project | ||
19 | 26 | ||
20 | - unless @diffs.empty? | 27 | - unless @diffs.empty? |
21 | %h4 Diff | 28 | %h4 Diff |