Commit 68249f23dacbddf61ca296a7decf98ecf6fc16fb

Authored by Dmitriy Zaporozhets
1 parent d701d586

Prevent Compare page timout for large amount of commits

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
CHANGELOG
1 1 v 6.6.0
2 2 - Permissions: Developer now can manage issue tracker (modify any issue)
  3 + - Improve Code Compare page performance
3 4  
4 5 v 6.5.1
5 6 - Fix branch selectbox when create merge request from fork
... ...
app/assets/stylesheets/generic/lists.scss
... ... @@ -23,6 +23,12 @@
23 23 }
24 24 }
25 25  
  26 + &.warning-row {
  27 + background-color: #fcf8e3;
  28 + border-color: #faebcc;
  29 + color: #8a6d3b;
  30 + }
  31 +
26 32 &.smoke { background-color: #f5f5f5; }
27 33  
28 34 &:hover {
... ...
app/views/projects/compare/show.html.haml
... ... @@ -15,7 +15,14 @@
15 15 %div.ui-box
16 16 .title
17 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 27 - unless @diffs.empty?
21 28 %h4 Diff
... ...