diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-14 15:10:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-14 15:10:35 +0000 |
commit | 7172fb10313a9a7790f8e033b347e77df4987154 (patch) | |
tree | fe1fda5411240ba303bdd1032d12a94ccd58c27c /app/views/projects/commits/_commits.html.haml | |
parent | 793d974d7c4bd8c9cbd437a9e35087092f4e8bea (diff) | |
download | gitlab-ce-7172fb10313a9a7790f8e033b347e77df4987154.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/views/projects/commits/_commits.html.haml')
-rw-r--r-- | app/views/projects/commits/_commits.html.haml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml index 9e2dca3ad71..e6c9a7166a9 100644 --- a/app/views/projects/commits/_commits.html.haml +++ b/app/views/projects/commits/_commits.html.haml @@ -3,8 +3,8 @@ - ref = local_assigns.fetch(:ref) { merge_request&.source_branch } - can_update_merge_request = can?(current_user, :update_merge_request, @merge_request) -- commits = @commits -- context_commits = @context_commits +- commits = @commits&.map { |commit| commit.present(current_user: current_user) } +- context_commits = @context_commits&.map { |commit| commit.present(current_user: current_user) } - hidden = @hidden_commit_count - commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, daily_commits| @@ -14,7 +14,10 @@ %li.commits-row{ data: { day: day } } %ul.content-list.commit-list.flex-list - = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request } + - if Feature.enabled?(:cached_commits, project, default_enabled: :yaml) + = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } + - else + = render partial: 'projects/commits/commit', collection: daily_commits, locals: { project: project, ref: ref, merge_request: merge_request } - if context_commits.present? %li.commit-header.js-commit-header @@ -25,7 +28,10 @@ %li.commits-row %ul.content-list.commit-list.flex-list - = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request } + - if Feature.enabled?(:cached_commits, project, default_enabled: :yaml) + = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request }, cached: -> (commit) { commit_partial_cache_key(commit, ref: ref, merge_request: merge_request, request: request) } + - else + = render partial: 'projects/commits/commit', collection: context_commits, locals: { project: project, ref: ref, merge_request: merge_request } - if hidden > 0 %li.gl-alert.gl-alert-warning |